From 76c9f4f2afd5326d321b06268444448a218ac212 Mon Sep 17 00:00:00 2001 From: prxnvt <53838599+prxnvt@users.noreply.github.com> Date: Sat, 10 Oct 2026 01:09:43 -0400 Subject: [PATCH] Build: the ui-egui build script reads CARGO_MANIFEST_DIR when it runs env! fixes the path to contributors/ when the build script is compiled. After a checkout is moved or copied, the compiled script keeps looking in the old location: the About window loses its contributor list, and because the rerun-if-changed path no longer exists, Cargo reruns the script and rebuilds the UI crate on every build. Reading the variable at run time follows the checkout. --- crates/ui-egui/build.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/build.rs b/crates/ui-egui/build.rs index f40007fb2..8a06c5932 100644 --- a/crates/ui-egui/build.rs +++ b/crates/ui-egui/build.rs @@ -13,7 +13,10 @@ use std::fmt::Write as _; use serde_json::Value; fn main() { - let dir = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../../contributors"); + // Read when the script runs: `env!` would keep the path from when the script was compiled, + // which goes stale if the checkout moves (and a missing file reruns the script every build). + let manifest = std::env::var_os("CARGO_MANIFEST_DIR").map(std::path::PathBuf::from).unwrap_or_default(); + let dir = manifest.join("../../contributors"); let json = read(&dir.join("contributors.json"), "the About window shows no contributors", |t| { serde_json::from_str::(t).map_err(|e| e.to_string()) })