bazel_7: darwin (sandbox) fixes

+7 -6
+6 -6
pkgs/development/tools/build-managers/bazel/bazel_7/tests.nix
··· 75 75 } 76 76 '' 77 77 # Bazel needs a real home for self-extraction and internal cache 78 - export HOME=$(mktemp -d) 78 + mkdir bazel_home 79 + export HOME=$PWD/bazel_home 79 80 80 81 ${# Concurrent bazel invocations have the same workspace path. 81 - # On darwin, for some reason, it means they access and corrupt the same execroot. 82 - # Having a different workspace path ensures we use different execroots. 83 - # A different user seems to be enough for a different bazel cache root. 82 + # On darwin, for some reason, it means they access and corrupt the 83 + # same outputRoot, outputUserRoot and outputBase 84 + # Ensure they use build-local outputRoot by setting TEST_TMPDIR 84 85 lib.optionalString isDarwin '' 85 - export USER=$(basename $HOME) 86 - # cd $(mktemp --tmpdir=. -d) 86 + export TEST_TMPDIR=$HOME/.cache/bazel 87 87 '' 88 88 } 89 89 ${# Speed-up tests by caching bazel extraction.
+1
pkgs/development/tools/build-managers/bazel/cpp-test.nix
··· 53 53 '' + lib.optionalString (stdenv.isDarwin) '' 54 54 --cxxopt=-x --cxxopt=c++ --host_cxxopt=-x --host_cxxopt=c++ \ 55 55 --linkopt=-stdlib=libc++ --host_linkopt=-stdlib=libc++ \ 56 + '' + lib.optionalString (stdenv.isDarwin && Foundation != null) '' 56 57 --linkopt=-Wl,-F${Foundation}/Library/Frameworks \ 57 58 --linkopt=-L${darwin.libobjc}/lib \ 58 59 '';