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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
71
Feature StoreをRustで実装した話
emakryo
0
49
なぜRustか?
emakryo
0
64
rustdef: Rust on Jupyter Notebook
emakryo
0
51
Machine Learning on Graph Data @ICML2019
emakryo
0
48
Other Decks in Programming
See All in Programming
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
460
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
250
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
600
CSC307 Lecture 08
javiergs
PRO
0
670
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
140
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
200
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
200
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
170
ぼくの開発環境2026
yuzneri
0
240
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
310
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
220
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
200
Featured
See All Featured
Amusing Abliteration
ianozsvald
0
100
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
920
Designing for humans not robots
tammielis
254
26k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
270
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
Paper Plane
katiecoart
PRO
0
46k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
94
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
380
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.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 是非使ってみてください - 他にいいツールがあったら教えてください