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
510
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.5k
MediaPipeの紹介
emakryo
0
98
Customizing Cargo for Cross Compiling
emakryo
0
39
Feature Store in DRIVE CHART
emakryo
0
78
Feature StoreをRustで実装した話
emakryo
0
49
なぜRustか?
emakryo
0
66
rustdef: Rust on Jupyter Notebook
emakryo
0
55
Machine Learning on Graph Data @ICML2019
emakryo
0
51
Other Decks in Programming
See All in Programming
AIに任せる範囲を安全に広げるためにやっていること
fukucheee
0
110
Rubyと楽しいをつくる / Creating joy with Ruby
chobishiba
0
210
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
200
日本だけで解禁されているアプリ起動の方法
ryunakayama
0
370
Event Storming
hschwentner
3
1.3k
Rails Girls Tokyo 18th GMO Pepabo Sponsor Talk
yutokyokutyo
0
200
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
160
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
1
820
Fundamentals of Software Engineering In the Age of AI
therealdanvega
1
200
株式会社 Sun terras カンパニーデック
sunterras
0
2k
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
300
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
470
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
46
8.1k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
120
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
140
My Coaching Mixtape
mlcsv
0
64
エンジニアに許された特別な時間の終わり
watany
106
240k
A designer walks into a library…
pauljervisheath
210
24k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
64
53k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
300
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
80
The Curse of the Amulet
leimatthew05
1
9.6k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
240
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 是非使ってみてください - 他にいいツールがあったら教えてください