From f61b0e1a0478743c9bcfebf019bbccd2c7f04d90 Mon Sep 17 00:00:00 2001 From: Kyle Lacy Date: Sat, 4 Jan 2025 17:38:26 -0800 Subject: [PATCH] Update `brioche-cc` to get sysroot from a symlink --- crates/brioche-cc/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/brioche-cc/src/main.rs b/crates/brioche-cc/src/main.rs index 3497de2..ad97a08 100644 --- a/crates/brioche-cc/src/main.rs +++ b/crates/brioche-cc/src/main.rs @@ -34,6 +34,10 @@ fn run() -> eyre::Result<()> { } let cc = cc_resource_dir.join(current_exe_name); + let sysroot_path = cc_resource_dir + .join("sysroot") + .canonicalize() + .context("failed to get sysroot path from 'libexec/brioche-cc/sysroot'")?; let mut args = std::env::args_os(); let arg0 = args.next(); @@ -50,7 +54,7 @@ fn run() -> eyre::Result<()> { }); if !has_sysroot_arg { - command.arg("--sysroot").arg(current_exe_parent_dir); + command.arg("--sysroot").arg(sysroot_path); } command.args(&args);