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

x.py in rust-lang/rust does not like being called by rust-analyzer #9349

Closed
Tracked by #8915
jyn514 opened this issue Jun 21, 2021 · 5 comments
Closed
Tracked by #8915

x.py in rust-lang/rust does not like being called by rust-analyzer #9349

jyn514 opened this issue Jun 21, 2021 · 5 comments

Comments

@jyn514
Copy link
Member

jyn514 commented Jun 21, 2021

[ERROR rust_analyzer::reload] failed to switch build data: cargo check failed:
error: failed to run custom build command for `bootstrap v0.0.0 (C:\Users\Joshua Nelson\src\rust\src\bootstrap)`

Caused by:
  process didn't exit successfully: `c:\Users\Joshua Nelson\src\rust\target\debug\build\bootstrap-4864c5f723b632c4\build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-changed=build.rs
  cargo:rustc-env=BUILD_TRIPLE=x86_64-pc-windows-msvc

  --- stderr
  thread 'main' panicked at 'assertion failed: rustc.is_absolute()', src\bootstrap\build.rs:20:5
@jyn514
Copy link
Member Author

jyn514 commented Jun 21, 2021

It looks like rust-analyzer is calling it with the env variable RUSTC set to rustc. I don't know why it would do that, bootstrap is not built with any rustc on the host PATH.

@bjorn3
Copy link
Member

bjorn3 commented Jun 21, 2021

RUSTC_WRAPPER is set to point to rust-analyzer. This will cause cargo to call rust-analyzer rustc instead of $RUSTC and not rust-analyzer $RUSTC I think. Rust-analyzer simply uses the second argument as command to run. (rustc in this case) The RUSTC_WRAPPER is part of the code that allows building proc macros and running build scripts and getting their output (generated code, env vars, ...) without doing a full cargo check run. This was implemented in #8476.

@flodiebold
Copy link
Member

This can be disabled with rust-analyzer.cargo.useRustcWrapperForBuildScripts, but I don't think we should be running it at all if you've got proc macros and build scripts disabled 🤔

@flodiebold
Copy link
Member

@jyn514 do you have runBuildScripts and procMacros disabled like in the suggested settings? Note that the defaults for this changed somewhat recently.

@jyn514
Copy link
Member Author

jyn514 commented Jun 26, 2021

Thanks! That worked around the issue, and now I just have the cyclic deps error (#8330). I suspect this is a duplicate of #9201 like you said.

@jyn514 jyn514 closed this as completed Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants