-
Notifications
You must be signed in to change notification settings - Fork 95
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
out-of-tree "cargo check" fails #108
Comments
I now think that something else is going on. I will report back. |
In addition to the problem that the cargo_metadata selftests do not pass an appropriate manifest path, there is an infelicity in cargo itself. It changes to the directory containing this crate's manifest before running the tests. My source code is in a different account with its own cargo configuration. The copy of cargo run by the tests picks up that other account's cargo configuration, which is not appropriate or desirable. cargo does not seem to provide the original invocation directory at all. I think the best workaround is to spot if --manifest-path is passed, and if so chdir to /. (!) That works for me in my ad-hoc tests. I will prepare an MR. I will also investigate requesting a cargo env var for the original invocation directory. |
I filed this issue against cargo: |
2 years to late here we are regardless. Is there something |
Hi. I like to do builds out of tree, with the actual source code not writeable by the build process. This is achieved with cargo --manifest-path=..../Cargo.toml --target-dir=target.
NB revised description follows
Unfortunately, if a parent of the source directory contains a cargo config, the cargo run by the cargo_metadata tests picks that up, rather than the one from the build directory. This is because cargo changes directory to the source directory before running the tests. rust-lang/cargo#8148
If I make a linkfarm it does work, but this is of course not particularly desirable.
See transcript below.
Regards,
Ian.
The text was updated successfully, but these errors were encountered: