From ab20a4d05ed6ce708bfbfb4eceb5e6f3c5c031cc Mon Sep 17 00:00:00 2001 From: aiongg Date: Fri, 27 Nov 2026 02:25:46 +0000 Subject: [PATCH] text build script reads the manifest dir at run time, so worktrees sharing a target dir find their own fonts --- crates/text/build.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/text/build.rs b/crates/text/build.rs index 3cc6867ace..f97382430a 100644 --- a/crates/text/build.rs +++ b/crates/text/build.rs @@ -44,7 +44,8 @@ fn main() { /// Deflate the bundled fonts into `OUT_DIR/fonts/` (`fonts::BUNDLED` includes them). fn deflate_bundled_fonts() { use std::io::Write as _; - let src = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../../assets/fonts"); + // Read at run time: a compiled build script is shared by worktrees with the same unit hash. + let src = PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap_or_default()).join("../../assets/fonts"); let out = PathBuf::from(std::env::var_os("OUT_DIR").unwrap_or_default()).join("fonts"); let result = (|| -> std::io::Result<()> { std::fs::create_dir_all(&out)?;