Skip to content

Commit 22e845e

Browse files
zhangskzcopybara-github
authored andcommittedAug 2, 2023
Add a release flag to disambiguate between release and local config_settings.
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
1 parent 279d627 commit 22e845e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed
 

‎toolchain/BUILD.bazel

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
load(":cc_toolchain_config.bzl", "cc_toolchain_config")
2+
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
23

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

56
filegroup(name = "empty")
67

8+
bool_flag(
9+
name = "release",
10+
build_setting_default = False,
11+
)
12+
713
TOOLCHAINS = {
814
"osx-x86_64": "cc-compiler-osx-x86_64",
915
"osx-aarch_64": "cc-compiler-osx-aarch_64",
@@ -19,7 +25,7 @@ TOOLCHAINS = {
1925

2026
cc_toolchain_suite(
2127
name = "clang_suite",
22-
toolchains = TOOLCHAINS
28+
toolchains = TOOLCHAINS,
2329
)
2430

2531
[
@@ -50,8 +56,8 @@ cc_toolchain_config(
5056

5157
cc_toolchain_config(
5258
name = "linux-aarch_64-config",
53-
sysroot = "/opt/manylinux/2014/aarch64",
5459
linker_path = "/usr/bin/ld",
60+
sysroot = "/opt/manylinux/2014/aarch64",
5561
target_cpu = "aarch64",
5662
target_full_name = "aarch64-linux-gnu",
5763
)

‎toolchain/toolchains.bazelrc

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build:cross_config --crosstool_top=//toolchain:clang_suite
2+
build:cross_config --//toolchain:release=true
23
build:cross_config --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
34

45
build:linux-aarch_64 --config=cross_config --cpu=linux-aarch_64

0 commit comments

Comments
 (0)
Please sign in to comment.