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
460
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.4k
MediaPipeの紹介
emakryo
0
75
Customizing Cargo for Cross Compiling
emakryo
0
37
Feature Store in DRIVE CHART
emakryo
0
61
Feature StoreをRustで実装した話
emakryo
0
47
なぜRustか?
emakryo
0
46
rustdef: Rust on Jupyter Notebook
emakryo
0
42
Machine Learning on Graph Data @ICML2019
emakryo
0
38
Other Decks in Programming
See All in Programming
Claude Code on the Web を超える!? Codex Cloud の実践テク5選
sunagaku
0
580
CloudNative Days Winter 2025: 一週間で作る低レイヤコンテナランタイム
ternbusty
7
1.6k
GeistFabrik and AI-augmented software development
adewale
PRO
0
120
なぜ強調表示できず ** が表示されるのか — Perlで始まったMarkdownの歴史と日本語文書における課題
kwahiro
12
7k
Querying Design System デザインシステムの意思決定を支える構造検索
ikumatadokoro
1
1.2k
Duke on CRaC with Jakarta EE
ivargrimstad
0
130
AIと協働し、イベントソーシングとアクターモデルで作る後悔しないアーキテクチャ Regret-Free Architecture with AI, Event Sourcing, and Actors
tomohisa
2
5.6k
Honoを技術選定したAI要件定義プラットフォームAcsimでの意思決定
codenote
0
250
The Missing Link in Angular's Signal Story: Resource API and httpResource
manfredsteyer
PRO
0
140
イベントストーミングのはじめかた / Getting Started with Event Storming
nrslib
1
650
仕様がそのままテストになる!Javaで始める振る舞い駆動開発
ohmori_yusuke
8
4.6k
乱雑なコードの整理から学ぶ設計の初歩
masuda220
PRO
32
14k
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
What's in a price? How to price your products and services
michaelherold
246
12k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Fireside Chat
paigeccino
41
3.7k
Automating Front-end Workflow
addyosmani
1371
200k
BBQ
matthewcrist
89
9.9k
Bash Introduction
62gerente
615
210k
The Language of Interfaces
destraynor
162
25k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.3k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
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 是非使ってみてください - 他にいいツールがあったら教えてください