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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ryosuke Kamesawa
November 19, 2019
Programming
0
500
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
560
ニューラルネットワークの量子化手法の紹介
emakryo
3
3.5k
MediaPipeの紹介
emakryo
0
92
Customizing Cargo for Cross Compiling
emakryo
0
38
Feature Store in DRIVE CHART
emakryo
0
72
Feature StoreをRustで実装した話
emakryo
0
49
なぜRustか?
emakryo
0
64
rustdef: Rust on Jupyter Notebook
emakryo
0
52
Machine Learning on Graph Data @ICML2019
emakryo
0
48
Other Decks in Programming
See All in Programming
Metaprogramming isn't real, it can't hurt you
okuramasafumi
0
110
組織で育むオブザーバビリティ
ryota_hnk
0
180
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
310
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1.1k
AI巻き込み型コードレビューのススメ
nealle
2
1.6k
Data-Centric Kaggle
isax1015
2
790
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
470
dchart: charts from deck markup
ajstarks
3
1k
AI & Enginnering
codelynx
0
130
Sekiban + Microsoft Orleans のアクターをAWS対応しました / Sekiban + Microsoft Orleans actors are now supported on AWS.
tomohisa
0
100
24時間止められないシステムを守る-医療ITにおけるランサムウェア対策の実際
koukimiura
1
140
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
390
Featured
See All Featured
Speed Design
sergeychernyshev
33
1.5k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
BBQ
matthewcrist
89
10k
Bash Introduction
62gerente
615
210k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
150
Code Review Best Practice
trishagee
74
20k
KATA
mclloyd
PRO
34
15k
Into the Great Unknown - MozCon
thekraken
40
2.3k
Producing Creativity
orderedlist
PRO
348
40k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
120
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
78
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
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 是非使ってみてください - 他にいいツールがあったら教えてください