bazel_5: Build xcode-locator selectively for x86_64 (on "x86_64-darwin") or arm64 (on "aarch64-darwin")

This commit is contained in:
r2r-dev
2022-01-25 02:44:32 +01:00
parent 04500fd3a2
commit e1a28002a3
2 changed files with 2 additions and 2 deletions
@@ -177,7 +177,7 @@ stdenv.mkDerivation rec {
# we accept this fact because xcode_locator is only a short-lived process used during the build.
(substituteAll {
src = ./no-arc.patch;
multiBinPatch = if stdenv.hostPlatform.system == "aarch64-darwin" then "-arch arm64 -Wl,-no_adhoc_codesign" else "";
multiBinPatch = if stdenv.hostPlatform.system == "aarch64-darwin" then "arm64" else "x86_64";
})
# --experimental_strict_action_env (which may one day become the default
@@ -9,7 +9,7 @@ index 990afe3e8c..cd5b7b1b7a 100644
- /usr/bin/xcrun --sdk macosx clang -mmacosx-version-min=10.9 -fobjc-arc -framework CoreServices \
- -framework Foundation -arch arm64 -arch x86_64 -Wl,-no_adhoc_codesign -Wl,-no_uuid -o $@ $< && \
+ /usr/bin/xcrun --sdk macosx clang -mmacosx-version-min=10.9 -framework CoreServices \
+ -framework Foundation -arch x86_64 @multiBinPatch@ -Wl,-no_uuid -o $@ $< && \
+ -framework Foundation -arch @multiBinPatch@ -Wl,-no_uuid -o $@ $< && \
env -i codesign --identifier $@ --force --sign - $@
"""