Skip to content

Cannot compile crate with cargo <1.71 if any crate in workspace depends on a crate that uses dep: syntax #15360

Open
@nicoburns

Description

@nicoburns

Problem

There is a backwards compatibility hazard with dep: syntax in Cargo.toml files.

  • Given a workspace with N crates
  • If any of those crates depend (even transitively) on a crate that uses dep: syntax
  • Then no crate in the workspace can be compiled with cargo/rustc older than 1.71

This means that a crate that wants to maintain a low MSRV cannot be combined in a workspace with:

  • Other crates in the workspace with higher MSRV
  • Examples that depend on crates with higher MSRV
  • Tooling or scripts that depend on crates with higher MSRV

Steps

No response

Possible Solution(s)

Perhaps there could be a way to include crates in a workspace for the purpose of being accessible with --package and --workspace being possible to set it as a default crate to compile, but without dependencies being unified with the rest of the workspace?

Something like this would also be good for examples which I find generally work better as separate crates except for the fact that you then can't call them with --example.

Notes

This can be worked around by not using workspaces and splitting the repo into separate Cargo projects. But this is not ideal.

Version

Any version of cargo older than 1.71 (1.71 is not affected, 1.70 is)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lockfileArea: Cargo.lock issuesA-manifestArea: Cargo.toml issuesA-workspacesArea: workspacesC-bugCategory: bugS-needs-rfcStatus: Needs an RFC to make progress.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions