Rust packaging: Difference between revisions
From wikinotes
Line 6: | Line 6: | ||
For full details, see [[rust cargo]]. | For full details, see [[rust cargo]]. | ||
Add a dependency, change version-request, remove package | |||
Add a dependency, | |||
<syntaxhighlight lang="toml"> | <syntaxhighlight lang="toml"> | ||
# ${project}/Cargo.toml | # ${project}/Cargo.toml | ||
Line 18: | Line 16: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Build | Then Build | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
cargo build | cargo build | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Done. | |||
</blockquote><!-- Project Dependencies --> | </blockquote><!-- Project Dependencies --> | ||
Latest revision as of 21:40, 9 February 2023
Rust primarily uses rust cargo for packaging.
These packages are referred to as crates.
Project Dependencies
For full details, see rust cargo.
Add a dependency, change version-request, remove package
# ${project}/Cargo.toml # ... [dependencies] rand = "0.8.5"Then Build
cargo build
Done.
OS Package Management
See https://doc.rust-lang.org/cargo/commands/cargo-install.html
cargo install my_crate cargo install my_crate@1.1.1 cargo install --path /path/to/crate