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
530
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
43
Feature Store in DRIVE CHART
emakryo
0
82
Feature StoreをRustで実装した話
emakryo
0
53
なぜRustか?
emakryo
0
72
rustdef: Rust on Jupyter Notebook
emakryo
0
62
Machine Learning on Graph Data @ICML2019
emakryo
0
59
Other Decks in Programming
See All in Programming
仕様漏れ実装漏れをなくすトレーサビリティAI基盤のご紹介
orgachem
PRO
8
5.1k
YJITとZJITにはイカなる違いがあるのか?
nakiym
0
110
PCOVから学ぶコードカバレッジ #phpcon_odawara
o0h
PRO
0
230
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
130
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
440
AIエージェントで業務改善してみた
taku271
0
500
存在論的プログラミング: 時間と存在を記述する
koriym
5
830
RSAが破られる前に知っておきたい 耐量子計算機暗号(PQC)入門 / Intro to PQC: Preparing for the Post-RSA Era
mackey0225
3
120
Running Swift without an OS
kishikawakatsumi
0
380
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
4
2.9k
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
3
740
20260320登壇資料
pharct
0
160
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Un-Boring Meetings
codingconduct
0
260
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
160
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
170
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Balancing Empowerment & Direction
lara
5
1k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
89
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
200
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
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 是非使ってみてください - 他にいいツールがあったら教えてください