Add --incompatible_use_platforms_repo_for_constraints
This change adds an incompatible flag to disable constrains bundled with Bazel
in @bazel_tools.
Incompatible change issue:
https://github.com/bazelbuild/bazel/issues/8622
Tracking issue:
https://github.com/bazelbuild/bazel/issues/6516
RELNOTES: Incompatible change `--incompatible_use_platforms_repo_for_constraints` has been added. See https://github.com/bazelbuild/bazel/issues/8622 for details.
Closes #8625.
This is encore of https://github.com/bazelbuild/bazel/commit/332379ad6f8c49b0e087b504d73d3483c529e399. Previous implementation failed with dependency cycle with the configuration. In this attempt I don't use selects, but I've put the incompatible flag checking logic directly into the alias rule. Not nice, but get's thing done.
RELNOTES:
PiperOrigin-RevId: 254357477
diff --git a/tools/cpp/BUILD.static.freebsd b/tools/cpp/BUILD.static.freebsd
index 5dd2a8e..b21dc3d 100644
--- a/tools/cpp/BUILD.static.freebsd
+++ b/tools/cpp/BUILD.static.freebsd
@@ -62,12 +62,12 @@
toolchain(
name = "cc-toolchain-freebsd",
exec_compatible_with = [
- "@bazel_tools//platforms:x86_64",
- "@bazel_tools//platforms:freebsd",
+ "@platforms//cpu:x86_64",
+ "@platforms//os:freebsd",
],
target_compatible_with = [
- "@bazel_tools//platforms:x86_64",
- "@bazel_tools//platforms:freebsd",
+ "@platforms//cpu:x86_64",
+ "@platforms//os:freebsd",
],
toolchain = ":cc-compiler-freebsd",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
@@ -97,11 +97,11 @@
toolchain(
name = "cc-toolchain-armeabi-v7a",
exec_compatible_with = [
- "@bazel_tools//platforms:arm",
+ "@platforms//cpu:arm",
],
target_compatible_with = [
- "@bazel_tools//platforms:arm",
- "@bazel_tools//platforms:android",
+ "@platforms//cpu:arm",
+ "@platforms//os:android",
],
toolchain = ":cc-compiler-armeabi-v7a",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",