From 2e4aa2b7ab0589191a250c2ce8127dc9070226fd Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Fri, 3 Jan 2025 18:27:54 +0100 Subject: [PATCH] bazel_6: use new apple sdk pattern --- .../tools/build-managers/bazel/bazel_6/default.nix | 8 ++------ pkgs/top-level/all-packages.nix | 6 ++---- 2 files changed, 4 insertions(+), 10 deletions(-) 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 b1069673f14a..7d339dec2c96 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, sigtool +, cctools, libcxx, sigtool # Allow to independently override the jdks used to build and run respectively , buildJdk, runJdk , runtimeShell @@ -415,10 +415,6 @@ stdenv.mkDerivation rec { # Explicitly configure gcov since we don't have it on Darwin, so autodetection fails export GCOV=${coreutils}/bin/false - # Framework search paths aren't added by bintools hook - # https://github.com/NixOS/nixpkgs/pull/41914 - export NIX_LDFLAGS+=" -F${CoreFoundation}/Library/Frameworks -F${CoreServices}/Library/Frameworks -F${Foundation}/Library/Frameworks" - # libcxx includes aren't added by libcxx hook # https://github.com/NixOS/nixpkgs/pull/41589 export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem ${lib.getDev libcxx}/include/c++/v1" @@ -583,7 +579,7 @@ stdenv.mkDerivation rec { which zip python3.pkgs.absl-py # Needed to build fish completion - ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ cctools libcxx sigtool CoreFoundation CoreServices Foundation ]; + ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ cctools libcxx sigtool ]; # 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 04f8516c21a5..52fa36ad692d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7732,13 +7732,11 @@ with pkgs; bazel_self = bazel_5; }; - bazel_6 = darwin.apple_sdk_11_0.callPackage ../development/tools/build-managers/bazel/bazel_6 { + bazel_6 = callPackage ../development/tools/build-managers/bazel/bazel_6 { inherit (darwin) sigtool; - inherit (darwin.apple_sdk_11_0.frameworks) CoreFoundation CoreServices Foundation; buildJdk = jdk11_headless; runJdk = jdk11_headless; - stdenv = if stdenv.hostPlatform.isDarwin then darwin.apple_sdk_11_0.stdenv - else if stdenv.cc.isClang then llvmPackages.stdenv + stdenv = if stdenv.cc.isClang then llvmPackages_17.stdenv else if stdenv.cc.isGNU then gcc12Stdenv else stdenv; bazel_self = bazel_6;