summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Maudoux <guillaume.maudoux@tweag.io>2023-12-13 22:55:00 +0100
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2024-01-02 08:19:48 +0000
commit189fb6ecba17e4acbf6227e67506430818cb02e0 (patch)
tree3e54035de26077258bada4d3b1b661c821084d50
parentbazel_7: address most review comments (diff)
downloadnixpkgs-189fb6ecba17e4acbf6227e67506430818cb02e0.tar.gz
bazel_7: restore xcode_locator patch from no-arc patch
(cherry picked from commit 5fc2602a32e7de399443f8128451880a01af9e88)
-rw-r--r--pkgs/development/tools/build-managers/bazel/bazel_7/default.nix5
-rw-r--r--pkgs/development/tools/build-managers/bazel/bazel_7/no-arc.patch43
-rw-r--r--pkgs/development/tools/build-managers/bazel/bazel_7/xcode_locator.patch16
3 files changed, 21 insertions, 43 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 74102ea8d494..f3382365f2d9 100644
--- a/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix
+++ b/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix
@@ -213,6 +213,11 @@ 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 (I could not get it to work) and using proper /usr/bin
+ # paths that will get fixed below.
+ ./xcode_locator.patch
+
# On Darwin, the last argument to gcc is coming up as an empty string. i.e: ''
# This is breaking the build of any C target. This patch removes the last
# argument if it's found to be an empty string.
diff --git a/pkgs/development/tools/build-managers/bazel/bazel_7/no-arc.patch b/pkgs/development/tools/build-managers/bazel/bazel_7/no-arc.patch
deleted file mode 100644
index 5712c12f2bed..000000000000
--- a/pkgs/development/tools/build-managers/bazel/bazel_7/no-arc.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-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([
- ])
-
- DARWIN_XCODE_LOCATOR_COMPILE_COMMAND = """
-- /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 $@ $< && \
-- 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>
-
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
new file mode 100644
index 000000000000..366cf474a911
--- /dev/null
+++ b/pkgs/development/tools/build-managers/bazel/bazel_7/xcode_locator.patch
@@ -0,0 +1,16 @@
+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([
+ ])
+
+ DARWIN_XCODE_LOCATOR_COMPILE_COMMAND = """
+- /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 $@ $< && \
+- 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(