about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorGuillaume Maudoux <guillaume.maudoux@tweag.io>2023-12-14 09:00:36 +0100
committerGuillaume Maudoux <guillaume.maudoux@tweag.io>2023-12-14 09:00:36 +0100
commit0d222a358002f6ab8c3c277eb46ed12ed33cfe40 (patch)
treea8659baca5e4a84a7a6457420b1ba4c6661e7079 /pkgs/development
parent6d93cdd566ac2d809458bae328ed5b08dd7ba91b (diff)
bazel_7: re-enable arc in xcode_locator command
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/tools/build-managers/bazel/bazel_7/default.nix10
-rw-r--r--pkgs/development/tools/build-managers/bazel/bazel_7/xcode_locator.patch36
2 files changed, 6 insertions, 40 deletions
diff --git a/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix
index 3802eadc3e129..0cc2937c36400 100644
--- a/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix
+++ b/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix
@@ -213,13 +213,9 @@ stdenv.mkDerivation rec {
     # I do not know yet how to allow IOPMAssertion{CreateWithName,Release}
     ./darwin_sleep.patch
 
-    # Make DARWIN_XCODE_LOCATOR_COMPILE_COMMAND behave properly by diabling
-    # multi-arch support and using proper /usr/bin paths that will get fixed
-    # below.
-    # Also, xcode_locator requires arc support, but it seems pretty difficult
-    # to provide, so we disable it altogether for xcode_locator. Caveat: this
-    # leaks memory, but we accept this fact because xcode_locator is only a
-    # short-lived process used during the build.
+    # Fix DARWIN_XCODE_LOCATOR_COMPILE_COMMAND by removing multi-arch support.
+    # Nixpkgs toolcahins do not support that (yet?) and get confused.
+    # Also add an explicit /usr/bin prefix that will be patched below.
     ./xcode_locator.patch
 
     # On Darwin, the last argument to gcc is coming up as an empty string. i.e: ''
diff --git a/pkgs/development/tools/build-managers/bazel/bazel_7/xcode_locator.patch b/pkgs/development/tools/build-managers/bazel/bazel_7/xcode_locator.patch
index 5712c12f2bed4..c954de9d9e2ab 100644
--- a/pkgs/development/tools/build-managers/bazel/bazel_7/xcode_locator.patch
+++ b/pkgs/development/tools/build-managers/bazel/bazel_7/xcode_locator.patch
@@ -1,43 +1,13 @@
-diff --git a/tools/osx/BUILD b/tools/osx/BUILD
-index 0358fb0ffe..baae1bf65b 100644
 --- a/tools/osx/BUILD
 +++ b/tools/osx/BUILD
-@@ -27,9 +27,8 @@ exports_files([
- ])
+@@ -28,8 +28,8 @@ exports_files([
  
  DARWIN_XCODE_LOCATOR_COMPILE_COMMAND = """
--  /usr/bin/xcrun --sdk macosx clang -mmacosx-version-min=10.13 -fobjc-arc -framework CoreServices \
+   /usr/bin/xcrun --sdk macosx clang -mmacosx-version-min=10.13 -fobjc-arc -framework CoreServices \
 -      -framework Foundation -arch arm64 -arch x86_64 -Wl,-no_adhoc_codesign -Wl,-no_uuid -o $@ $< && \
++      -framework Foundation                          -Wl,-no_adhoc_codesign -Wl,-no_uuid -o $@ $< && \
 -  env -i codesign --identifier $@ --force --sign - $@
-+  /usr/bin/xcrun --sdk macosx clang -framework CoreServices -framework Foundation -Wl,-no_uuid -o $@ $< && \
 +  /usr/bin/env -i /usr/bin/codesign --identifier $@ --force --sign - $@
  """
  
  genrule(
-diff --git a/tools/osx/xcode_configure.bzl b/tools/osx/xcode_configure.bzl
-index a4a712a341..dfbf4869a9 100644
---- a/tools/osx/xcode_configure.bzl
-+++ b/tools/osx/xcode_configure.bzl
-@@ -135,7 +135,6 @@ def run_xcode_locator(repository_ctx, xcode_locator_src_label):
-         "macosx",
-         "clang",
-         "-mmacosx-version-min=10.13",
--        "-fobjc-arc",
-         "-framework",
-         "CoreServices",
-         "-framework",
-diff --git a/tools/osx/xcode_locator.m b/tools/osx/xcode_locator.m
-index c602b0bb4b..1f7eb64810 100644
---- a/tools/osx/xcode_locator.m
-+++ b/tools/osx/xcode_locator.m
-@@ -21,10 +21,6 @@
- // 6,6.4,6.4.1 = 6.4.1
- // 6.3,6.3.0 = 6.3
- 
--#if !defined(__has_feature) || !__has_feature(objc_arc)
--#error "This file requires ARC support."
--#endif
--
- #import <CoreServices/CoreServices.h>
- #import <Foundation/Foundation.h>
-