bazel_5: fix sandbox

+15 -4
+11
pkgs/development/tools/build-managers/bazel/bazel_5/bazel_darwin_sandbox.patch
···
··· 1 + diff -ru a/src/main/native/unix_jni_darwin.cc b/src/main/native/unix_jni_darwin.cc 2 + --- a/src/main/native/unix_jni_darwin.cc 1980-01-01 00:00:00.000000000 -0500 3 + +++ b/src/main/native/unix_jni_darwin.cc 2021-11-27 20:35:29.000000000 -0500 4 + @@ -270,6 +270,7 @@ 5 + } 6 + 7 + void portable_start_suspend_monitoring() { 8 + + if (getenv("NIX_BUILD_TOP")) return; 9 + static dispatch_once_t once_token; 10 + static SuspendState suspend_state; 11 + dispatch_once(&once_token, ^{
+3 -3
pkgs/development/tools/build-managers/bazel/bazel_5/default.nix
··· 9 # updater 10 , python27, python3, writeScript 11 # Apple dependencies 12 - , cctools, libcxx, CoreFoundation, CoreServices, Foundation 13 # Allow to independently override the jdks used to build and run respectively 14 , buildJdk, runJdk 15 , runtimeShell ··· 211 212 # disable suspend detection during a build inside Nix as this is 213 # not available inside the darwin sandbox 214 - ../bazel_darwin_sandbox.patch 215 ] ++ lib.optional enableNixHacks ../nix-hacks.patch; 216 217 ··· 382 # clang installed from Xcode has a compatibility wrapper that forwards 383 # invocations of gcc to clang, but vanilla clang doesn't 384 sed -i -e 's;_find_generic(repository_ctx, "gcc", "CC", overriden_tools);_find_generic(repository_ctx, "clang", "CC", overriden_tools);g' tools/cpp/unix_cc_configure.bzl 385 - 386 sed -i -e 's;"/usr/bin/libtool";_find_generic(repository_ctx, "libtool", "LIBTOOL", overriden_tools);g' tools/cpp/unix_cc_configure.bzl 387 wrappers=( tools/cpp/osx_cc_wrapper.sh tools/cpp/osx_cc_wrapper.sh.tpl ) 388 for wrapper in "''${wrappers[@]}"; do
··· 9 # updater 10 , python27, python3, writeScript 11 # Apple dependencies 12 + , cctools, libcxx, sigtool, CoreFoundation, CoreServices, Foundation 13 # Allow to independently override the jdks used to build and run respectively 14 , buildJdk, runJdk 15 , runtimeShell ··· 211 212 # disable suspend detection during a build inside Nix as this is 213 # not available inside the darwin sandbox 214 + ./bazel_darwin_sandbox.patch 215 ] ++ lib.optional enableNixHacks ../nix-hacks.patch; 216 217 ··· 382 # clang installed from Xcode has a compatibility wrapper that forwards 383 # invocations of gcc to clang, but vanilla clang doesn't 384 sed -i -e 's;_find_generic(repository_ctx, "gcc", "CC", overriden_tools);_find_generic(repository_ctx, "clang", "CC", overriden_tools);g' tools/cpp/unix_cc_configure.bzl 385 + sed -i -e 's;env -i codesign --identifier $@ --force --sign;env -i CODESIGN_ALLOCATE=${cctools}/bin/${cctools.targetPrefix}codesign_allocate ${sigtool}/bin/codesign --identifier $@ --force -s;g' tools/osx/BUILD 386 sed -i -e 's;"/usr/bin/libtool";_find_generic(repository_ctx, "libtool", "LIBTOOL", overriden_tools);g' tools/cpp/unix_cc_configure.bzl 387 wrappers=( tools/cpp/osx_cc_wrapper.sh tools/cpp/osx_cc_wrapper.sh.tpl ) 388 for wrapper in "''${wrappers[@]}"; do
+1 -1
pkgs/top-level/all-packages.nix
··· 15746 }; 15747 15748 bazel_5 = callPackage ../development/tools/build-managers/bazel/bazel_5 { 15749 - inherit (darwin) cctools; 15750 inherit (darwin.apple_sdk.frameworks) CoreFoundation CoreServices Foundation; 15751 buildJdk = jdk11_headless; 15752 runJdk = jdk11_headless;
··· 15746 }; 15747 15748 bazel_5 = callPackage ../development/tools/build-managers/bazel/bazel_5 { 15749 + inherit (darwin) cctools sigtool; 15750 inherit (darwin.apple_sdk.frameworks) CoreFoundation CoreServices Foundation; 15751 buildJdk = jdk11_headless; 15752 runJdk = jdk11_headless;