Rust packaging: Difference between revisions
From wikinotes
Line 6: | Line 6: | ||
For full details, see [[rust cargo]]. | For full details, see [[rust cargo]]. | ||
== Add Dependency == | == Add/Update Dependency == | ||
<blockquote> | <blockquote> | ||
Add a dependency, or change version-request. | |||
<syntaxhighlight lang="toml"> | |||
# ${project}/Cargo.toml | |||
# ... | |||
[dependencies] | |||
rand = "0.8.5" | |||
</syntaxhighlight> | |||
Build | |||
<syntaxhighlight lang="bash"> | |||
cargo build | |||
</syntaxhighlight> | |||
That's it. | |||
</blockquote><!-- Add Dependency --> | </blockquote><!-- Add Dependency --> | ||
Revision as of 21:39, 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/Update Dependency
Add a dependency, or change version-request.
# ${project}/Cargo.toml # ... [dependencies] rand = "0.8.5"Build
cargo build
That's it.
Update Dependency
Remove Dependency
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