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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Ryosuke Kamesawa
November 19, 2019
Programming
540
0
Share
Cargo-makeを使ってみた
RustのビルドツールCargoを拡張するタスクランナーCargo-makeの紹介と使ってみた感想を話します。
Ryosuke Kamesawa
November 19, 2019
More Decks by Ryosuke Kamesawa
See All by Ryosuke Kamesawa
推論エンジンMAXの紹介
emakryo
1
580
ニューラルネットワークの量子化手法の紹介
emakryo
3
3.6k
MediaPipeの紹介
emakryo
0
110
Customizing Cargo for Cross Compiling
emakryo
0
44
Feature Store in DRIVE CHART
emakryo
0
82
Feature StoreをRustで実装した話
emakryo
0
54
なぜRustか?
emakryo
0
72
rustdef: Rust on Jupyter Notebook
emakryo
0
62
Machine Learning on Graph Data @ICML2019
emakryo
0
60
Other Decks in Programming
See All in Programming
「速くなった気がする」をデータで疑う
senleaf24
0
170
Xdebug と IDE による デバッグ実行の仕組みを見る / Exploring-How-Debugging-Works-with-Xdebug-and-an-IDE
shin1x1
0
380
Radical Imagining - LIFT 2025-2027 Policy Agenda
lift1998
0
310
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
210
Claude Codeをカスタムして自分だけのClaude Codeを作ろう
terisuke
0
130
PCOVから学ぶコードカバレッジ #phpcon_odawara
o0h
PRO
0
260
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
1
110
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
2
110
tRPCの概要と少しだけパフォーマンス
misoton665
2
170
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
780
How Swift's Type System Guides AI Agents
koher
0
250
CDK Deployのための ”反響定位”
watany
4
750
Featured
See All Featured
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
310
YesSQL, Process and Tooling at Scale
rocio
174
15k
Building Adaptive Systems
keathley
44
3k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
130
Statistics for Hackers
jakevdp
799
230k
Amusing Abliteration
ianozsvald
1
150
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
The World Runs on Bad Software
bkeepers
PRO
72
12k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
380
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
A Soul's Torment
seathinner
6
2.7k
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 是非使ってみてください - 他にいいツールがあったら教えてください