Skip to content

Commit

Permalink
Swift: fix local build on ARM macOS
Browse files Browse the repository at this point in the history
As pointed out in bazelbuild/bazel#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.
  • Loading branch information
redsun82 committed Mar 22, 2024
1 parent d9b0a59 commit 5eaba48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 5eaba48

Please sign in to comment.