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
390
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
530
ニューラルネットワークの量子化手法の紹介
emakryo
3
3k
MediaPipeの紹介
emakryo
0
61
Customizing Cargo for Cross Compiling
emakryo
0
33
Feature Store in DRIVE CHART
emakryo
0
49
Feature StoreをRustで実装した話
emakryo
0
43
なぜRustか?
emakryo
0
40
rustdef: Rust on Jupyter Notebook
emakryo
0
38
Machine Learning on Graph Data @ICML2019
emakryo
0
28
Other Decks in Programming
See All in Programming
Yes, You Can Work on Rails & any other Gem
kaspth
0
110
[SRE NEXT] 複雑なシステムにおけるUser Journey SLOの導入
yakenji
0
740
PHPUnitの限界をPlaywrightで補完するテストアプローチ
yuzneri
0
270
No Install CMS戦略 〜 5年先を見据えたフロントエンド開発を考える / no_install_cms
rdlabo
0
260
コーディングエージェント概観(2025/07)
itsuki_t88
0
130
オンコール⼊⾨〜ページャーが鳴る前に、あなたが備えられること〜 / Before The Pager Rings
yktakaha4
2
1.1k
ISUCON研修おかわり会 講義スライド
arfes0e2b3c
1
480
マッチングアプリにおけるフリックUIで苦労したこと
yuheiito
0
240
効率的な開発手段として VRTを活用する
ishkawa
1
180
AIコーディングエージェント全社導入とセキュリティ対策
hikaruegashira
12
7.3k
The Modern View Layer Rails Deserves: A Vision For 2025 And Beyond @ RailsConf 2025, Philadelphia, PA
marcoroth
2
790
GPUを計算資源として使おう!
primenumber
1
290
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
329
21k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.5k
Embracing the Ebb and Flow
colly
86
4.8k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
A better future with KSS
kneath
238
17k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
370
A designer walks into a library…
pauljervisheath
207
24k
Being A Developer After 40
akosma
90
590k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Why Our Code Smells
bkeepers
PRO
337
57k
KATA
mclloyd
30
14k
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 是非使ってみてください - 他にいいツールがあったら教えてください