diff options
| author | bors <bors@rust-lang.org> | 2024-07-16 10:54:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-07-16 10:54:30 +0000 |
| commit | a91f7d72f12efcc00ecf71591f066c534d45ddf7 (patch) | |
| tree | fbd2020f7abccd2d6ee5d22d2f281262fa995389 /src/tools/rust-analyzer/crates/proc-macro-srv/build.rs | |
| parent | 5572759b8d7012fa34eba47f4885c76fa06d9251 (diff) | |
| parent | 3e73272ac7bf16dce952cdc57f94600726c0cc86 (diff) | |
| download | rust-a91f7d72f12efcc00ecf71591f066c534d45ddf7.tar.gz rust-a91f7d72f12efcc00ecf71591f066c534d45ddf7.zip | |
Auto merge of #127617 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer` r? `@ghost`
Diffstat (limited to 'src/tools/rust-analyzer/crates/proc-macro-srv/build.rs')
| -rw-r--r-- | src/tools/rust-analyzer/crates/proc-macro-srv/build.rs | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/tools/rust-analyzer/crates/proc-macro-srv/build.rs b/src/tools/rust-analyzer/crates/proc-macro-srv/build.rs index 874d1c6cd38..9a17cfc9f36 100644 --- a/src/tools/rust-analyzer/crates/proc-macro-srv/build.rs +++ b/src/tools/rust-analyzer/crates/proc-macro-srv/build.rs @@ -1,27 +1,15 @@ //! Determine rustc version `proc-macro-srv` (and thus the sysroot ABI) is //! build with and make it accessible at runtime for ABI selection. -use std::{env, fs::File, io::Write, path::PathBuf, process::Command}; +use std::{env, process::Command}; fn main() { - println!("cargo:rustc-check-cfg=cfg(rust_analyzer)"); - - let mut path = PathBuf::from(env::var_os("OUT_DIR").unwrap()); - path.push("rustc_version.rs"); - let mut f = File::create(&path).unwrap(); + println!("cargo::rustc-check-cfg=cfg(rust_analyzer)"); let rustc = env::var("RUSTC").expect("proc-macro-srv's build script expects RUSTC to be set"); let output = Command::new(rustc).arg("--version").output().expect("rustc --version must run"); let version_string = std::str::from_utf8(&output.stdout[..]) .expect("rustc --version output must be UTF-8") .trim(); - - write!( - f, - " - #[allow(dead_code)] - pub(crate) const RUSTC_VERSION_STRING: &str = {version_string:?}; - " - ) - .unwrap(); + println!("cargo::rustc-env=RUSTC_VERSION={}", version_string); } |
