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
250
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
450
ニューラルネットワークの量子化手法の紹介
emakryo
3
2.5k
MediaPipeの紹介
emakryo
0
40
Customizing Cargo for Cross Compiling
emakryo
0
27
Feature Store in DRIVE CHART
emakryo
0
36
Feature StoreをRustで実装した話
emakryo
0
36
なぜRustか?
emakryo
0
31
rustdef: Rust on Jupyter Notebook
emakryo
0
30
Machine Learning on Graph Data @ICML2019
emakryo
0
15
Other Decks in Programming
See All in Programming
ErdMap: Thinking about a map for Rails applications
makicamel
1
1.2k
Package Traits
ikesyo
2
230
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.3k
振り返れば奴(Cline)がいる
keiyagi
0
130
Fibonacci Function Gallery - Part 2
philipschwarz
PRO
0
230
Amazon ECS とマイクロサービスから考えるシステム構成
hiyanger
1
190
watsonx.ai Dojo #6 継続的なAIアプリ開発と展開
oniak3ibm
PRO
0
270
Scaling your build logic
antalmonori
1
150
PicoRubyと暮らす、シェアハウスハック
ryosk7
0
250
Java Webフレームワークの現状 / java web framework at burikaigi
kishida
9
2k
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
140
Linux && Docker 研修/Linux && Docker training
forrep
23
4.1k
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.6k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
39
1.9k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Thoughts on Productivity
jonyablonski
68
4.4k
Producing Creativity
orderedlist
PRO
343
39k
KATA
mclloyd
29
14k
Adopting Sorbet at Scale
ufuk
74
9.2k
How STYLIGHT went responsive
nonsquared
96
5.3k
Rails Girls Zürich Keynote
gr2m
94
13k
Building Your Own Lightsaber
phodgson
104
6.2k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.4k
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 是非使ってみてください - 他にいいツールがあったら教えてください