diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-14 18:15:21 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-14 18:15:21 +0100 |
commit | e7b8e6fbca483edbf723105c5b7ede94f1caebe8 (patch) | |
tree | e5466afadb494c691ebb9b28208b57409ecc4de6 /crates/project_model/src | |
parent | 6c0f20d79f8e5da57bd907aa1c3324fb92344b9a (diff) | |
parent | c4664609ed0f8b430285de99b4f7a8cc0ae655f5 (diff) |
Merge #8819
8819: Use package root as `cargo check` working directory r=matklad a=bcully
Cargo commands are affected by the `.cargo/config` files above
their working directory. If cargo is invoked from above the directory
holding `Cargo.toml`, it may not pick up important settings like
registry replacements, causing it to behave differently or even fail.
Most cargo invocations are currently setting their working directories
to the directory containing `Cargo.toml`, but a couple of paths remain
in which cargo is invoked from the default workspace root instead.
This change fixes that, resolving some cargo check failures that I
experienced in a multi-root workspace in which packages used different
registries.
Co-authored-by: Brendan Cully <[email protected]>
Diffstat (limited to 'crates/project_model/src')
-rw-r--r-- | crates/project_model/src/build_data.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/project_model/src/build_data.rs b/crates/project_model/src/build_data.rs index 7b88dca63..3aa546980 100644 --- a/crates/project_model/src/build_data.rs +++ b/crates/project_model/src/build_data.rs | |||
@@ -143,6 +143,7 @@ impl WorkspaceBuildData { | |||
143 | cmd.env("RA_RUSTC_WRAPPER", "1"); | 143 | cmd.env("RA_RUSTC_WRAPPER", "1"); |
144 | } | 144 | } |
145 | 145 | ||
146 | cmd.current_dir(cargo_toml.parent().unwrap()); | ||
146 | cmd.args(&["check", "--quiet", "--workspace", "--message-format=json", "--manifest-path"]) | 147 | cmd.args(&["check", "--quiet", "--workspace", "--message-format=json", "--manifest-path"]) |
147 | .arg(cargo_toml.as_ref()); | 148 | .arg(cargo_toml.as_ref()); |
148 | 149 | ||