From 8ffb0c28c24fbcaa57bc9d7427976ee632ff2194 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 6 Jul 2026 19:04:55 -0700 Subject: [PATCH] Set RUSTVERSION=1 during rustc --version command --- build/build.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/build.rs b/build/build.rs index 9a43a65..333e638 100644 --- a/build/build.rs +++ b/build/build.rs @@ -38,6 +38,11 @@ fn main() { } command.arg("--version"); + // Allow wrapper scripts or alternate compilers to tell that this is + // `rustversion` running --version, so that they can stick to rustc's + // version format. https://github.com/dtolnay/rustversion/issues/67 + command.env("RUSTVERSION", "1"); + let output = match command.output() { Ok(output) => output, Err(e) => {