From 11bb83d4225098b837d5aaa12b731a7a3da2100d Mon Sep 17 00:00:00 2001 From: Jonathan Schwender <55576758+jschwe@users.noreply.github.com> Date: Tue, 8 Jul 2025 14:12:03 +0800 Subject: [PATCH] mach: macos: Don't let gstreamer override symbols (#37903) Using DYLD_FALLBACK_LIBRARY_PATH means we first try to link to the normal libraries and only fallback to looking up symbols in gstreamer if the symbols were not found elsewhere. This prevents some linking issues. Testing: Covered by existing tests. Fix for issue #37811 manually verified by the reporter. Signed-off-by: Jonathan Schwender --- ports/servoshell/build.rs | 3 --- python/servo/command_base.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/ports/servoshell/build.rs b/ports/servoshell/build.rs index c014245ef46..6fb1f1eca7b 100644 --- a/ports/servoshell/build.rs +++ b/ports/servoshell/build.rs @@ -11,9 +11,6 @@ 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() { diff --git a/python/servo/command_base.py b/python/servo/command_base.py index fdc39d56c65..b844f1fbf70 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -466,7 +466,7 @@ class CommandBase(object): # GStreamer distribution (such as harfbuzz), but we only modify the rpath of the # target binary (servoshell / libsimpleservo). if platform.is_macos: - util.prepend_paths_to_env(env, "DYLD_LIBRARY_PATH", os.path.join(gstreamer_root, "lib")) + util.prepend_paths_to_env(env, "DYLD_FALLBACK_LIBRARY_PATH", os.path.join(gstreamer_root, "lib")) if sys.platform != "win32": env.setdefault("CC", "clang")