-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Cargo looks for manifest in parent dirs even if one exists, even with --manifest-path #10872
Comments
The thing that trips me up about this documentation
(which is on every instance of This supposedly documents the default behavior ("By default, ..."), but isn't true, as it definitely also looks at/for |
Cargo needs to search for other |
I guess I see the point here, you have two mutually exclusive(?) options for when Cargo recurses upwards and finds an invalid manifest:
1 would be surprising if it was actually a workspace child. 2 is surprising when it's not. Since it is far, far more likely to be a workspace project than my niche thing (actually a workaround for #1982) then I see why you'd have it that way, even with the Nonetheless, there seems to be no way to explicitly inform Cargo that you actually know this is a top-level ie. not-a-workspace project. This is close to what is being asked for in #7871, but that seems to be asking for a CLI flag, which cannot be committed to version control in the manifest itself. |
You could always workaround this by putting
In your |
@epage - you mean, literally the empty section |
Yes, putting |
FYI I used this suggestion and it's worked perfectly for weeks. I'll close this because I don't actually think anything should be changed here, I just needed a way to achieve a niche goal, which I got. |
Problem
I have a project with nested, non-workspace cargo projects. It's a niche but real use case.
I found that if the parent project has a broken manifest, the child project cannot be built, even if its manifest is completely valid. Here's an example project, the child is in
testbins/does-build
.Note that the error is in the parent project. The child project is fine. It's the same if I use
--manifest-path ./Cargo.toml
.Steps
testbins/does-build
.cargo build --manifest-path ./Cargo.toml
.Possible Solution(s)
It all works, and crucially, builds the child project but not the parent, if the parent manifest is fixed.
Notes
Seems related: #7871
The docs say:
I would expect that by default it stops when it finds one, but that's not explicitly stated. However, the behaviour with
--manifest-path
seems very unexpected.Version
The text was updated successfully, but these errors were encountered: