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
330
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
500
ニューラルネットワークの量子化手法の紹介
emakryo
3
2.8k
MediaPipeの紹介
emakryo
0
48
Customizing Cargo for Cross Compiling
emakryo
0
31
Feature Store in DRIVE CHART
emakryo
0
42
Feature StoreをRustで実装した話
emakryo
0
38
なぜRustか?
emakryo
0
36
rustdef: Rust on Jupyter Notebook
emakryo
0
33
Machine Learning on Graph Data @ICML2019
emakryo
0
21
Other Decks in Programming
See All in Programming
note の Elasticsearch 更新系を支える技術
tchov
9
3.4k
オープンソースコントリビュート入門
_katsuma
0
120
Serving TUIs over SSH with Go
caarlos0
0
560
スモールスタートで始めるためのLambda×モノリス(Lambdalith)
akihisaikeda
2
340
Bedrock×MCPで社内ブログ執筆文化を育てたい!
har1101
7
1.4k
Memory API : Patterns, Performance et Cas d'Utilisation
josepaumard
1
170
API for docs
soutaro
3
1.6k
Creating Awesome Change in SmartNews! En
martin_lover
0
110
Orleans + Sekiban + SignalR でリアルタイムWeb作ってみた
tomohisa
0
230
Contribute to Comunities | React Tokyo Meetup #4 LT
sasagar
0
590
generative-ai-use-cases(GenU)の推しポイント ~2025年4月版~
hideg
1
370
プロダクトエンジニアのしごと 〜 受託 × 高難度を乗り越えるOptium開発 〜
algoartis
0
150
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
329
21k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Why Our Code Smells
bkeepers
PRO
336
57k
The Cult of Friendly URLs
andyhume
78
6.3k
Designing for Performance
lara
608
69k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.6k
Optimizing for Happiness
mojombo
378
70k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Adopting Sorbet at Scale
ufuk
76
9.3k
Embracing the Ebb and Flow
colly
85
4.7k
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 是非使ってみてください - 他にいいツールがあったら教えてください