aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/create_embedded_tools.py4
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java77
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/PlatformOptions.java6
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/PlatformSemantics.java10
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/ToolchainContext.java2
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java8
-rw-r--r--src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java4
-rw-r--r--src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java27
-rw-r--r--src/test/java/com/google/devtools/build/lib/packages/util/MockPlatformSupport.java36
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java1
-rw-r--r--tools/BUILD2
-rw-r--r--tools/cpp/BUILD15
-rw-r--r--tools/cpp/BUILD.static15
-rw-r--r--tools/cpp/BUILD.tpl15
-rw-r--r--tools/cpp/cc_configure.bzl2
-rw-r--r--tools/cpp/dummy_toolchain.bzl23
-rw-r--r--tools/platforms/BUILD92
17 files changed, 48 insertions, 291 deletions
diff --git a/src/create_embedded_tools.py b/src/create_embedded_tools.py
index 668db213fe..699edd09f5 100644
--- a/src/create_embedded_tools.py
+++ b/src/create_embedded_tools.py
@@ -29,8 +29,8 @@ from src.create_embedded_tools_lib import is_executable
output_paths = [
('*tools/jdk/BUILD*', lambda x: 'tools/jdk/BUILD'),
- ('*tools/platforms/platforms.BUILD', lambda x: 'tools/platforms/BUILD'),
- ('*tools/platforms/*', lambda x: 'tools/platforms/' + os.path.basename(x)),
+ ('*tools/platforms/platforms.BUILD', lambda x: 'platforms/BUILD'),
+ ('*tools/platforms/*', lambda x: 'platforms/' + os.path.basename(x)),
('*JavaBuilder*_deploy.jar', lambda x: 'tools/jdk/' + os.path.basename(x)),
('*JacocoCoverage*_deploy.jar',
lambda x: 'tools/jdk/JacocoCoverage_deploy.jar'),
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java b/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java
index f52d66f209..817f4d163e 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java
@@ -182,60 +182,41 @@ public class BaseRuleClasses {
* Share common attributes across both base and Skylark base rules.
*/
public static RuleClass.Builder commonCoreAndSkylarkAttributes(RuleClass.Builder builder) {
- return PlatformSemantics.platformAttributes(builder)
+ return builder
// The visibility attribute is special: it is a nodep label, and loading the
// necessary package groups is handled by {@link LabelVisitor#visitTargetVisibility}.
// Package groups always have the null configuration so that they are not duplicated
// needlessly.
- .add(
- attr("visibility", NODEP_LABEL_LIST)
- .orderIndependent()
- .cfg(HOST)
- .nonconfigurable(
- "special attribute integrated more deeply into Bazel's core logic"))
- .add(
- attr("deprecation", STRING)
- .value(deprecationDefault)
- .nonconfigurable("Used in core loading phase logic with no access to configs"))
- .add(
- attr("tags", STRING_LIST)
- .orderIndependent()
- .taggable()
- .nonconfigurable("low-level attribute, used in TargetUtils without configurations"))
- .add(
- attr("generator_name", STRING)
- .undocumented("internal")
- .nonconfigurable("static structure of a rule"))
- .add(
- attr("generator_function", STRING)
- .undocumented("internal")
- .nonconfigurable("static structure of a rule"))
- .add(
- attr("generator_location", STRING)
- .undocumented("internal")
- .nonconfigurable("static structure of a rule"))
- .add(
- attr("testonly", BOOLEAN)
- .value(testonlyDefault)
- .nonconfigurable("policy decision: rules testability should be consistent"))
+ .add(attr("visibility", NODEP_LABEL_LIST).orderIndependent().cfg(HOST)
+ .nonconfigurable("special attribute integrated more deeply into Bazel's core logic"))
+ .add(attr("deprecation", STRING).value(deprecationDefault)
+ .nonconfigurable("Used in core loading phase logic with no access to configs"))
+ .add(attr("tags", STRING_LIST).orderIndependent().taggable()
+ .nonconfigurable("low-level attribute, used in TargetUtils without configurations"))
+ .add(attr("generator_name", STRING).undocumented("internal")
+ .nonconfigurable("static structure of a rule"))
+ .add(attr("generator_function", STRING).undocumented("internal")
+ .nonconfigurable("static structure of a rule"))
+ .add(attr("generator_location", STRING).undocumented("internal")
+ .nonconfigurable("static structure of a rule"))
+ .add(attr("testonly", BOOLEAN).value(testonlyDefault)
+ .nonconfigurable("policy decision: rules testability should be consistent"))
.add(attr("features", STRING_LIST).orderIndependent())
.add(attr(":action_listener", LABEL_LIST).cfg(HOST).value(ACTION_LISTENER))
- .add(
- attr(RuleClass.COMPATIBLE_ENVIRONMENT_ATTR, LABEL_LIST)
- .allowedRuleClasses(EnvironmentRule.RULE_NAME)
- .cfg(Attribute.ConfigurationTransition.HOST)
- .allowedFileTypes(FileTypeSet.NO_FILE)
- .dontCheckConstraints()
- .nonconfigurable(
- "special logic for constraints and select: see ConstraintSemantics"))
- .add(
- attr(RuleClass.RESTRICTED_ENVIRONMENT_ATTR, LABEL_LIST)
- .allowedRuleClasses(EnvironmentRule.RULE_NAME)
- .cfg(Attribute.ConfigurationTransition.HOST)
- .allowedFileTypes(FileTypeSet.NO_FILE)
- .dontCheckConstraints()
- .nonconfigurable(
- "special logic for constraints and select: see ConstraintSemantics"));
+ .add(attr(RuleClass.COMPATIBLE_ENVIRONMENT_ATTR, LABEL_LIST)
+ .allowedRuleClasses(EnvironmentRule.RULE_NAME)
+ .cfg(Attribute.ConfigurationTransition.HOST)
+ .allowedFileTypes(FileTypeSet.NO_FILE)
+ .dontCheckConstraints()
+ .nonconfigurable("special logic for constraints and select: see ConstraintSemantics")
+ )
+ .add(attr(RuleClass.RESTRICTED_ENVIRONMENT_ATTR, LABEL_LIST)
+ .allowedRuleClasses(EnvironmentRule.RULE_NAME)
+ .cfg(Attribute.ConfigurationTransition.HOST)
+ .allowedFileTypes(FileTypeSet.NO_FILE)
+ .dontCheckConstraints()
+ .nonconfigurable("special logic for constraints and select: see ConstraintSemantics")
+ );
}
public static RuleClass.Builder nameAttribute(RuleClass.Builder builder) {
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/PlatformOptions.java b/src/main/java/com/google/devtools/build/lib/analysis/PlatformOptions.java
index 3a84352105..3376e9609d 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/PlatformOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/PlatformOptions.java
@@ -36,7 +36,7 @@ public class PlatformOptions extends FragmentOptions {
@Option(
name = "experimental_host_platform",
converter = BuildConfiguration.LabelConverter.class,
- defaultValue = "@bazel_tools//tools/platforms:host_platform",
+ defaultValue = "@bazel_tools//platforms:host_platform",
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
effectTags = {OptionEffectTag.UNKNOWN},
metadataTags = {OptionMetadataTag.HIDDEN},
@@ -49,7 +49,7 @@ public class PlatformOptions extends FragmentOptions {
@Option(
name = "experimental_platforms",
converter = BuildConfiguration.LabelListConverter.class,
- defaultValue = "@bazel_tools//tools/platforms:target_platform",
+ defaultValue = "@bazel_tools//platforms:target_platform",
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
effectTags = {OptionEffectTag.UNKNOWN},
metadataTags = {OptionMetadataTag.HIDDEN},
@@ -98,8 +98,6 @@ public class PlatformOptions extends FragmentOptions {
public PlatformOptions getHost(boolean fallback) {
PlatformOptions host = (PlatformOptions) getDefault();
host.platforms = ImmutableList.of(this.hostPlatform);
- host.hostPlatform = this.hostPlatform;
- host.extraToolchains = this.extraToolchains;
return host;
}
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/PlatformSemantics.java b/src/main/java/com/google/devtools/build/lib/analysis/PlatformSemantics.java
index 45c967e551..d93c5a6dea 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/PlatformSemantics.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/PlatformSemantics.java
@@ -26,7 +26,6 @@ import com.google.devtools.build.lib.packages.AttributeMap;
import com.google.devtools.build.lib.packages.Rule;
import com.google.devtools.build.lib.packages.RuleClass;
import java.util.List;
-import javax.annotation.Nullable;
/** Helper class to manage rules' use of platforms. */
public class PlatformSemantics {
@@ -41,22 +40,19 @@ public class PlatformSemantics {
@Override
public List<Label> resolve(
Rule rule, AttributeMap attributes, BuildConfiguration configuration) {
- // rule may be null for tests
- if (rule == null || rule.getRuleClassObject().getRequiredToolchains().isEmpty()) {
- return ImmutableList.of();
+ if (rule.getRuleClassObject().getRequiredToolchains().isEmpty()) {
+ return null;
}
return configuration.getFragment(PlatformConfiguration.class).getTargetPlatforms();
}
};
/** Implementation for the :execution_platform attribute. */
- @Nullable
public static final Attribute.LateBoundLabel<BuildConfiguration> EXECUTION_PLATFORM =
new Attribute.LateBoundLabel<BuildConfiguration>(PlatformConfiguration.class) {
@Override
public Label resolve(Rule rule, AttributeMap attributes, BuildConfiguration configuration) {
- // rule may be null for tests
- if (rule == null || rule.getRuleClassObject().getRequiredToolchains().isEmpty()) {
+ if (rule.getRuleClassObject().getRequiredToolchains().isEmpty()) {
return null;
}
return configuration.getFragment(PlatformConfiguration.class).getExecutionPlatform();
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/ToolchainContext.java b/src/main/java/com/google/devtools/build/lib/analysis/ToolchainContext.java
index 16a29fd5df..9cbdd475ac 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/ToolchainContext.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/ToolchainContext.java
@@ -142,8 +142,6 @@ public class ToolchainContext {
prerequisiteMap
.keys()
.stream()
- // Keys in prerequisiteMap can be null, see {@link DependencyResolver#dependentNodeMap}.
- .filter(attribute -> attribute != null)
.filter(attribute -> attribute.getName().equals(PlatformSemantics.TOOLCHAINS_ATTR))
.findFirst();
Preconditions.checkState(
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java
index 6c8487364d..3e850d966d 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java
@@ -39,6 +39,7 @@ import com.google.devtools.build.lib.analysis.ActionsProvider;
import com.google.devtools.build.lib.analysis.BaseRuleClasses;
import com.google.devtools.build.lib.analysis.DefaultInfo;
import com.google.devtools.build.lib.analysis.OutputGroupProvider;
+import com.google.devtools.build.lib.analysis.PlatformSemantics;
import com.google.devtools.build.lib.analysis.TransitiveInfoCollection;
import com.google.devtools.build.lib.analysis.skylark.SkylarkAttr.Descriptor;
import com.google.devtools.build.lib.analysis.test.TestConfiguration;
@@ -128,9 +129,10 @@ public class SkylarkRuleClassFunctions {
/** Parent rule class for non-executable non-test Skylark rules. */
public static final RuleClass baseRule =
BaseRuleClasses.commonCoreAndSkylarkAttributes(
- BaseRuleClasses.nameAttribute(
- new RuleClass.Builder("$base_rule", RuleClassType.ABSTRACT, true))
- .add(attr("expect_failure", STRING)))
+ PlatformSemantics.platformAttributes(
+ BaseRuleClasses.nameAttribute(
+ new RuleClass.Builder("$base_rule", RuleClassType.ABSTRACT, true))
+ .add(attr("expect_failure", STRING))))
.build();
/** Parent rule class for executable non-test Skylark rules. */
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java b/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java
index 83bcdad904..183c8c05f7 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java
@@ -1238,8 +1238,8 @@ public class BuildViewTest extends BuildViewTestBase {
useConfiguration("--experimental_dynamic_configs=on");
AnalysisResult res = update("//foo:x");
ConfiguredTarget topLevelTarget = Iterables.getOnlyElement(res.getTargetsToBuild());
- assertThat(topLevelTarget.getConfiguration().getAllFragments().keySet())
- .containsExactly(ruleClassProvider.getUniversalFragment(), PlatformConfiguration.class);
+ assertThat(topLevelTarget.getConfiguration().getAllFragments().keySet()).containsExactly(
+ ruleClassProvider.getUniversalFragment());
}
@Test
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java b/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java
index 862b213eab..0defa523b1 100644
--- a/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java
+++ b/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java
@@ -77,6 +77,7 @@ public final class BazelMockCcSupport extends MockCcSupport {
config.create(
"/bazel_tools_workspace/tools/cpp/BUILD",
"package(default_visibility=['//visibility:public'])",
+ "toolchain_type(name = 'toolchain_type')",
"cc_library(name = 'stl')",
"cc_library(name = 'malloc')",
"cc_toolchain_suite(",
@@ -122,7 +123,7 @@ public final class BazelMockCcSupport extends MockCcSupport {
" linker_files = ':empty',",
" module_map = 'crosstool.cppmap', supports_header_parsing = 1,",
" objcopy_files = ':empty', static_runtime_libs = [':empty'], strip_files = ':empty',",
- ")",
+ ")",
"cc_toolchain(name = 'cc-compiler-armeabi-v7a', all_files = ':empty', ",
" compiler_files = ':empty',",
" cpu = 'local', dwp_files = ':empty', dynamic_runtime_libs = [':empty'], ",
@@ -144,27 +145,8 @@ public final class BazelMockCcSupport extends MockCcSupport {
"filegroup(",
" name = 'link_dynamic_library',",
" srcs = ['link_dynamic_library.sh'],",
- ")",
- "toolchain_type(name = 'toolchain_type')",
- "toolchain(",
- " name = 'toolchain_cc-compiler-piii',",
- " toolchain_type = ':toolchain_type',",
- " toolchain = '//third_party/crosstool/mock:cc-compiler-piii',",
- " target_compatible_with = [':mock_value'],",
- ")",
- "toolchain(",
- " name = 'dummy_cc_toolchain',",
- " toolchain_type = ':toolchain_type',",
- " toolchain = ':dummy_cc_toolchain_impl',",
- ")",
- "load(':dummy_toolchain.bzl', 'dummy_toolchain')",
- "dummy_toolchain(name = 'dummy_cc_toolchain_impl')");
- config.create(
- "/bazel_tools_workspace/tools/cpp/dummy_toolchain.bzl",
- "def _dummy_toolchain_impl(ctx):",
- " toolchain = platform_common.ToolchainInfo()",
- " return [toolchain]",
- "dummy_toolchain = rule(_dummy_toolchain_impl, attrs = {})");
+ ")");
+
config.create(
"/bazel_tools_workspace/tools/cpp/CROSSTOOL",
readCrosstoolFile());
@@ -174,7 +156,6 @@ public final class BazelMockCcSupport extends MockCcSupport {
config.create("tools/cpp/link_dynamic_library.sh", "");
}
MockObjcSupport.setup(config);
- MockPlatformSupport.setup(config, "/bazel_tools_workspace/tools/platforms");
}
@Override
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/MockPlatformSupport.java b/src/test/java/com/google/devtools/build/lib/packages/util/MockPlatformSupport.java
deleted file mode 100644
index f2d89fbbe4..0000000000
--- a/src/test/java/com/google/devtools/build/lib/packages/util/MockPlatformSupport.java
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2017 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.
-package com.google.devtools.build.lib.packages.util;
-
-import java.io.IOException;
-
-/** Mocking support for platforms and toolchains. */
-public class MockPlatformSupport {
-
- /** Adds mocks for basic host and target platform. */
- public static void setup(MockToolsConfig mockToolsConfig, String platformsPath)
- throws IOException {
- mockToolsConfig.create(
- platformsPath + "/BUILD",
- "package(default_visibility=['//visibility:public'])",
- "platform(",
- " name = 'target_platform',",
- " target_platform = True,",
- ")",
- "platform(",
- " name = 'host_platform',",
- " host_platform = True,",
- ")");
- }
-}
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java
index 2ff18b4379..2547d354f3 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java
@@ -977,7 +977,6 @@ public class CcCommonTest extends BuildViewTestCase {
BazelRuleClassProvider.BAZEL_SETUP.init(builder);
CoreRules.INSTANCE.init(builder);
BazelRuleClassProvider.CORE_WORKSPACE_RULES.init(builder);
- BazelRuleClassProvider.PLATFORM_RULES.init(builder);
BazelRuleClassProvider.GENERIC_RULES.init(builder);
BazelRuleClassProvider.CPP_RULES.init(builder);
builder.addRuleDefinition(new OnlyCppToolchainTypeRule());
diff --git a/tools/BUILD b/tools/BUILD
index 0432b126cb..61e9abc1a2 100644
--- a/tools/BUILD
+++ b/tools/BUILD
@@ -51,7 +51,7 @@ filegroup(
"//tools/jdk:package-srcs",
"//tools/jdk:srcs",
"//tools/launcher:srcs",
- "//tools/platforms:srcs",
+ "//tools/platforms:package-srcs",
"//tools/objc:srcs",
"//tools/python:srcs",
"//tools/test:srcs",
diff --git a/tools/cpp/BUILD b/tools/cpp/BUILD
index eb75333e75..1a4dc674ea 100644
--- a/tools/cpp/BUILD
+++ b/tools/cpp/BUILD
@@ -204,18 +204,3 @@ filegroup(
name = "link_dynamic_library",
srcs = ["link_dynamic_library.sh"],
)
-
-toolchain_type(name = "toolchain_type")
-
-# A dummy toolchain is necessary to satisfy toolchain resolution until platforms
-# are used in c++ by default.
-# TODO(b/64754003): Remove once platforms are used in c++ by default.
-toolchain(
- name = "dummy_cc_toolchain",
- toolchain = "dummy_cc_toolchain_impl",
- toolchain_type = ":toolchain_type",
-)
-
-load(":dummy_toolchain.bzl", "dummy_toolchain")
-
-dummy_toolchain(name = "dummy_cc_toolchain_impl")
diff --git a/tools/cpp/BUILD.static b/tools/cpp/BUILD.static
index aaadc5bad8..9ae4950d80 100644
--- a/tools/cpp/BUILD.static
+++ b/tools/cpp/BUILD.static
@@ -115,18 +115,3 @@ filegroup(
name = "link_dynamic_library",
srcs = ["link_dynamic_library.sh"],
)
-
-toolchain_type(name = "toolchain_type")
-
-# A dummy toolchain is necessary to satisfy toolchain resolution until platforms
-# are used in c++ by default.
-# TODO(b/64754003): Remove once platforms are used in c++ by default.
-toolchain(
- name = "dummy_cc_toolchain",
- toolchain = "dummy_cc_toolchain_impl",
- toolchain_type = ":toolchain_type",
-)
-
-load(":dummy_toolchain.bzl", "dummy_toolchain")
-
-dummy_toolchain(name = "dummy_cc_toolchain_impl")
diff --git a/tools/cpp/BUILD.tpl b/tools/cpp/BUILD.tpl
index 170fe3f91d..5ea5368c62 100644
--- a/tools/cpp/BUILD.tpl
+++ b/tools/cpp/BUILD.tpl
@@ -75,18 +75,3 @@ cc_toolchain(
strip_files = ":empty",
supports_param_files = 1,
)
-
-toolchain_type(name = "toolchain_type")
-
-# A dummy toolchain is necessary to satisfy toolchain resolution until platforms
-# are used in c++ by default.
-# TODO(b/64754003): Remove once platforms are used in c++ by default.
-toolchain(
- name = "dummy_cc_toolchain",
- toolchain = "dummy_cc_toolchain_impl",
- toolchain_type = ":toolchain_type",
-)
-
-load(":dummy_toolchain.bzl", "dummy_toolchain")
-
-dummy_toolchain(name = "dummy_cc_toolchain_impl")
diff --git a/tools/cpp/cc_configure.bzl b/tools/cpp/cc_configure.bzl
index 9d6d29fc82..70e2fd0ff1 100644
--- a/tools/cpp/cc_configure.bzl
+++ b/tools/cpp/cc_configure.bzl
@@ -20,8 +20,6 @@ load("@bazel_tools//tools/cpp:unix_cc_configure.bzl", "configure_unix_toolchain"
load("@bazel_tools//tools/cpp:lib_cc_configure.bzl", "get_cpu_value")
def _impl(repository_ctx):
- repository_ctx.symlink(
- Label("@bazel_tools//tools/cpp:dummy_toolchain.bzl"), "dummy_toolchain.bzl")
cpu_value = get_cpu_value(repository_ctx)
if cpu_value == "freebsd":
# This is defaulting to the static crosstool, we should eventually
diff --git a/tools/cpp/dummy_toolchain.bzl b/tools/cpp/dummy_toolchain.bzl
deleted file mode 100644
index c787f7315d..0000000000
--- a/tools/cpp/dummy_toolchain.bzl
+++ /dev/null
@@ -1,23 +0,0 @@
-# pylint: disable=g-bad-file-header
-# Copyright 2017 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.
-
-"""Skylark rule that stubs a toolchain."""
-def _dummy_toolchain_impl(ctx):
- ctx = ctx # unused argument
- toolchain = platform_common.ToolchainInfo()
- return [toolchain]
-
-dummy_toolchain = rule(_dummy_toolchain_impl, attrs = {})
-
diff --git a/tools/platforms/BUILD b/tools/platforms/BUILD
index 1b74f106eb..4e788aea2c 100644
--- a/tools/platforms/BUILD
+++ b/tools/platforms/BUILD
@@ -13,95 +13,3 @@ filegroup(
name = "srcs",
srcs = glob(["**"]),
)
-
-# These match values in //src/main/java/com/google/build/lib/util:CPU.java
-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 = "s390x",
- constraint_setting = ":cpu",
-)
-
-# These match values in //src/main/java/com/google/build/lib/util:OS.java
-constraint_setting(name = "os")
-
-constraint_value(
- name = "osx",
- constraint_setting = ":os",
-)
-
-constraint_value(
- name = "freebsd",
- constraint_setting = ":os",
-)
-
-constraint_value(
- name = "linux",
- constraint_setting = ":os",
-)
-
-constraint_value(
- name = "windows",
- constraint_setting = ":os",
-)
-
-# A default platform with nothing defined.
-platform(name = "default_platform")
-
-# A default platform referring to the host system. This only exists for
-# internal build configurations, and so shouldn't be accessed by other packages.
-platform(
- name = "host_platform",
- cpu_constraints = [
- ":x86_32",
- ":x86_64",
- ":ppc",
- ":arm",
- ":s390x",
- ],
- host_platform = True,
- os_constraints = [
- ":osx",
- ":freebsd",
- ":linux",
- ":windows",
- ],
-)
-
-platform(
- name = "target_platform",
- cpu_constraints = [
- ":x86_32",
- ":x86_64",
- ":ppc",
- ":arm",
- ":s390x",
- ],
- os_constraints = [
- ":osx",
- ":freebsd",
- ":linux",
- ":windows",
- ],
- target_platform = True,
-)