Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verification does not respect workspace members with a virtual workspace #745

Open
wookietreiber opened this issue Jul 15, 2023 · 4 comments

Comments

@wookietreiber
Copy link
Contributor

top-level Cargo.toml:

[workspace]
members = [
    "a",
    "b",
]

running cargo msrv verify in top-level dir:

$ cargo msrv verify
Fetching index
Unable to find key 'package.rust-version' (or 'package.metadata.msrv') in '/path/to/top-level/Cargo.toml'

I can certainly do this as a workaround:

cargo msrv --path a verify
cargo msrv --path b verify

... or cd/pushd my way into the workspace members, but this gets annoying, especially considering:

  • this example only has 2 workspace members, consider having a lot more members
  • the expectation that all cargo commands respect workspace members, at the least with a --workspace or the deprecated --all flag
  • verification in CI, it's not possible to have a simple cargo msrv verify snippet that can be copy-pasted to other projects, because you'd have to manually edit the snippet and explicitly use --path member for all you want to check
@wookietreiber
Copy link
Contributor Author

wookietreiber commented Jul 15, 2023

My recommendation / ideal solution is:

  • by default, check all workspace members, not only when there is a virtual workspace
  • add a short -p variant to --path to mimic other cargo commands, likely even rename --path to --package (for full mimicry) and add --path as an alias for compatibility
  • add --workspace to force/override -p|--package|--path, these should override each other as they do in other cargo commands

@foresterre
Copy link
Owner

add a short -p variant to --path to mimic other cargo commands, likely even rename --path to --package (for full mimicry) and add --path as an alias for compatibility

While -p would be better indeed, a cargo like alternative to --path exists: --manifest-path <Cargo.toml>

@foresterre
Copy link
Owner

See also: #295 and #590

@wookietreiber
Copy link
Contributor Author

--manifest-path doesn't appear in cargo msrv --help nor in cargo msrv verify --help, is that not released yet / only in the 0.16 betas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants