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
310
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
490
ニューラルネットワークの量子化手法の紹介
emakryo
3
2.7k
MediaPipeの紹介
emakryo
0
45
Customizing Cargo for Cross Compiling
emakryo
0
30
Feature Store in DRIVE CHART
emakryo
0
41
Feature StoreをRustで実装した話
emakryo
0
38
なぜRustか?
emakryo
0
35
rustdef: Rust on Jupyter Notebook
emakryo
0
32
Machine Learning on Graph Data @ICML2019
emakryo
0
20
Other Decks in Programming
See All in Programming
Ruby's Line Breaks
yui_knk
2
480
パスキーのすべて / 20250324 iddance Lesson.5
kuralab
0
150
Chrome Extension Techniques from Hell
moznion
1
160
趣味全開のAITuber開発
kokushin
0
190
PHPバージョンアップから始めるOSSコントリビュート / how2oss-contribute
dmnlk
1
990
Qiita Bash
mercury_dev0517
1
190
Rollupのビルド時間高速化によるプレビュー表示速度改善とバンドラとASTを駆使したプロダクト開発の難しさ
plaidtech
PRO
1
160
地域ITコミュニティの活性化とAWSに移行してみた話
yuukis
0
230
Enterprise Web App. Development (1): Build Tool Training Ver. 5
knakagawa
1
110
SQL Server ベクトル検索
odashinsuke
0
170
CRE Meetup!ユーザー信頼性を支えるエンジニアリング実践例の発表資料です
tmnb
0
630
Agentic Applications with Symfony
el_stoffel
2
270
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.5k
Testing 201, or: Great Expectations
jmmastey
42
7.4k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
13
660
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
650
GitHub's CSS Performance
jonrohan
1030
460k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
19
1.1k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
135
33k
What's in a price? How to price your products and services
michaelherold
245
12k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
A better future with KSS
kneath
239
17k
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 是非使ってみてください - 他にいいツールがあったら教えてください