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活用のコスパを最大化する方法
ochtum
0
120
朝日新聞のデジタル版を支えるGoバックエンド ー価値ある情報をいち早く確実にお届けするために
junkiishida
1
360
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
350
Head of Engineeringが現場で回した生産性向上施策 2025→2026
gessy0129
0
210
日本だけで解禁されているアプリ起動の方法
ryunakayama
0
370
Rubyと楽しいをつくる / Creating joy with Ruby
chobishiba
0
200
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
370
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
220
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
170
JPUG勉強会 OSSデータベースの内部構造を理解しよう
oga5
2
230
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
1.6k
CSC307 Lecture 11
javiergs
PRO
0
590
Featured
See All Featured
Scaling GitHub
holman
464
140k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Building Applications with DynamoDB
mza
96
6.9k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
80
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
240
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
220
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
280
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
96
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 是非使ってみてください - 他にいいツールがあったら教えてください