diff options
author | Jonathan Schwender <55576758+jschwe@users.noreply.github.com> | 2025-04-15 16:55:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-15 14:55:37 +0000 |
commit | 32d59cfff42b7e2f2a1c39699cacfb6efa10fdd9 (patch) | |
tree | 201ced7ef886e0d05209bf50e64c12f6cd98020d | |
parent | 6b38289584c659b25bd9f79817188927496f23ee (diff) | |
download | servo-32d59cfff42b7e2f2a1c39699cacfb6efa10fdd9.tar.gz servo-32d59cfff42b7e2f2a1c39699cacfb6efa10fdd9.zip |
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: <CB4FE7B2-A5DC-34F0-8247-A96F45D664E8> /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 <schwenderjonathan@gmail.com>
-rw-r--r-- | ports/servoshell/build.rs | 3 |
1 files changed, 3 insertions, 0 deletions
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<String, String> { 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() { |