summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Maudoux <guillaume.maudoux@tweag.io>2023-12-14 09:00:36 +0100
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2024-01-02 08:19:48 +0000
commit27035382fee641e9255d2bd3fe27b357d584f3c0 (patch)
tree0bb5b261d0bc661831edc11b226860468fb6ca38
parentbazel_7: restore xcode_locator no-arc fix, still needed (diff)
downloadnixpkgs-27035382fee641e9255d2bd3fe27b357d584f3c0.tar.gz
bazel_7: re-enable arc in xcode_locator command
(cherry picked from commit 0d222a358002f6ab8c3c277eb46ed12ed33cfe40)
-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 3802eadc3e12..0cc2937c3640 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 5712c12f2bed..c954de9d9e2a 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>
-