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
410
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
540
ニューラルネットワークの量子化手法の紹介
emakryo
3
3.1k
MediaPipeの紹介
emakryo
0
67
Customizing Cargo for Cross Compiling
emakryo
0
33
Feature Store in DRIVE CHART
emakryo
0
52
Feature StoreをRustで実装した話
emakryo
0
44
なぜRustか?
emakryo
0
42
rustdef: Rust on Jupyter Notebook
emakryo
0
39
Machine Learning on Graph Data @ICML2019
emakryo
0
32
Other Decks in Programming
See All in Programming
Rancher と Terraform
fufuhu
1
130
詳解!defer panic recover のしくみ / Understanding defer, panic, and recover
convto
0
190
ライブ配信サービスの インフラのジレンマ -マルチクラウドに至ったワケ-
mirrativ
2
270
AIレビュアーをスケールさせるには / Scaling AI Reviewers
technuma
2
230
Ruby Parser progress report 2025
yui_knk
1
220
物語を動かす行動"量" #エンジニアニメ
konifar
14
5.6k
Honoアップデート 2025年夏
yusukebe
1
870
Zendeskのチケットを Amazon Bedrockで 解析した
ryokosuge
2
180
MLH State of the League: 2026 Season
theycallmeswift
0
180
あのころの iPod を どうにか再生させたい
orumin
2
2.5k
MCPで実現するAIエージェント駆動のNext.jsアプリデバッグ手法
nyatinte
7
980
パスタの技術
yusukebe
1
540
Featured
See All Featured
Gamification - CAS2011
davidbonilla
81
5.4k
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
How to Think Like a Performance Engineer
csswizardry
26
1.8k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Designing Experiences People Love
moore
142
24k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.5k
We Have a Design System, Now What?
morganepeng
53
7.8k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.4k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
KATA
mclloyd
32
14k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
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 是非使ってみてください - 他にいいツールがあったら教えてください