From 98f82554c81a9d65cffd0086f99d358068ae2458 Mon Sep 17 00:00:00 2001 From: Niklas Korz Date: Wed, 4 Feb 2026 15:33:44 +0100 Subject: [PATCH] llvmPackages_22.llvm: skip empty environment test on darwin --- .../compilers/llvm/common/llvm/default.nix | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/llvm/common/llvm/default.nix b/pkgs/development/compilers/llvm/common/llvm/default.nix index a396c739ca37..180256918c12 100644 --- a/pkgs/development/compilers/llvm/common/llvm/default.nix +++ b/pkgs/development/compilers/llvm/common/llvm/default.nix @@ -419,10 +419,23 @@ stdenv.mkDerivation ( check_version patch ${patch} ''; - # E.g. Mesa uses the build-id as a cache key (see #93946): - env = lib.optionalAttrs (enableSharedLibraries && !stdenv.hostPlatform.isDarwin) { - LDFLAGS = "-Wl,--build-id=sha1"; - }; + env = + # E.g. Mesa uses the build-id as a cache key (see #93946): + lib.optionalAttrs (enableSharedLibraries && !stdenv.hostPlatform.isDarwin) { + LDFLAGS = "-Wl,--build-id=sha1"; + } + // lib.optionalAttrs stdenv.hostPlatform.isDarwin { + # This test was introduced by https://github.com/llvm/llvm-project/pull/158719 to check + # for a Windows-specific quirk. + # It is also unconditionally run on other platforms because running binaries + # without any environment variables should work, but as the test binaries link against + # our libLLVM.dylib that has not been installed at this point, and the `DYLD_LIBRARY_PATH` + # we set for tests to work around this issue is cleared away by the test itself, + # it will fail. + # Unfortunately "fixing" the test to pass just `DYLD_LIBRARY_PATH` would void the purpose + # of the test itself, so we skip it instead. + GTEST_FILTER = "-ProgramEnvTest.TestExecuteEmptyEnvironment"; + }; cmakeBuildType = "Release";