Skip to content

Ability to inherit a dependency path while overriding the version requirement #15526

@TroyKomodo

Description

@TroyKomodo

Problem

In cargo workspace

crates {a, b, c}

a requires: b >= 1.0

c requires: b >= 1.1

b is at 1.2.0

how can I specify these versioning conditions when publishing to crates io without resorting to using path = "../../b" or some other combination of path based providing.
Currently workspace deps override the version config value.

Proposed Solution

Have a new config member = true which allows you to reference workspace members directly without using a workspace dep and then allow that member to have version ranges and if not provided use the current version of the member.

I don't like the idea of paths because it makes it increasingly messy. I think its silly we need to declare workspace members as part the workspace-deps list.

Alternatives

  1. Allow for a new template in the path syntax to resolve to the root of the workspace b = { path = "{root}/crates/b" }

  2. Lift the restriction of workspace version inheritance and instead allow workspace deps to override the version.

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-manifestArea: Cargo.toml issuesA-workspace-inheritanceArea: workspace inheritance RFC 2906C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions