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
280
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
470
ニューラルネットワークの量子化手法の紹介
emakryo
3
2.7k
MediaPipeの紹介
emakryo
0
44
Customizing Cargo for Cross Compiling
emakryo
0
30
Feature Store in DRIVE CHART
emakryo
0
39
Feature StoreをRustで実装した話
emakryo
0
37
なぜRustか?
emakryo
0
35
rustdef: Rust on Jupyter Notebook
emakryo
0
32
Machine Learning on Graph Data @ICML2019
emakryo
0
19
Other Decks in Programming
See All in Programming
やっと腹落ち「スプリント毎に動くモノをリリースする」〜ゼロから始めるメガバンクグループのアジャイル実践〜
sasakendayo
0
230
Generating OpenAPI schema from serializers throughout the Rails stack - Kyobashi.rb #5
envek
1
450
Boos Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
790
推しメソッドsource_locationのしくみを探る - はじめてRubyのコードを読んでみた
nobu09
2
370
ナレッジイネイブリングにAIを活用してみる ゆるSRE勉強会 #9
nealle
0
170
クックパッド検索システム統合/Cookpad Search System Consolidation
giga811
0
190
Kotlinの開発でも AIをいい感じに使いたい / Making the Most of AI in Kotlin Development
kohii00
5
2.1k
TCAを用いたAmebaのリアーキテクチャ
dazy
0
240
Amazon Bedrockマルチエージェントコラボレーションを諦めてLangGraphに入門してみた
akihisaikeda
1
180
自力でTTSモデルを作った話
zgock999
0
130
AIプログラミング雑キャッチアップ
yuheinakasaka
21
5.4k
5分で理解する SOLID 原則 #phpcon_nagoya
shogogg
1
430
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
134
33k
Facilitating Awesome Meetings
lara
53
6.3k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
11
560
GraphQLの誤解/rethinking-graphql
sonatard
69
10k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
30
4.6k
Into the Great Unknown - MozCon
thekraken
35
1.7k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
Git: the NoSQL Database
bkeepers
PRO
429
65k
Done Done
chrislema
182
16k
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 是非使ってみてください - 他にいいツールがあったら教えてください