Skip to content

Commit 6909556

Browse files
committed
Auto merge of rust-lang#13200 - P1n3appl3:sysroot, r=Veykril
Use proc-macro-srv from sysroot in rust-project.json workspaces This was discussed [on zulip](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/.60sysroot.60.20vs.20.60sysroot_src.60.20for.20.60rust-project.2Ejson.60.3F/near/293023920), basically in `rust-project.json` workspaces RA doesn't respect the `sysroot` setting when picking which `proc-macro-srv` to launch, and this causes abi mismatches in practice. This is the simple fix that `@Veykril` suggested, and I've verified that it works on Fuchsia by inspecting the cmdline with `pgrep rust-analyzer | xargs ps -fp` to check that it's using the `proc-macro-srv` from our prebuilts which matches the `sysroot` specified in our `rust-project.json`. Can this be merged as is, or do we need to add tests that exercise this?
2 parents 6dfd8ae + 5d126a1 commit 6909556

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/rust-analyzer/src/reload.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,9 @@ impl GlobalState {
314314
let mut args = args.clone();
315315
let mut path = path.clone();
316316

317-
if let ProjectWorkspace::Cargo { sysroot, .. } = ws {
317+
if let ProjectWorkspace::Cargo { sysroot, .. }
318+
| ProjectWorkspace::Json { sysroot, .. } = ws
319+
{
318320
tracing::debug!("Found a cargo workspace...");
319321
if let Some(sysroot) = sysroot.as_ref() {
320322
tracing::debug!("Found a cargo workspace with a sysroot...");

0 commit comments

Comments
 (0)