diff --git a/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix index f73316b1582f..885182847f95 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix +++ b/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix @@ -8,7 +8,7 @@ # updater , python3, writeScript # Apple dependencies -, cctools, libcxx, CoreFoundation, CoreServices, Foundation +, cctools, libcxx, CoreFoundation, CoreServices, Foundation, sigtool # Allow to independently override the jdks used to build and run respectively , buildJdk, runJdk , runtimeShell @@ -424,7 +424,10 @@ stdenv.mkDerivation rec { export NIX_CFLAGS_COMPILE+=" -Wno-deprecated-builtins -Wno-gnu-offsetof-extensions" # don't use system installed Xcode to run clang, use Nix clang instead - sed -i -E "s;/usr/bin/xcrun (--sdk macosx )?clang;${stdenv.cc}/bin/clang $NIX_CFLAGS_COMPILE $(bazelLinkFlags) -framework CoreFoundation;g" \ + sed -i -E \ + -e "s;/usr/bin/xcrun (--sdk macosx )?clang;${stdenv.cc}/bin/clang $NIX_CFLAGS_COMPILE $(bazelLinkFlags) -framework CoreFoundation;g" \ + -e "s;/usr/bin/codesign;CODESIGN_ALLOCATE=${cctools}/bin/${cctools.targetPrefix}codesign_allocate ${sigtool}/bin/codesign;" \ + -e "s;env -i codesign;env -i CODESIGN_ALLOCATE=${cctools}/bin/${cctools.targetPrefix}codesign_allocate ${sigtool}/bin/codesign;" \ scripts/bootstrap/compile.sh \ tools/osx/BUILD @@ -578,7 +581,7 @@ stdenv.mkDerivation rec { which zip python3.pkgs.absl-py # Needed to build fish completion - ] ++ lib.optionals (stdenv.isDarwin) [ cctools libcxx CoreFoundation CoreServices Foundation ]; + ] ++ lib.optionals (stdenv.isDarwin) [ cctools libcxx sigtool CoreFoundation CoreServices Foundation ]; # Bazel makes extensive use of symlinks in the WORKSPACE. # This causes problems with infinite symlinks if the build output is in the same location as the diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e82227fd83fd..55b079713909 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18265,7 +18265,7 @@ with pkgs; }; bazel_6 = darwin.apple_sdk_11_0.callPackage ../development/tools/build-managers/bazel/bazel_6 { - inherit (darwin) cctools; + inherit (darwin) cctools sigtool; inherit (darwin.apple_sdk_11_0.frameworks) CoreFoundation CoreServices Foundation; buildJdk = jdk11_headless; runJdk = jdk11_headless;