bazel_7: re-enable arc in xcode_locator command

+6 -40
+3 -7
pkgs/development/tools/build-managers/bazel/bazel_7/default.nix
··· 213 213 # I do not know yet how to allow IOPMAssertion{CreateWithName,Release} 214 214 ./darwin_sleep.patch 215 215 216 - # Make DARWIN_XCODE_LOCATOR_COMPILE_COMMAND behave properly by diabling 217 - # multi-arch support and using proper /usr/bin paths that will get fixed 218 - # below. 219 - # Also, xcode_locator requires arc support, but it seems pretty difficult 220 - # to provide, so we disable it altogether for xcode_locator. Caveat: this 221 - # leaks memory, but we accept this fact because xcode_locator is only a 222 - # short-lived process used during the build. 216 + # Fix DARWIN_XCODE_LOCATOR_COMPILE_COMMAND by removing multi-arch support. 217 + # Nixpkgs toolcahins do not support that (yet?) and get confused. 218 + # Also add an explicit /usr/bin prefix that will be patched below. 223 219 ./xcode_locator.patch 224 220 225 221 # On Darwin, the last argument to gcc is coming up as an empty string. i.e: ''
+3 -33
pkgs/development/tools/build-managers/bazel/bazel_7/xcode_locator.patch
··· 1 - diff --git a/tools/osx/BUILD b/tools/osx/BUILD 2 - index 0358fb0ffe..baae1bf65b 100644 3 1 --- a/tools/osx/BUILD 4 2 +++ b/tools/osx/BUILD 5 - @@ -27,9 +27,8 @@ exports_files([ 6 - ]) 3 + @@ -28,8 +28,8 @@ exports_files([ 7 4 8 5 DARWIN_XCODE_LOCATOR_COMPILE_COMMAND = """ 9 - - /usr/bin/xcrun --sdk macosx clang -mmacosx-version-min=10.13 -fobjc-arc -framework CoreServices \ 6 + /usr/bin/xcrun --sdk macosx clang -mmacosx-version-min=10.13 -fobjc-arc -framework CoreServices \ 10 7 - -framework Foundation -arch arm64 -arch x86_64 -Wl,-no_adhoc_codesign -Wl,-no_uuid -o $@ $< && \ 8 + + -framework Foundation -Wl,-no_adhoc_codesign -Wl,-no_uuid -o $@ $< && \ 11 9 - env -i codesign --identifier $@ --force --sign - $@ 12 - + /usr/bin/xcrun --sdk macosx clang -framework CoreServices -framework Foundation -Wl,-no_uuid -o $@ $< && \ 13 10 + /usr/bin/env -i /usr/bin/codesign --identifier $@ --force --sign - $@ 14 11 """ 15 12 16 13 genrule( 17 - diff --git a/tools/osx/xcode_configure.bzl b/tools/osx/xcode_configure.bzl 18 - index a4a712a341..dfbf4869a9 100644 19 - --- a/tools/osx/xcode_configure.bzl 20 - +++ b/tools/osx/xcode_configure.bzl 21 - @@ -135,7 +135,6 @@ def run_xcode_locator(repository_ctx, xcode_locator_src_label): 22 - "macosx", 23 - "clang", 24 - "-mmacosx-version-min=10.13", 25 - - "-fobjc-arc", 26 - "-framework", 27 - "CoreServices", 28 - "-framework", 29 - diff --git a/tools/osx/xcode_locator.m b/tools/osx/xcode_locator.m 30 - index c602b0bb4b..1f7eb64810 100644 31 - --- a/tools/osx/xcode_locator.m 32 - +++ b/tools/osx/xcode_locator.m 33 - @@ -21,10 +21,6 @@ 34 - // 6,6.4,6.4.1 = 6.4.1 35 - // 6.3,6.3.0 = 6.3 36 - 37 - -#if !defined(__has_feature) || !__has_feature(objc_arc) 38 - -#error "This file requires ARC support." 39 - -#endif 40 - - 41 - #import <CoreServices/CoreServices.h> 42 - #import <Foundation/Foundation.h> 43 -