Skip to content

Commit

Permalink
Add a release flag to disambiguate between release and local config_s…
Browse files Browse the repository at this point in the history
…ettings.

This flag will be set in UPB which will be submitted separately due to version skew between repos.

This attempts to fix the following error from local and release settings both matching.
```
ERROR: /workspace/_build/out/external/upb/python/dist/BUILD.bazel:251:9: Illegal ambiguous match on configurable attribute "platform" in @upb//python/dist:binary_wheel:
@upb//python/dist:linux_x86_64_local
@upb//python/dist:windows_x86_64
Multiple matches are not allowed unless one is unambiguously more specialized or they resolve to the same value. See https://bazel.build/reference/be/functions#select.
```
PiperOrigin-RevId: 553184373
  • Loading branch information
zhangskz committed Aug 10, 2023
1 parent 955eb44 commit 9195c96
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions toolchain/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
load(":cc_toolchain_config.bzl", "cc_toolchain_config")
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")

package(default_visibility = ["//visibility:public"])

filegroup(name = "empty")

bool_flag(
name = "release",
build_setting_default = False,
)

TOOLCHAINS = {
"osx-x86_64": "cc-compiler-osx-x86_64",
"osx-aarch_64": "cc-compiler-osx-aarch_64",
Expand All @@ -19,7 +25,7 @@ TOOLCHAINS = {

cc_toolchain_suite(
name = "clang_suite",
toolchains = TOOLCHAINS
toolchains = TOOLCHAINS,
)

[
Expand Down Expand Up @@ -50,8 +56,8 @@ cc_toolchain_config(

cc_toolchain_config(
name = "linux-aarch_64-config",
sysroot = "/opt/manylinux/2014/aarch64",
linker_path = "/usr/bin/ld",
sysroot = "/opt/manylinux/2014/aarch64",
target_cpu = "aarch64",
target_full_name = "aarch64-linux-gnu",
)
Expand Down
1 change: 1 addition & 0 deletions toolchain/toolchains.bazelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build:cross_config --crosstool_top=//toolchain:clang_suite
build:cross_config --//toolchain:release=true
build:cross_config --host_crosstool_top=@bazel_tools//tools/cpp:toolchain

build:linux-aarch_64 --config=cross_config --cpu=linux-aarch_64
Expand Down

0 comments on commit 9195c96

Please sign in to comment.