arceos icon indicating copy to clipboard operation
arceos copied to clipboard

Enhancement: manage dependency version via workspace.dependencies

Open WenyXu opened this issue 2 years ago • 3 comments

Considers managing dependencies version in root Cargo.toml.

i.g.,

# [PROJECT_DIR]/Cargo.toml
[workspace]
members = ["bar"]

[workspace.package]
version = "1.2.3"
authors = ["Nice Folks"]
description = "A short description of my package"
documentation = "https://example.com/bar"
# [PROJECT_DIR]/bar/Cargo.toml
[package]
name = "bar"
version.workspace = true
authors.workspace = true
description.workspace = true
documentation.workspace = true

We can utilize this to avoid dependency version conflicts in the sub-crates.

See also, https://doc.rust-lang.org/cargo/reference/workspaces.html#the-package-table

WenyXu avatar May 16 '23 16:05 WenyXu

After using this, do all crates need to have the same version?

equation314 avatar May 17 '23 07:05 equation314

After using this, do all crates need to have the same version?

No, it's configurable. If some crates try to use another version, keep setting a specific version instead of pkg.workspace = true.

WenyXu avatar May 17 '23 07:05 WenyXu

I haven't see the benefit of it, could you give a more detail example?

equation314 avatar May 17 '23 10:05 equation314

Done in #157.

equation314 avatar Oct 09 '24 03:10 equation314