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
440
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
550
ニューラルネットワークの量子化手法の紹介
emakryo
3
3.3k
MediaPipeの紹介
emakryo
0
73
Customizing Cargo for Cross Compiling
emakryo
0
36
Feature Store in DRIVE CHART
emakryo
0
58
Feature StoreをRustで実装した話
emakryo
0
47
なぜRustか?
emakryo
0
45
rustdef: Rust on Jupyter Notebook
emakryo
0
41
Machine Learning on Graph Data @ICML2019
emakryo
0
36
Other Decks in Programming
See All in Programming
What's new in Spring Modulith?
olivergierke
1
150
組込みだけじゃない!TinyGo で始める無料クラウド開発入門
otakakot
0
270
ソフトウェア設計の実践的な考え方
masuda220
PRO
4
580
株式会社 Sun terras カンパニーデック
sunterras
0
310
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
200
GraphQL×Railsアプリのデータベース負荷分散 - 月間3,000万人利用サービスを無停止で
koxya
1
1.3k
『毎日の移動』を支えるGoバックエンド内製開発
yutautsugi
2
250
理論と実務のギャップを超える
eycjur
0
140
PHPに関数型の魂を宿す〜PHP 8.5 で実現する堅牢なコードとは〜 #phpcon_hiroshima / phpcon-hiroshima-2025
shogogg
1
220
bootcamp2025_バックエンド研修_WebAPIサーバ作成.pdf
geniee_inc
0
110
Leading Effective Engineering Teams in the AI Era
addyosmani
5
420
あなたとKaigi on Rails / Kaigi on Rails + You
shimoju
0
160
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
620
Navigating Team Friction
lara
190
15k
Done Done
chrislema
185
16k
jQuery: Nuts, Bolts and Bling
dougneiner
65
7.9k
The Cult of Friendly URLs
andyhume
79
6.6k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Building a Modern Day E-commerce SEO Strategy
aleyda
44
7.8k
Optimizing for Happiness
mojombo
379
70k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.6k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.9k
Building Better People: How to give real-time feedback that sticks.
wjessup
369
20k
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 是非使ってみてください - 他にいいツールがあったら教えてください