diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh
index 8a52f141cbdf51..90782f93e33414 100755
--- a/scripts/bootstrap/compile.sh
+++ b/scripts/bootstrap/compile.sh
@@ -273,9 +273,6 @@ EOF
# Set up @bazel_tools//platforms properly
mkdir -p ${BAZEL_TOOLS_REPO}/platforms
cp tools/platforms/BUILD.tools ${BAZEL_TOOLS_REPO}/platforms/BUILD
- link_file \
- "${PWD}/tools/platforms/fail_with_incompatible_use_platforms_repo_for_constraints.bzl" \
- "${BAZEL_TOOLS_REPO}/platforms/fail_with_incompatible_use_platforms_repo_for_constraints.bzl"
# Overwrite tools.WORKSPACE, this is only for the bootstrap binary
chmod u+w "${OUTPUT_DIR}/classes/com/google/devtools/build/lib/bazel/rules/tools.WORKSPACE"
diff --git a/site/docs/platforms.md b/site/docs/platforms.md
index 777a6eb978367f..4c3079e2b59e52 100644
--- a/site/docs/platforms.md
+++ b/site/docs/platforms.md
@@ -88,36 +88,35 @@ glibc version of 2.25. (See below for more on Bazel's built-in constraints.)
platform(
name = "linux_x86",
constraint_values = [
- "@platforms//os:linux",
- "@platforms//cpu:x86_64",
+ "@bazel_tools//platforms:linux",
+ "@bazel_tools//platforms:x86_64",
":glibc_2_25",
],
)
```
Note that it is an error for a platform to specify more than one value of the
-same constraint setting, such as `@platforms//cpu:x86_64` and
-`@platforms//cpu:arm` for `@platforms//cpu:cpu`.
+same constraint setting, such as `@bazel_tools//platforms:x86_64` and
+`@bazel_tools//platforms:arm` for `@bazel_tools//platforms:cpu`.
## Built-in constraints and platforms
Bazel ships with constraint definitions for the most popular CPU architectures
-and operating systems. These are all located in the repository
-`@platforms`. This repository is developed at
-[github.com/bazelbuild/platforms](https://github.com/bazelbuild/platforms):
+and operating systems. These are all located in the package
+`@bazel_tools//platforms`:
-* `//cpu:cpu` for the CPU architecture, with values `//cpu:x86_32`,
- `//cpu:x86_64`, `//cpu:ppc`, `//cpu:arm`, `//cpu:s390x`
-* `//os:os` for the operating system, with values `//os:android`,
- `//os:freebsd`, `//os:ios`, `//os:linux`, `//os:osx`, `//os:windows`
+* `:cpu` for the CPU architecture, with values `:x86_32`, `:x86_64`, `:ppc`,
+ `:arm`, `:s390x`
+* `:os` for the operating system, with values `:android`, `:freebsd`, `:ios`,
+ `:linux`, `:osx`, `:windows`
There are also the following special platform definitions:
-* `@bazel_tools//platforms:host_platform` - represents the CPU and operating
- system for the host environment
+* `:host_platform` - represents the CPU and operating system for the host
+ environment
-* `@bazel_tools//platforms:target_platform` - represents the CPU and operating
- system for the target environment
+* `:target_platform` - represents the CPU and operating system for the target
+ environment
The CPU values used by these two platforms can be specified with the
`--host_cpu` and `--cpu` flags.
diff --git a/site/docs/toolchains.md b/site/docs/toolchains.md
index 747af158947de6..998f623ba96b84 100644
--- a/site/docs/toolchains.md
+++ b/site/docs/toolchains.md
@@ -104,14 +104,14 @@ We can improve on this solution by using `select` to choose the `compiler`
config_setting(
name = "on_linux",
constraint_values = [
- "@platforms//os:linux",
+ "@bazel_tools//platforms:linux",
],
)
config_setting(
name = "on_windows",
constraint_values = [
- "@platforms//os:windows",
+ "@bazel_tools//platforms:windows",
],
)
@@ -276,12 +276,12 @@ appropriate for a given platform.
toolchain(
name = "barc_linux_toolchain",
exec_compatible_with = [
- "@platforms//os:linux",
- "@platforms//cpu:x86_64",
+ "@bazel_tools//platforms:linux",
+ "@bazel_tools//platforms:x86_64",
],
target_compatible_with = [
- "@platforms//os:linux",
- "@platforms//cpu:x86_64",
+ "@bazel_tools//platforms:linux",
+ "@bazel_tools//platforms:x86_64",
],
toolchain = ":barc_linux",
toolchain_type = ":toolchain_type",
@@ -290,12 +290,12 @@ toolchain(
toolchain(
name = "barc_windows_toolchain",
exec_compatible_with = [
- "@platforms//os:windows",
- "@platforms//cpu:x86_64",
+ "@bazel_tools//platforms:windows",
+ "@bazel_tools//platforms:x86_64",
],
target_compatible_with = [
- "@platforms//os:windows",
- "@platforms//cpu:x86_64",
+ "@bazel_tools//platforms:windows",
+ "@bazel_tools//platforms:x86_64",
],
toolchain = ":barc_windows",
toolchain_type = ":toolchain_type",
@@ -336,7 +336,7 @@ toolchain will be selected based on the target and execution platforms.
platform(
name = "my_target_platform",
constraint_values = [
- "@platforms//os:linux",
+ "@bazel_tools//platforms:linux",
],
)
@@ -351,7 +351,7 @@ bazel build //my_pkg:my_bar_binary --platforms=//my_pkg:my_target_platform
```
Bazel will see that `//my_pkg:my_bar_binary` is being built with a platform that
-has `@platforms//os:linux` and therefore resolve the
+has `@bazel_tools//platforms:linux` and therefore resolve the
`//bar_tools:toolchain_type` reference to `//bar_tools:barc_linux_toolchain`.
This will end up building `//bar_tools:barc_linux` but not
`//barc_tools:barc_windows`.
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java b/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java
index 61b9d947bdd1ec..c03f9ed49555e3 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java
@@ -68,18 +68,6 @@ public class CoreOptions extends FragmentOptions implements Cloneable {
help = "If true, the genfiles directory is folded into the bin directory.")
public boolean mergeGenfilesDirectory;
- @Option(
- name = "incompatible_use_platforms_repo_for_constraints",
- defaultValue = "false",
- documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS,
- effectTags = {OptionEffectTag.AFFECTS_OUTPUTS},
- metadataTags = {
- OptionMetadataTag.INCOMPATIBLE_CHANGE,
- OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
- },
- help = "If true, constraint settings from @bazel_tools are removed.")
- public boolean usePlatformsRepoForConstraints;
-
@Option(
name = "define",
converter = Converters.AssignmentConverter.class,
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/LocalConfigPlatformFunction.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/LocalConfigPlatformFunction.java
index 35379910d63f31..1209c5d3fc94f2 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/repository/LocalConfigPlatformFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/LocalConfigPlatformFunction.java
@@ -81,17 +81,17 @@ public RepositoryDirectoryValue.Builder fetch(
static String cpuToConstraint(CPU cpu) {
switch (cpu) {
case X86_32:
- return "@platforms//cpu:x86_32";
+ return "@bazel_tools//platforms:x86_32";
case X86_64:
- return "@platforms//cpu:x86_64";
+ return "@bazel_tools//platforms:x86_64";
case PPC:
- return "@platforms//cpu:ppc";
+ return "@bazel_tools//platforms:ppc";
case ARM:
- return "@platforms//cpu:arm";
+ return "@bazel_tools//platforms:arm";
case AARCH64:
- return "@platforms//cpu:aarch64";
+ return "@bazel_tools//platforms:aarch64";
case S390X:
- return "@platforms//cpu:s390x";
+ return "@bazel_tools//platforms:s390x";
default:
// Unknown, so skip it.
return null;
@@ -102,13 +102,13 @@ static String cpuToConstraint(CPU cpu) {
static String osToConstraint(OS os) {
switch (os) {
case DARWIN:
- return "@platforms//os:osx";
+ return "@bazel_tools//platforms:osx";
case FREEBSD:
- return "@platforms//os:freebsd";
+ return "@bazel_tools//platforms:freebsd";
case LINUX:
- return "@platforms//os:linux";
+ return "@bazel_tools//platforms:linux";
case WINDOWS:
- return "@platforms//os:windows";
+ return "@bazel_tools//platforms:windows";
default:
// Unknown, so skip it.
return null;
diff --git a/src/main/java/com/google/devtools/build/lib/rules/config/ConfigRuleClasses.java b/src/main/java/com/google/devtools/build/lib/rules/config/ConfigRuleClasses.java
index 25aedb6e0a203f..7522324fc94949 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/config/ConfigRuleClasses.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/config/ConfigRuleClasses.java
@@ -327,7 +327,7 @@ Matches an expected configuration state (expressed as Bazel flags or platform co
config_setting(
name = "64bit_glibc_2_25",
constraint_values = [
- "@platforms//cpu:x86_64",
+ "@bazel_tools//platforms:x86_64",
"//example:glibc_2_25",
]
)
diff --git a/src/main/java/com/google/devtools/build/lib/rules/platform/ConstraintSettingRule.java b/src/main/java/com/google/devtools/build/lib/rules/platform/ConstraintSettingRule.java
index e9416be459cc6e..511619a1b6fcab 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/platform/ConstraintSettingRule.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/platform/ConstraintSettingRule.java
@@ -67,7 +67,7 @@ public RuleDefinition.Metadata getMetadata() {
Each constraint_setting
has an extensible set of associated
constraint_value
s. Usually these are defined in the same package, but sometimes a
different package will introduce new values for an existing setting. For instance, the predefined
-setting @platforms//cpu:cpu
can be extended with a custom value in order to
+setting @bazel_tools//platforms:cpu
can be extended with a custom value in order to
define a platform targeting an obscure cpu architecture.
*/
diff --git a/src/main/java/com/google/devtools/build/lib/rules/platform/ConstraintValueRule.java b/src/main/java/com/google/devtools/build/lib/rules/platform/ConstraintValueRule.java
index 2ca844a86277e6..43ccf342c7401b 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/platform/ConstraintValueRule.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/platform/ConstraintValueRule.java
@@ -67,7 +67,7 @@ public Metadata getMetadata() {
constraint_value(
name = "mips",
- constraint_setting = "@platforms//cpu:cpu",
+ constraint_setting = "@bazel_tools//platforms:cpu",
)
diff --git a/src/main/java/com/google/devtools/build/lib/rules/platform/PlatformRule.java b/src/main/java/com/google/devtools/build/lib/rules/platform/PlatformRule.java
index bafdb7b0e7e9b4..c54d05a0aeccf1 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/platform/PlatformRule.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/platform/PlatformRule.java
@@ -49,7 +49,7 @@ public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env)
Each constraint_value
in this list must be for a different
constraint_setting
. For example, you cannot define a platform that requires the
- cpu architecture to be both @platforms//cpu:x86_64
and
+ cpu architecture to be both @bazel_tools//platforms:x86_64
and
@bazel_tools//platforms:arm
.
*/
.add(
@@ -130,8 +130,8 @@ public Metadata getMetadata() {
platform(
name = "linux_arm",
constraint_values = [
- "@platforms//os:linux",
- "@platforms//cpu:arm",
+ "@bazel_tools//platforms:linux",
+ "@bazel_tools//platforms:arm",
],
)
@@ -177,8 +177,8 @@ public Metadata getMetadata() {
platform(
name = "parent",
constraint_values = [
- "@platforms//os:linux",
- "@platforms//cpu:arm",
+ "@bazel_tools//platforms:linux",
+ "@bazel_tools//platforms:arm",
],
remote_execution_properties = """
parent properties
@@ -188,7 +188,7 @@ public Metadata getMetadata() {
name = "child_a",
parents = [":parent"],
constraint_values = [
- "@platforms//cpu:x86_64",
+ "@bazel_tools//platforms:x86_64",
],
remote_execution_properties = """
child a properties
@@ -210,8 +210,8 @@ public Metadata getMetadata() {
-
- "child_a" has the constraint values "@platforms//os:linux" (inherited from the
- parent) and "@platforms//cpu:x86_64" (set directly on the platform). It has the
+ "child_a" has the constraint values "@bazel_tools//platforms:linux" (inherited from the
+ parent) and "@bazel_tools//platforms:x86_64" (set directly on the platform). It has the
"remote_execution_properties" set to "child a properties"
-
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/mock/BazelAnalysisMock.java b/src/test/java/com/google/devtools/build/lib/analysis/mock/BazelAnalysisMock.java
index 6240424efad85c..edf34a1142f1bf 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/mock/BazelAnalysisMock.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/mock/BazelAnalysisMock.java
@@ -67,14 +67,12 @@ private BazelAnalysisMock() {
@Override
public List getWorkspaceContents(MockToolsConfig config) {
String bazelToolWorkspace = config.getPath("/bazel_tools_workspace").getPathString();
- String bazelPlatformsWorkspace = config.getPath("/platforms").getPathString();
String localConfigPlatformWorkspace =
config.getPath("/local_config_platform_workspace").getPathString();
return new ArrayList<>(
ImmutableList.of(
"local_repository(name = 'bazel_tools', path = '" + bazelToolWorkspace + "')",
- "local_repository(name = 'platforms', path = '" + bazelPlatformsWorkspace + "')",
"local_repository(name = 'local_config_xcode', path = '/local_config_xcode')",
"local_repository(name = 'com_google_protobuf', path = '/protobuf')",
"bind(name = 'android/sdk', actual='@bazel_tools//tools/android:sdk')",
@@ -101,25 +99,6 @@ public void setupMockClient(MockToolsConfig config, List workspaceConten
config.create("/local_config_xcode/WORKSPACE");
config.create("/protobuf/WORKSPACE");
config.overwrite("WORKSPACE", workspaceContents.toArray(new String[workspaceContents.size()]));
- config.create("/platforms/WORKSPACE", "workspace(name = 'platforms')");
- config.create("/platforms/BUILD");
- config.create(
- "/platforms/cpu/BUILD",
- "constraint_setting(name = 'cpu')",
- "constraint_value(name = 'x86_32', constraint_setting = ':cpu')",
- "constraint_value(name = 'x86_64', constraint_setting = ':cpu')",
- "constraint_value(name = 'ppc', constraint_setting = ':cpu')",
- "constraint_value(name = 'arm', constraint_setting = ':cpu')",
- "constraint_value(name = 'aarch64', constraint_setting = ':cpu')",
- "constraint_value(name = 's390x', constraint_setting = ':cpu')");
-
- config.create(
- "/platforms/os/BUILD",
- "constraint_setting(name = 'os')",
- "constraint_value(name = 'linux', constraint_setting = ':os')",
- "constraint_value(name = 'osx', constraint_setting = ':os')",
- "constraint_value(name = 'freebsd', constraint_setting = ':os')",
- "constraint_value(name = 'windows', constraint_setting = ':os')");
config.create("/bazel_tools_workspace/WORKSPACE", "workspace(name = 'bazel_tools')");
Runfiles runfiles = Runfiles.create();
for (String filename :
diff --git a/src/test/java/com/google/devtools/build/lib/bazel/repository/LocalConfigPlatformFunctionTest.java b/src/test/java/com/google/devtools/build/lib/bazel/repository/LocalConfigPlatformFunctionTest.java
index bc509e0ef7cb72..663d62d19d9310 100644
--- a/src/test/java/com/google/devtools/build/lib/bazel/repository/LocalConfigPlatformFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/bazel/repository/LocalConfigPlatformFunctionTest.java
@@ -45,12 +45,12 @@ public static class CpuConstraintTest {
public static Collection createInputValues() {
return ImmutableList.of(
// CPU value tests.
- new Object[] {CPU.X86_64, "@platforms//cpu:x86_64"},
- new Object[] {CPU.X86_32, "@platforms//cpu:x86_32"},
- new Object[] {CPU.PPC, "@platforms//cpu:ppc"},
- new Object[] {CPU.ARM, "@platforms//cpu:arm"},
- new Object[] {CPU.AARCH64, "@platforms//cpu:aarch64"},
- new Object[] {CPU.S390X, "@platforms//cpu:s390x"});
+ new Object[] {CPU.X86_64, "@bazel_tools//platforms:x86_64"},
+ new Object[] {CPU.X86_32, "@bazel_tools//platforms:x86_32"},
+ new Object[] {CPU.PPC, "@bazel_tools//platforms:ppc"},
+ new Object[] {CPU.ARM, "@bazel_tools//platforms:arm"},
+ new Object[] {CPU.AARCH64, "@bazel_tools//platforms:aarch64"},
+ new Object[] {CPU.S390X, "@bazel_tools//platforms:s390x"});
}
private final CPU testCpu;
@@ -81,10 +81,10 @@ public static class OsConstraintTest {
public static Collection createInputValues() {
return ImmutableList.of(
// OS value tests.
- new Object[] {OS.LINUX, "@platforms//os:linux"},
- new Object[] {OS.DARWIN, "@platforms//os:osx"},
- new Object[] {OS.FREEBSD, "@platforms//os:freebsd"},
- new Object[] {OS.WINDOWS, "@platforms//os:windows"});
+ new Object[] {OS.LINUX, "@bazel_tools//platforms:linux"},
+ new Object[] {OS.DARWIN, "@bazel_tools//platforms:osx"},
+ new Object[] {OS.FREEBSD, "@bazel_tools//platforms:freebsd"},
+ new Object[] {OS.WINDOWS, "@bazel_tools//platforms:windows"});
}
private final OS testOs;
@@ -112,9 +112,9 @@ public void unknownOsConstraint() {
@RunWith(JUnit4.class)
public static class FunctionTest extends BuildViewTestCase {
private static final ConstraintSettingInfo CPU_CONSTRAINT =
- ConstraintSettingInfo.create(Label.parseAbsoluteUnchecked("@platforms//cpu:cpu"));
+ ConstraintSettingInfo.create(Label.parseAbsoluteUnchecked("@bazel_tools//platforms:cpu"));
private static final ConstraintSettingInfo OS_CONSTRAINT =
- ConstraintSettingInfo.create(Label.parseAbsoluteUnchecked("@platforms//os:os"));
+ ConstraintSettingInfo.create(Label.parseAbsoluteUnchecked("@bazel_tools//platforms:os"));
@Test
public void generateConfigRepository() throws Exception {
diff --git a/src/test/shell/bazel/platforms_test.sh b/src/test/shell/bazel/platforms_test.sh
index d33a6c631f5bd7..6db625ab656789 100755
--- a/src/test/shell/bazel/platforms_test.sh
+++ b/src/test/shell/bazel/platforms_test.sh
@@ -71,12 +71,5 @@ EOF
fail "Bazel failed to build @platforms"
}
-function test_incompatible_use_platforms_repo_for_constraints() {
- # We test that a built-in @platforms repository is buildable.
- bazel build --incompatible_use_platforms_repo_for_constraints @bazel_tools//platforms:all &> \
- $TEST_log && fail "Build passed when we expected an error."
- expect_log "Constraints from @bazel_tools//platforms have been removed."
-}
-
run_suite "platform mapping test"
diff --git a/src/test/shell/integration/discard_graph_edges_test.sh b/src/test/shell/integration/discard_graph_edges_test.sh
index 3bf1f9b477c075..926dc79be2b279 100755
--- a/src/test/shell/integration/discard_graph_edges_test.sh
+++ b/src/test/shell/integration/discard_graph_edges_test.sh
@@ -271,7 +271,7 @@ function test_packages_cleared() {
package_count="$(extract_histogram_count "$histo_file" \
'devtools\.build\.lib\..*\.Package$')"
# A few packages aren't cleared.
- [[ "$package_count" -le 18 ]] \
+ [[ "$package_count" -le 17 ]] \
|| fail "package count $package_count too high"
glob_count="$(extract_histogram_count "$histo_file" "GlobValue$")"
[[ "$glob_count" -le 1 ]] \
diff --git a/src/test/shell/testenv.sh b/src/test/shell/testenv.sh
index 25ecb73a60a3c2..73316d4426a0ca 100755
--- a/src/test/shell/testenv.sh
+++ b/src/test/shell/testenv.sh
@@ -408,7 +408,7 @@ toolchain(
name = "py_toolchain",
toolchain = ":py_runtime_pair",
toolchain_type = "@bazel_tools//tools/python:toolchain_type",
- target_compatible_with = ["@platforms//os:windows"],
+ target_compatible_with = ["@bazel_tools//platforms:windows"],
)
EOF
}
diff --git a/tools/cpp/BUILD b/tools/cpp/BUILD
index e9da96db1611ba..ad1b12a453625e 100644
--- a/tools/cpp/BUILD
+++ b/tools/cpp/BUILD
@@ -169,10 +169,10 @@ cc_toolchain(
toolchain(
name = "cc-toolchain-ppc",
exec_compatible_with = [
- "@platforms//cpu:ppc",
+ "@bazel_tools//platforms:ppc",
],
target_compatible_with = [
- "@platforms//cpu:ppc",
+ "@bazel_tools//platforms:ppc",
],
toolchain = ":cc-compiler-ppc",
toolchain_type = ":toolchain_type",
@@ -196,10 +196,10 @@ cc_toolchain(
toolchain(
name = "cc-toolchain-s390x",
exec_compatible_with = [
- "@platforms//cpu:s390x",
+ "@bazel_tools//platforms:s390x",
],
target_compatible_with = [
- "@platforms//cpu:s390x",
+ "@bazel_tools//platforms:s390x",
],
toolchain = ":cc-compiler-s390x",
toolchain_type = ":toolchain_type",
@@ -225,8 +225,8 @@ toolchain(
exec_compatible_with = [
],
target_compatible_with = [
- "@platforms//cpu:arm",
- "@platforms//os:android",
+ "@bazel_tools//platforms:arm",
+ "@bazel_tools//platforms:android",
],
toolchain = ":cc-compiler-armeabi-v7a",
toolchain_type = ":toolchain_type",
@@ -250,12 +250,12 @@ cc_toolchain(
toolchain(
name = "cc-toolchain-k8",
exec_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:linux",
+ "@bazel_tools//platforms:x86_64",
+ "@bazel_tools//platforms:linux",
],
target_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:linux",
+ "@bazel_tools//platforms:x86_64",
+ "@bazel_tools//platforms:linux",
],
toolchain = ":cc-compiler-k8",
toolchain_type = ":toolchain_type",
@@ -289,12 +289,12 @@ cc_toolchain_config(
toolchain(
name = "cc-toolchain-darwin",
exec_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:osx",
+ "@bazel_tools//platforms:x86_64",
+ "@bazel_tools//platforms:osx",
],
target_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:osx",
+ "@bazel_tools//platforms:x86_64",
+ "@bazel_tools//platforms:osx",
],
toolchain = ":cc-compiler-darwin",
toolchain_type = ":toolchain_type",
@@ -328,12 +328,12 @@ cc_toolchain_config(
toolchain(
name = "cc-toolchain-freebsd",
exec_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:freebsd",
+ "@bazel_tools//platforms:x86_64",
+ "@bazel_tools//platforms:freebsd",
],
target_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:freebsd",
+ "@bazel_tools//platforms:x86_64",
+ "@bazel_tools//platforms:freebsd",
],
toolchain = ":cc-compiler-freebsd",
toolchain_type = ":toolchain_type",
@@ -367,12 +367,12 @@ cc_toolchain_config(
toolchain(
name = "cc-toolchain-x64_windows",
exec_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:windows",
+ "@bazel_tools//platforms:x86_64",
+ "@bazel_tools//platforms:windows",
],
target_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:windows",
+ "@bazel_tools//platforms:x86_64",
+ "@bazel_tools//platforms:windows",
],
toolchain = ":cc-compiler-x64_windows",
toolchain_type = ":toolchain_type",
@@ -406,13 +406,13 @@ cc_toolchain_config(
toolchain(
name = "cc-toolchain-x64_windows_msvc",
exec_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:windows",
+ "@bazel_tools//platforms:x86_64",
+ "@bazel_tools//platforms:windows",
":msvc",
],
target_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:windows",
+ "@bazel_tools//platforms:x86_64",
+ "@bazel_tools//platforms:windows",
],
toolchain = ":cc-compiler-x64_windows_msvc",
toolchain_type = ":toolchain_type",
diff --git a/tools/cpp/BUILD.static.freebsd b/tools/cpp/BUILD.static.freebsd
index b21dc3d2a3b2f9..5dd2a8e11bd5fb 100644
--- a/tools/cpp/BUILD.static.freebsd
+++ b/tools/cpp/BUILD.static.freebsd
@@ -62,12 +62,12 @@ cc_toolchain_config(
toolchain(
name = "cc-toolchain-freebsd",
exec_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:freebsd",
+ "@bazel_tools//platforms:x86_64",
+ "@bazel_tools//platforms:freebsd",
],
target_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:freebsd",
+ "@bazel_tools//platforms:x86_64",
+ "@bazel_tools//platforms:freebsd",
],
toolchain = ":cc-compiler-freebsd",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
@@ -97,11 +97,11 @@ cc_toolchain_config(
toolchain(
name = "cc-toolchain-armeabi-v7a",
exec_compatible_with = [
- "@platforms//cpu:arm",
+ "@bazel_tools//platforms:arm",
],
target_compatible_with = [
- "@platforms//cpu:arm",
- "@platforms//os:android",
+ "@bazel_tools//platforms:arm",
+ "@bazel_tools//platforms:android",
],
toolchain = ":cc-compiler-armeabi-v7a",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
diff --git a/tools/cpp/BUILD.toolchains.tpl b/tools/cpp/BUILD.toolchains.tpl
index 7aa08d0d875cef..024d8bff09752a 100644
--- a/tools/cpp/BUILD.toolchains.tpl
+++ b/tools/cpp/BUILD.toolchains.tpl
@@ -11,8 +11,8 @@ toolchain(
name = "cc-toolchain-armeabi-v7a",
exec_compatible_with = HOST_CONSTRAINTS,
target_compatible_with = [
- "@platforms//cpu:arm",
- "@platforms//os:android",
+ "@bazel_tools//platforms:arm",
+ "@bazel_tools//platforms:android",
],
toolchain = "@local_config_cc//:cc-compiler-armabi-v7a",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
diff --git a/tools/cpp/BUILD.windows.tpl b/tools/cpp/BUILD.windows.tpl
index 18df6500bb928f..bd45b5854ba9bc 100644
--- a/tools/cpp/BUILD.windows.tpl
+++ b/tools/cpp/BUILD.windows.tpl
@@ -75,13 +75,13 @@ cc_toolchain_config(
toolchain(
name = "cc-toolchain-x64_windows_msys",
exec_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:windows",
+ "@bazel_tools//platforms:x86_64",
+ "@bazel_tools//platforms:windows",
"@bazel_tools//tools/cpp:msys",
],
target_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:windows",
+ "@bazel_tools//platforms:x86_64",
+ "@bazel_tools//platforms:windows",
],
toolchain = ":cc-compiler-x64_windows_msys",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
@@ -121,13 +121,13 @@ cc_toolchain_config(
toolchain(
name = "cc-toolchain-x64_windows_mingw",
exec_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:windows",
+ "@bazel_tools//platforms:x86_64",
+ "@bazel_tools//platforms:windows",
"@bazel_tools//tools/cpp:mingw",
],
target_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:windows",
+ "@bazel_tools//platforms:x86_64",
+ "@bazel_tools//platforms:windows",
],
toolchain = ":cc-compiler-x64_windows_mingw",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
@@ -186,12 +186,12 @@ cc_toolchain_config(
toolchain(
name = "cc-toolchain-x64_windows",
exec_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:windows",
+ "@bazel_tools//platforms:x86_64",
+ "@bazel_tools//platforms:windows",
],
target_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:windows",
+ "@bazel_tools//platforms:x86_64",
+ "@bazel_tools//platforms:windows",
],
toolchain = ":cc-compiler-x64_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
@@ -219,8 +219,8 @@ toolchain(
exec_compatible_with = [
],
target_compatible_with = [
- "@platforms//cpu:arm",
- "@platforms//os:android",
+ "@bazel_tools//platforms:arm",
+ "@bazel_tools//platforms:android",
],
toolchain = ":cc-compiler-armeabi-v7a",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
diff --git a/tools/osx/crosstool/BUILD.toolchains b/tools/osx/crosstool/BUILD.toolchains
index 8fa7e4afc8ffdd..178ab86f4fec83 100644
--- a/tools/osx/crosstool/BUILD.toolchains
+++ b/tools/osx/crosstool/BUILD.toolchains
@@ -7,8 +7,8 @@ load(":osx_archs.bzl", "OSX_TOOLS_ARCHS", "OSX_TOOLS_CONSTRAINTS")
name = "cc-toolchain-" + arch,
exec_compatible_with = [
# These only execute on macOS.
- "@platforms//os:osx",
- "@platforms//cpu:x86_64",
+ "@bazel_tools//platforms:osx",
+ "@bazel_tools//platforms:x86_64",
],
target_compatible_with = OSX_TOOLS_CONSTRAINTS[arch],
toolchain = "@local_config_cc//:cc-compiler-" + arch,
diff --git a/tools/osx/crosstool/osx_archs.bzl b/tools/osx/crosstool/osx_archs.bzl
index a8788a4a332e40..8c37eb012681a7 100644
--- a/tools/osx/crosstool/osx_archs.bzl
+++ b/tools/osx/crosstool/osx_archs.bzl
@@ -37,17 +37,17 @@ OSX_TOOLS_ARCHS = [
# TODO(apple-rules): Rename osx constraint to macOS.
# TODO(apple-rules): Add constraints for watchos and tvos.
OSX_TOOLS_CONSTRAINTS = {
- "darwin_x86_64": ["@platforms//os:osx", "@platforms//cpu:x86_64"],
- "ios_i386": ["@platforms//os:ios", "@platforms//cpu:x86_32"],
- "ios_x86_64": ["@platforms//os:ios", "@platforms//cpu:x86_64"],
- "watchos_i386": ["@platforms//os:ios", "@platforms//cpu:x86_32"],
- "watchos_x86_64": ["@platforms//os:ios", "@platforms//cpu:x86_64"],
- "tvos_x86_64": ["@platforms//os:ios", "@platforms//cpu:x86_64"],
- "armeabi-v7a": ["@platforms//cpu:arm"],
- "ios_armv7": ["@platforms//os:ios", "@platforms//cpu:arm"],
- "ios_arm64": ["@platforms//os:ios", "@platforms//cpu:aarch64"],
- "ios_arm64e": ["@platforms//os:ios", "@platforms//cpu:aarch64"],
- "watchos_armv7k": ["@platforms//os:ios", "@platforms//cpu:arm"],
- "watchos_arm64_32": ["@platforms//os:ios", "@platforms//cpu:aarch64"],
- "tvos_arm64": ["@platforms//os:ios", "@platforms//cpu:aarch64"],
+ "darwin_x86_64": ["@bazel_tools//platforms:osx", "@bazel_tools//platforms:x86_64"],
+ "ios_i386": ["@bazel_tools//platforms:ios", "@bazel_tools//platforms:x86_32"],
+ "ios_x86_64": ["@bazel_tools//platforms:ios", "@bazel_tools//platforms:x86_64"],
+ "watchos_i386": ["@bazel_tools//platforms:ios", "@bazel_tools//platforms:x86_32"],
+ "watchos_x86_64": ["@bazel_tools//platforms:ios", "@bazel_tools//platforms:x86_64"],
+ "tvos_x86_64": ["@bazel_tools//platforms:ios", "@bazel_tools//platforms:x86_64"],
+ "armeabi-v7a": ["@bazel_tools//platforms:arm"],
+ "ios_armv7": ["@bazel_tools//platforms:ios", "@bazel_tools//platforms:arm"],
+ "ios_arm64": ["@bazel_tools//platforms:ios", "@bazel_tools//platforms:aarch64"],
+ "ios_arm64e": ["@bazel_tools//platforms:ios", "@bazel_tools//platforms:aarch64"],
+ "watchos_armv7k": ["@bazel_tools//platforms:ios", "@bazel_tools//platforms:arm"],
+ "watchos_arm64_32": ["@bazel_tools//platforms:ios", "@bazel_tools//platforms:aarch64"],
+ "tvos_arm64": ["@bazel_tools//platforms:ios", "@bazel_tools//platforms:aarch64"],
}
diff --git a/tools/platforms/BUILD b/tools/platforms/BUILD
index ec47710a21c41e..f0dc074f3ead4e 100644
--- a/tools/platforms/BUILD
+++ b/tools/platforms/BUILD
@@ -1,13 +1,9 @@
-load(":fail_with_incompatible_use_platforms_repo_for_constraints.bzl", "fail_with_incompatible_use_platforms_repo_for_constraints")
+# Standard constraint_setting and constraint_values to be used in platforms.
package(
default_visibility = ["//visibility:public"],
)
-fail_with_incompatible_use_platforms_repo_for_constraints(
- name = "fail_with_incompatible_use_platforms_repo_for_constraints",
-)
-
filegroup(
name = "package-srcs",
srcs = [
@@ -20,121 +16,70 @@ filegroup(
srcs = glob(["**"]),
)
-config_setting(
- name = "using_platforms_not_bazel_tools",
- values = {"incompatible_use_platforms_repo_for_constraints": "true"},
-)
-
-alias(
- name = "cpu",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//cpu:cpu",
- }),
-)
+# These match values in //src/main/java/com/google/devtools/build/lib/util:CPU.java
+constraint_setting(name = "cpu")
-alias(
+constraint_value(
name = "x86_32",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//cpu:x86_32",
- }),
+ constraint_setting = ":cpu",
)
-alias(
+constraint_value(
name = "x86_64",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//cpu:x86_64",
- }),
+ constraint_setting = ":cpu",
)
-alias(
+constraint_value(
name = "ppc",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//cpu:ppc",
- }),
+ constraint_setting = ":cpu",
)
-alias(
+constraint_value(
name = "arm",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//cpu:arm",
- }),
+ constraint_setting = ":cpu",
)
-alias(
+constraint_value(
name = "aarch64",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//cpu:aarch64",
- }),
+ constraint_setting = ":cpu",
)
-alias(
+constraint_value(
name = "s390x",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//cpu:s390x",
- }),
+ constraint_setting = ":cpu",
)
-alias(
- name = "os",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//os:os",
- }),
-)
+# These match values in //src/main/java/com/google/devtools/build/lib/util:OS.java
+constraint_setting(name = "os")
-alias(
+constraint_value(
name = "osx",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//os:osx",
- }),
+ constraint_setting = ":os",
)
-alias(
+constraint_value(
name = "ios",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//os:ios",
- }),
+ constraint_setting = ":os",
)
-alias(
+constraint_value(
name = "freebsd",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//os:freebsd",
- }),
+ constraint_setting = ":os",
)
-alias(
+constraint_value(
name = "android",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//os:android",
- }),
+ constraint_setting = ":os",
)
-alias(
+constraint_value(
name = "linux",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//os:linux",
- }),
+ constraint_setting = ":os",
)
-alias(
+constraint_value(
name = "windows",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//os:windows",
- }),
+ constraint_setting = ":os",
)
# A default platform with nothing defined.
@@ -147,19 +92,19 @@ platform(
constraint_values = [
],
cpu_constraints = [
- "@platforms//cpu:x86_32",
- "@platforms//cpu:x86_64",
- "@platforms//cpu:ppc",
- "@platforms//cpu:arm",
- "@platforms//cpu:aarch64",
- "@platforms//cpu:s390x",
+ ":x86_32",
+ ":x86_64",
+ ":ppc",
+ ":arm",
+ ":aarch64",
+ ":s390x",
],
host_platform = True,
os_constraints = [
- "@platforms//os:osx",
- "@platforms//os:freebsd",
- "@platforms//os:linux",
- "@platforms//os:windows",
+ ":osx",
+ ":freebsd",
+ ":linux",
+ ":windows",
],
)
@@ -168,18 +113,18 @@ platform(
constraint_values = [
],
cpu_constraints = [
- "@platforms//cpu:x86_32",
- "@platforms//cpu:x86_64",
- "@platforms//cpu:ppc",
- "@platforms//cpu:arm",
- "@platforms//cpu:aarch64",
- "@platforms//cpu:s390x",
+ ":x86_32",
+ ":x86_64",
+ ":ppc",
+ ":arm",
+ ":aarch64",
+ ":s390x",
],
os_constraints = [
- "@platforms//os:osx",
- "@platforms//os:freebsd",
- "@platforms//os:linux",
- "@platforms//os:windows",
+ ":osx",
+ ":freebsd",
+ ":linux",
+ ":windows",
],
target_platform = True,
)
diff --git a/tools/platforms/BUILD.tools b/tools/platforms/BUILD.tools
index a724463dae7fb0..862c554f8e7222 100644
--- a/tools/platforms/BUILD.tools
+++ b/tools/platforms/BUILD.tools
@@ -1,142 +1,73 @@
-load(":fail_with_incompatible_use_platforms_repo_for_constraints.bzl", "fail_with_incompatible_use_platforms_repo_for_constraints")
+# Standard constraint_setting and constraint_values to be used in platforms.
package(
default_visibility = ["//visibility:public"],
)
-fail_with_incompatible_use_platforms_repo_for_constraints(
- name = "fail_with_incompatible_use_platforms_repo_for_constraints",
- visibility = ["//visibility:private"],
-)
-
-filegroup(
- name = "package-srcs",
- srcs = [
- "BUILD.tools",
- "fail_with_incompatible_use_platforms_repo_for_constraints.bzl"
- ],
-)
-
-filegroup(
- name = "srcs",
- srcs = glob(["**"]),
-)
+# These match values in //src/main/java/com/google/devtools/build/lib/util:CPU.java
+constraint_setting(name = "cpu")
-config_setting(
- name = "using_platforms_not_bazel_tools",
- values = {"incompatible_use_platforms_repo_for_constraints": "true"},
-)
-
-alias(
- name = "cpu",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//cpu:cpu",
- }),
-)
-
-alias(
+constraint_value(
name = "x86_32",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//cpu:x86_32",
- }),
+ constraint_setting = ":cpu",
)
-alias(
+constraint_value(
name = "x86_64",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//cpu:x86_64",
- }),
+ constraint_setting = ":cpu",
)
-alias(
+constraint_value(
name = "ppc",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//cpu:ppc",
- }),
+ constraint_setting = ":cpu",
)
-alias(
+constraint_value(
name = "arm",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//cpu:arm",
- }),
+ constraint_setting = ":cpu",
)
-alias(
+constraint_value(
name = "aarch64",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//cpu:aarch64",
- }),
+ constraint_setting = ":cpu",
)
-alias(
+constraint_value(
name = "s390x",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//cpu:s390x",
- }),
+ constraint_setting = ":cpu",
)
-alias(
- name = "os",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//os:os",
- }),
-)
+# These match values in //src/main/java/com/google/devtools/build/lib/util:OS.java
+constraint_setting(name = "os")
-alias(
+constraint_value(
name = "osx",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//os:osx",
- }),
+ constraint_setting = ":os",
)
-alias(
+constraint_value(
name = "ios",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//os:ios",
- }),
+ constraint_setting = ":os",
)
-alias(
+constraint_value(
name = "freebsd",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//os:freebsd",
- }),
+ constraint_setting = ":os",
)
-alias(
+constraint_value(
name = "android",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//os:android",
- }),
+ constraint_setting = ":os",
)
-alias(
+constraint_value(
name = "linux",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//os:linux",
- }),
+ constraint_setting = ":os",
)
-alias(
+constraint_value(
name = "windows",
- actual = select({
- ":using_platforms_not_bazel_tools": ":fail_with_incompatible_use_platforms_repo_for_constraints",
- "//conditions:default": "@platforms//os:windows",
- }),
+ constraint_setting = ":os",
)
# A default platform with nothing defined.
@@ -149,19 +80,19 @@ platform(
constraint_values = [
],
cpu_constraints = [
- "@platforms//cpu:x86_32",
- "@platforms//cpu:x86_64",
- "@platforms//cpu:ppc",
- "@platforms//cpu:arm",
- "@platforms//cpu:aarch64",
- "@platforms//cpu:s390x",
+ ":x86_32",
+ ":x86_64",
+ ":ppc",
+ ":arm",
+ ":aarch64",
+ ":s390x",
],
host_platform = True,
os_constraints = [
- "@platforms//os:osx",
- "@platforms//os:freebsd",
- "@platforms//os:linux",
- "@platforms//os:windows",
+ ":osx",
+ ":freebsd",
+ ":linux",
+ ":windows",
],
)
@@ -170,18 +101,18 @@ platform(
constraint_values = [
],
cpu_constraints = [
- "@platforms//cpu:x86_32",
- "@platforms//cpu:x86_64",
- "@platforms//cpu:ppc",
- "@platforms//cpu:arm",
- "@platforms//cpu:aarch64",
- "@platforms//cpu:s390x",
+ ":x86_32",
+ ":x86_64",
+ ":ppc",
+ ":arm",
+ ":aarch64",
+ ":s390x",
],
os_constraints = [
- "@platforms//os:osx",
- "@platforms//os:freebsd",
- "@platforms//os:linux",
- "@platforms//os:windows",
+ ":osx",
+ ":freebsd",
+ ":linux",
+ ":windows",
],
target_platform = True,
)
diff --git a/tools/platforms/fail_with_incompatible_use_platforms_repo_for_constraints.bzl b/tools/platforms/fail_with_incompatible_use_platforms_repo_for_constraints.bzl
deleted file mode 100644
index 0886f459d123ea..00000000000000
--- a/tools/platforms/fail_with_incompatible_use_platforms_repo_for_constraints.bzl
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2019 The Bazel Authors. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Temporary rule that can only fail with a nice error message."""
-
-def _impl(ctx):
- fail("Constraints from @bazel_tools//platforms have been removed. " +
- "Please use constraints from @platforms repository embedded in " +
- "Bazel, or preferably declare dependency on " +
- "https://github.com/bazelbuild/platforms. See " +
- "https://github.com/bazelbuild/bazel/issues/8622 for details.")
-
-fail_with_incompatible_use_platforms_repo_for_constraints = rule(
- implementation = _impl,
-)