Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Cargo-makeを使ってみた
Search
Ryosuke Kamesawa
November 19, 2019
Programming
0
520
Cargo-makeを使ってみた
RustのビルドツールCargoを拡張するタスクランナーCargo-makeの紹介と使ってみた感想を話します。
Ryosuke Kamesawa
November 19, 2019
Tweet
Share
More Decks by Ryosuke Kamesawa
See All by Ryosuke Kamesawa
推論エンジンMAXの紹介
emakryo
1
570
ニューラルネットワークの量子化手法の紹介
emakryo
3
3.6k
MediaPipeの紹介
emakryo
0
100
Customizing Cargo for Cross Compiling
emakryo
0
41
Feature Store in DRIVE CHART
emakryo
0
80
Feature StoreをRustで実装した話
emakryo
0
51
なぜRustか?
emakryo
0
69
rustdef: Rust on Jupyter Notebook
emakryo
0
58
Machine Learning on Graph Data @ICML2019
emakryo
0
55
Other Decks in Programming
See All in Programming
へんな働き方
yusukebe
5
2.8k
OTP を自動で入力する裏技
megabitsenmzq
0
120
モダンOBSプラグイン開発
umireon
0
180
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
1.1k
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
550
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1.3k
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
160
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
150
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
330
nuget-server - あなたが必要だったNuGetサーバー
kekyo
PRO
0
440
20260313 - Grafana & Friends Taipei #1 - Kubernetes v1.36 的開發雜記:那些困在 Alpha 加護病房太久的 Metrics
tico88612
0
230
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
1.1k
Featured
See All Featured
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
490
Scaling GitHub
holman
464
140k
First, design no harm
axbom
PRO
2
1.1k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
820
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.5k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
300
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
150
Automating Front-end Workflow
addyosmani
1370
200k
WCS-LA-2024
lcolladotor
0
490
Docker and Python
trallard
47
3.8k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Context Engineering - Making Every Token Count
addyosmani
9
770
Transcript
cargo-makeを 使ってみた話 Ryosuke Kamesawa
自己紹介 - 亀澤諒亮, Ryosuke Kamesawa - Twitter: @cruelturtle - 仕事でrustを触り始めた
- 10月〜 - 競プロ・機械学習
Build tool 何使ってます?
Cargo https://doc.rust-lang.org/cargo/
GNU make https://www.gnu.org/graphics/heckert_gnu.html
Build tools - Cargo - Rust標準 - ビルド作業は一通りできる - lint,
compile, link, test, ..etc - GNU Make - 言語に縛られないビルドツールのデファクト - 大抵なんでもできる - 目的のファイルの生成 - PHONYターゲット
Cargo + Make? - Rust projectでも簡単に複雑なタスクを実行したい - makeでいうPHONYターゲット - e.g.
- 自動生成されたコードのclean - CIとして実行される一連のタスク - Cargoがあるのにmakeを使うのも…
Cargo-make???
cargo-make https://sagiegurari.github.io/cargo-make/ Rust task runner and build tool. - Rustに特化したタスクランナー
- Makefile.toml - 様々なタスクの書き方 - Shell command - Shell script - Rust - etc…
Makefile.toml [tasks.all] dependencies = [ "clippy", "test", "reformat", ] [tasks.reformat]
script = ["cargo fmt -- --emit files"]
ここが便利 - Predefined tasks - CIがラク - clippy, coverage, doc,
… - これだけでそれっぽいタスクが走る $ cargo make ci-flow - 自動インストール - e.g. cargo-audit, cargo-tarpaulin, kcov, …
その他の機能 - Profile - 環境変数の切り替え - Platform override - Linux,
Mac, Windowsで切り替え - Conditional execution - Profile, 環境変数等による条件実行 - Watch changes - ファイルの変更を検知して実行 - etc...
ハマりポイント - Predefined task - 意図せずpredefined taskに上書かれてしまう - Dependencies -
(基本的に)上から順に実行 - 依存しているタスクの中で さらに依存関係がある場合は要注意 - Workspaces - デフォルトではworkspaceごとに 別のタスクとして実行される
欠点 - Timestampに応じたビルドはできない - rustのビルドはあくまでcargoの仕事 - Contributeしましょう!(自分でやれ
最後に - 深入りしすぎなければ便利 - cargo-make 是非使ってみてください - 他にいいツールがあったら教えてください