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

cargo check in the workspace discards crate-specific configurations; such as --target #7600

Closed
WildCryptoFox opened this issue Nov 18, 2019 · 1 comment
Labels
C-bug Category: bug

Comments

@WildCryptoFox
Copy link

WildCryptoFox commented Nov 18, 2019

Problem

Running cargo check --all in the root of a workspace discards the per-crate cargo configuration. In my case this results in the [build] target = "xxx" being ignored.

Steps

  1. Setup a workspace containing a crate with its own .cargo/config
  2. Run cargo check inside that crate's dir. It successfully uses the config.
  3. Run cargo check --all from the root of the workspace. It fails to use the config.

Possible Solution(s)

Always use the crate's cargo configuration if it exists.

Notes

Output of cargo version:

I think this is a digression but I haven't verified any older versions worked.

cargo 1.40.0-nightly (5da4b4d47 2019-10-28)
@WildCryptoFox WildCryptoFox added the C-bug Category: bug label Nov 18, 2019
@ehuss
Copy link
Contributor

ehuss commented Nov 19, 2019

Thanks for the report! This is a duplicate of #2930, so closing in favor of that. Cargo currently only looks at the current directory and up. It indeed can be surprising, but it is a bit difficult to nail down different rules, and can be tricky with backwards compatibility.

@ehuss ehuss closed this as completed Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants