mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Auto merge of #11956 - fee1-dead:master, r=flodiebold
feat: allow customizing the command for running build scripts I have tested this locally and it fixed #9201 with some small changes on the compiler side with suggestions from https://github.com/rust-analyzer/rust-analyzer/issues/9201#issuecomment-1019554086. I have also added an environment variable `IS_RA_BUILDSCRIPT_CHECK` for crates to detect that it is a check for buildscripts, and allows defaulting to bogus values for expected environment variables.
This commit is contained in:
commit
15844bf48c
5 changed files with 53 additions and 15 deletions
|
@ -78,6 +78,10 @@ config_data! {
|
|||
/// Run build scripts (`build.rs`) for more precise code analysis.
|
||||
cargo_runBuildScripts |
|
||||
cargo_loadOutDirsFromCheck: bool = "true",
|
||||
/// Advanced option, fully override the command rust-analyzer uses to
|
||||
/// run build scripts and build procedural macros. The command should
|
||||
/// include `--message-format=json` or a similar option.
|
||||
cargo_runBuildScriptsCommand: Option<Vec<String>> = "null",
|
||||
/// Use `RUSTC_WRAPPER=rust-analyzer` when running build scripts to
|
||||
/// avoid compiling unnecessary things.
|
||||
cargo_useRustcWrapperForBuildScripts: bool = "true",
|
||||
|
@ -834,6 +838,7 @@ impl Config {
|
|||
rustc_source,
|
||||
unset_test_crates: UnsetTestCrates::Only(self.data.cargo_unsetTest.clone()),
|
||||
wrap_rustc_in_build_scripts: self.data.cargo_useRustcWrapperForBuildScripts,
|
||||
run_build_script_command: self.data.cargo_runBuildScriptsCommand.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue