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
26
Cargo-makeを使ってみた
RustのビルドツールCargoを拡張するタスクランナーCargo-makeの紹介と使ってみた感想を話します。
Ryosuke Kamesawa
November 19, 2019
Tweet
Share
More Decks by Ryosuke Kamesawa
See All by Ryosuke Kamesawa
ニューラルネットワークの量子化手法の紹介
emakryo
2
1.4k
MediaPipeの紹介
emakryo
0
22
Customizing Cargo for Cross Compiling
emakryo
0
13
Feature Store in DRIVE CHART
emakryo
0
22
Feature StoreをRustで実装した話
emakryo
0
21
なぜRustか?
emakryo
0
20
rustdef: Rust on Jupyter Notebook
emakryo
0
17
Machine Learning on Graph Data @ICML2019
emakryo
0
12
Neural Networks for Graph Data @NeurIPS2018
emakryo
0
14
Other Decks in Programming
See All in Programming
RubyGems on ruby.wasm
kateinoigakukun
0
120
WinActorの勉強を継続する方法
tamai_63
0
130
Enjoy Creative Coding with Ruby (RubyKaigi2024)
chobishiba
0
680
Namespace, What and Why
tagomoris
3
690
戦略的DDDは重いのか? / Is strategic DDD heavy?
pictiny
3
2.1k
[RubyKaigi 2024] Ruby Mixology 101: adding shots of PHP, Elixir, and more
palkan
0
130
教えて!スクラムコーチ品質とスピードのバランスはどうすりゃいいの?
pinboro
0
120
“Seeing Like a Programmer”—Resiliency, Limits, and Moral Hazards in Software Engineering (LambdaConf 2024)
chriskrycho
0
430
Documentation testsの恩恵 / Documentation testing benefits
ssssota
1
560
チーム立ち上げにAWSを活用したらClaudeさんに褒められた話
mkdev10
3
230
欠陥を早期に発見するための Software Engineer in Test とその重要性 / What is Software Engineer in Test and How they works
orgachem
PRO
17
2.4k
Findy - エンジニア向け会社紹介 / Findy Letter for Engineers
findyinc
2
74k
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
13
4.7k
Design by the Numbers
sachag
274
18k
The Pragmatic Product Professional
lauravandoore
26
5.9k
Mobile First: as difficult as doing things right
swwweet
217
8.6k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
Docker and Python
trallard
35
2.7k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
18
7k
Designing the Hi-DPI Web
ddemaree
276
33k
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
What's in a price? How to price your products and services
michaelherold
238
11k
Reflections from 52 weeks, 52 projects
jeffersonlam
345
19k
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 是非使ってみてください - 他にいいツールがあったら教えてください