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
420
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
540
ニューラルネットワークの量子化手法の紹介
emakryo
3
3.2k
MediaPipeの紹介
emakryo
0
69
Customizing Cargo for Cross Compiling
emakryo
0
34
Feature Store in DRIVE CHART
emakryo
0
54
Feature StoreをRustで実装した話
emakryo
0
44
なぜRustか?
emakryo
0
44
rustdef: Rust on Jupyter Notebook
emakryo
0
40
Machine Learning on Graph Data @ICML2019
emakryo
0
34
Other Decks in Programming
See All in Programming
Flutter with Dart MCP: All You Need - 박제창 2025 I/O Extended Busan
itsmedreamwalker
0
150
Navigating Dependency Injection with Metro
zacsweers
3
260
Azure SRE Agentで運用は楽になるのか?
kkamegawa
0
2.2k
print("Hello, World")
eddie
2
530
ファインディ株式会社におけるMCP活用とサービス開発
starfish719
0
350
AI Coding Agentのセキュリティリスク:PRの自己承認とメルカリの対策
s3h
0
200
Tool Catalog Agent for Bedrock AgentCore Gateway
licux
6
2.4k
Oracle Database Technology Night 92 Database Connection control FAN-AC
oracle4engineer
PRO
1
440
CloudflareのChat Agent Starter Kitで簡単!AIチャットボット構築
syumai
2
480
Improving my own Ruby thereafter
sisshiki1969
1
160
AIと私たちの学習の変化を考える - Claude Codeの学習モードを例に
azukiazusa1
10
4k
Introducing ReActionView: A new ActionView-compatible ERB Engine @ Rails World 2025, Amsterdam
marcoroth
0
690
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
RailsConf 2023
tenderlove
30
1.2k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
Reflections from 52 weeks, 52 projects
jeffersonlam
352
21k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.6k
Gamification - CAS2011
davidbonilla
81
5.4k
Why Our Code Smells
bkeepers
PRO
339
57k
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 是非使ってみてください - 他にいいツールがあったら教えてください