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
570
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Cargo-makeを使ってみた
RustのビルドツールCargoを拡張するタスクランナーCargo-makeの紹介と使ってみた感想を話します。
Ryosuke Kamesawa
November 19, 2019
More Decks by Ryosuke Kamesawa
See All by Ryosuke Kamesawa
推論エンジンMAXの紹介
emakryo
1
620
ニューラルネットワークの量子化手法の紹介
emakryo
3
3.7k
MediaPipeの紹介
emakryo
0
120
Customizing Cargo for Cross Compiling
emakryo
0
51
Feature Store in DRIVE CHART
emakryo
0
94
Feature StoreをRustで実装した話
emakryo
0
62
なぜRustか?
emakryo
0
83
rustdef: Rust on Jupyter Notebook
emakryo
0
67
Machine Learning on Graph Data @ICML2019
emakryo
0
67
Other Decks in Programming
See All in Programming
Oxcを導入して開発体験が向上した話
yug1224
4
350
The Bowling Game- From Imperative to Functional Programming - Part 1
philipschwarz
PRO
0
130
TAKTでAI駆動開発の品質を設計する
j5ik2o
7
1.6k
エージェンティックRAGにAWSで入門しよう!
har1101
9
1.8k
OS アップデート対応の取り組み方がもっと共有されてほしい
andpad
0
110
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
180
自作OSでスライド発表する
uyuki234
0
2.5k
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
180
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
1
600
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
260
ローカルLLMでどこまでコードが書けるか -縮小版 / How much code can be written on a local LLM Shortened
kishida
2
150
LaravelLive Japan の裏方のすべて — 第188回 PHP勉強会@東京 (2026-06-24)
suguruooki
2
140
Featured
See All Featured
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
Ruling the World: When Life Gets Gamed
codingconduct
0
270
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.6k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
400
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
880
Paper Plane
katiecoart
PRO
1
52k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
240
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
160
The Mindset for Success: Future Career Progression
greggifford
PRO
0
370
Into the Great Unknown - MozCon
thekraken
41
2.6k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
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 是非使ってみてください - 他にいいツールがあったら教えてください