From b8218f0d2bcca50dc0128393015207aa649587c0 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 24 Jan 2025 16:40:47 +0100 Subject: [PATCH] Add log to mention what GCC path the build script is using and where it comes from --- build_system/src/config.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/build_system/src/config.rs b/build_system/src/config.rs index e8eeb559c79d..843f87c8be6b 100644 --- a/build_system/src/config.rs +++ b/build_system/src/config.rs @@ -284,7 +284,11 @@ impl ConfigInfo { pub fn setup_gcc_path(&mut self) -> Result<(), String> { // If the user used the `--gcc-path` option, no need to look at `config.toml` content // since we already have everything we need. - if self.gcc_path.is_some() { + if let Some(gcc_path) = &self.gcc_path { + println!( + "`--gcc-path` was provided, ignoring config file. Using `{}` as path for libgccjit", + gcc_path + ); return Ok(()); } let config_file = match self.config_file.as_deref() { @@ -297,10 +301,15 @@ impl ConfigInfo { self.download_gccjit_if_needed()?; return Ok(()); } - if gcc_path.is_none() { + let Some(gcc_path) = gcc_path else { return Err(format!("missing `gcc-path` value from `{}`", config_file.display())); - } - self.gcc_path = gcc_path; + }; + println!( + "GCC path retrieved from `{}`. Using `{}` as path for libgccjit", + config_file.display(), + gcc_path + ); + self.gcc_path = Some(gcc_path); Ok(()) }