aboutsummaryrefslogtreecommitdiff
path: root/tools/compiler_version
diff options
context:
space:
mode:
authorJack O'Connor <[email protected]>2020-05-13 18:45:39 -0400
committerJack O'Connor <[email protected]>2020-05-13 18:45:39 -0400
commit11edfb76f388dcc5a200815659020496744579b3 (patch)
treefa2bfbb87337422f5110905f9a2a99b201f547db /tools/compiler_version
parentc5c07bb337d0af7522666d05308aaf24eef3709c (diff)
print more compiler version info in CI
Diffstat (limited to 'tools/compiler_version')
-rw-r--r--tools/compiler_version/src/main.rs23
1 files changed, 19 insertions, 4 deletions
diff --git a/tools/compiler_version/src/main.rs b/tools/compiler_version/src/main.rs
index 4506cf7..767cb31 100644
--- a/tools/compiler_version/src/main.rs
+++ b/tools/compiler_version/src/main.rs
@@ -1,12 +1,27 @@
+use std::process::Command;
+
fn main() {
- // Set in build.rs.
- let compiler_path = env!("COMPILER_PATH");
+ // Print the rustc version.
+ Command::new(env!("CARGO"))
+ .args(&["rustc", "--quiet", "--", "--version"])
+ .status()
+ .unwrap();
+ println!();
- let mut compiler_command = std::process::Command::new(compiler_path);
+ // Print the Cargo version.
+ Command::new(env!("CARGO"))
+ .args(&["--version"])
+ .status()
+ .unwrap();
+ println!();
+
+ // Print the C compiler version. This relies on C compiler detection done
+ // in build.rs, which sets the COMPILER_PATH variable.
+ let compiler_path = env!("COMPILER_PATH");
+ let mut compiler_command = Command::new(compiler_path);
// Use the --version flag on everything other than MSVC.
if !cfg!(target_env = "msvc") {
compiler_command.arg("--version");
}
- // Run the compiler to print its version. Ignore the exit status.
let _ = compiler_command.status().unwrap();
}