-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Workspace inheritance reads from wrong workspace when one is nested inside of another #14645
Comments
Hm, unfortunately I'm not able to reproduce that. Can you include a |
FWIW, I opened it here because my assumption was that |
@ehuss certainly, but it'll take me a bit. Our To note, I went ahead and fixed the bug that was unnecessarily using |
I cannot reproduce it either. Guess there were something cached between the first and the second invocation. You might want to run The implementation of |
It took me a bit - I couldn't repro it either at first - but then I figured out what my minimal repro was missing: an empty See https://github.com/heaths/rust-lang-cargo-14645, specifically heaths/rust-lang-cargo-14645@19378e5. Note that the root crate imports a dependency by path, but that dependency is part of a separate workspace. In https://github.com/azure/azure-sdk-for-rust we are generating dozens of crates that we put into a separate workspace to avoid rust-analyzer perf degredation with hand-coded crates. One of those hand-coded crates is using the generated crate in its underlying implementation. That hand-coded crate has So somehow that empty |
What am I supposed to do with this to reproduce the issue? |
Clone the repo and run |
This also reproduces with rustc which is a more minimal case as an implementation detail of Cargo's development. I switched this out for I put in some debug statements in Cargo
The bug appears to be that our caching of parsed workspaces isn't taking into account all of the workspace load rules. This is a problem for all of workspace inheritance. I'm assuming this hasn't been found before as workspaces aren't usually nested but parallel to each other. |
Yeah, given what I've seen in the cargo docs and the Cargo.toml files I've looked at, I personally assumed that nested workspaces weren't really a thing, though I guess the
(Fortunately, in the scenario described in this issue, nobody actually wants the two workspaces to be related.) reference/workspaces.md also says:
and two things jump out at me:
Footnotes
|
If we're discussing possible design, I'd prefer the innermost since it follows quite a bit (most?) of similar concepts in our industry such as |
Problem
We have a monorepo where we want to manage some lints at the workspace level. We also have some CI scripts that set
RUSTFLAGS=-Dwarnings
. For crates that setlints.workspace = true
, lint configuration is ignored. I've even tried setting the priority as discussed in #12208 et. al. to no avail.If I simply set e.g.,
lints.clippy.useless_format = "allow"
in the specific crates'Cargo.toml
, no warnings-as-errors are emitted.Steps
Cargo.toml
with the content:Cargo.toml
with content:clippy::useless_format
warnings-as-errors are still emitted and the command fails.Possible Solution(s)
No response
Notes
No response
Version
No response
The text was updated successfully, but these errors were encountered: