From 32d59cfff42b7e2f2a1c39699cacfb6efa10fdd9 Mon Sep 17 00:00:00 2001 From: Jonathan Schwender <55576758+jschwe@users.noreply.github.com> Date: Tue, 15 Apr 2025 16:55:37 +0200 Subject: [PATCH] Fix git failure on macos (#36544) Fixes the following warning: ``` warning: servoshell@0.0.1: Could not generate git version information: "dyld[59398]: Symbol not found: _libintl_setlocale\n Referenced from: /opt/homebrew/Cellar/git/2.48.1/bin/git\n Expected in: <0DA2D46D-7A17-3860-809D-71FD05B785FA> /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libintl.8.dylib\n" ``` This was discussed in https://github.com/servo/servo/issues/36435#issuecomment-2794224073. mach sets DYLD_LIBRARY_PATH, which is currently necessary for our unit tests, but causes git to fail in the build script. Simply unsetting the environment variable before invoking git works around this problem. Testing: Tested manually on macos and verified the warning does not occur anymore. Signed-off-by: Jonathan Schwender --- ports/servoshell/build.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/servoshell/build.rs b/ports/servoshell/build.rs index 6fb1f1eca7b..c014245ef46 100644 --- a/ports/servoshell/build.rs +++ b/ports/servoshell/build.rs @@ -11,6 +11,9 @@ use std::process::Command; fn git_sha() -> Result { let output = Command::new("git") .args(["rev-parse", "--short", "HEAD"]) + // on macos mach sets DYLD_LIBRARY_PATH since it is needed for unit-tests, but it + // causes git to fail, so we remove it for the git invocation. + .env_remove("DYLD_LIBRARY_PATH") .output() .map_err(|e| e.to_string())?; if output.status.success() {