-
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
[REGRESSION] cargo metadata looks into $HOME/Cargo.toml #3718
Comments
The
|
I think cargo now walks up the directory tree looking for a parent workspace -- finding your ~/Cargo.toml. |
@cuviper that seems weird... especially if I would have multiple subdirectories with different projects... |
But you would probably not put those different projects with one in a subdirectory of another, would you? Anyway, I think that would probably still work fine if every Cargo.toml is well-formed. The issue as I see it here is that it found an invalid (empty) Cargo.toml and treated this as a fatal error. I think it would be reasonable to expect cargo to just ignore such errors. (assuming it had already found a more immediate file as the primary.) |
Yeah ignoring invalid Cargo.toml as we traverse upwards looking for a root sounds reasonable to me! |
We've just recently fixed cargo in the opposite direction: #3409 :) I think that the current behavior of not silently ignoring errors in And here the error is a very reasonable one:
But it is indeed can be surprising that now Cargo walks the directory tree up. |
@matklad I've created Cargo.toml in my $HOME just for testing purpose and even forgot about that and was very surprised, why cargo looks into it. |
@matklad oh right thanks for refreshing my memory! At least I can rest easy knowing that if such a change were implemented the tests would have caught it :) In that case though I'm going to close this as this is currently a deliberate decision. |
The problem is that I created empty
~/Cargo.toml
for something else and forgot to remove it which broke normal cargo operations (in my casecargo metadata
)...The text was updated successfully, but these errors were encountered: