From 5eaba48317b997d2f8b2163cfaed6215820a818c Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 22 Mar 2024 16:35:28 +0100 Subject: [PATCH] Swift: fix local build on ARM macOS As pointed out in https://github.com/bazelbuild/bazel/issues/21768, bazel 7 moved multi-arch macOS toolchain support to `apple_support`, so building Swift (which must target `x86_64` for now) was broken. Internally in the codeql CLI we were unaffected as we use a custom bundled toolchain. This fixes building from this repository. --- .bazelrc | 2 +- MODULE.bazel | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bazelrc b/.bazelrc index 12232b4bbd68..341839d4b524 100644 --- a/.bazelrc +++ b/.bazelrc @@ -11,7 +11,7 @@ common --override_module=semmle_code=%workspace%/misc/bazel/semmle_code_stub build --repo_env=CC=clang --repo_env=CXX=clang++ build:linux --cxxopt=-std=c++20 -build:macos --cxxopt=-std=c++20 --cpu=darwin_x86_64 +build:macos --cxxopt=-std=c++20 --platforms=@apple_support//platforms:macos_x86_64 build:windows --cxxopt=/std:c++20 --cxxopt=/Zc:preprocessor try-import %workspace%/local.bazelrc diff --git a/MODULE.bazel b/MODULE.bazel index e8c79e8377fa..800d180ff8a0 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -12,7 +12,7 @@ local_path_override( ) # see https://registry.bazel.build/ for a list of available packages - +bazel_dep(name = "apple_support", version = "1.14.0") bazel_dep(name = "platforms", version = "0.0.8") bazel_dep(name = "rules_pkg", version = "0.9.1") bazel_dep(name = "rules_nodejs", version = "6.0.3")