From ba258e8296ff7a110b32586a83ef9534f8e83d0e Mon Sep 17 00:00:00 2001 From: plf Date: Wed, 24 Mar 2021 02:06:12 -0700 Subject: [PATCH] Remove code for experimental_cc_skylark_api_enabled_packages This flag is not checked anywhere anymore. RELNOTES:none PiperOrigin-RevId: 364752652 --- .../lib/bazel/rules/cpp/BazelCcModule.java | 2 -- .../semantics/BuildLanguageOptions.java | 8 +------ .../packages/semantics/ConsistencyTest.java | 8 ------- .../google/devtools/build/lib/rules/cpp/BUILD | 8 ------- .../cpp/CcImportBaseConfiguredTargetTest.java | 1 - .../lib/rules/cpp/StarlarkCcCommonTest.java | 5 +---- .../rules/cpp/StarlarkCcCommonTestHelper.java | 22 ------------------- 7 files changed, 2 insertions(+), 52 deletions(-) delete mode 100644 src/test/java/com/google/devtools/build/lib/rules/cpp/StarlarkCcCommonTestHelper.java diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcModule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcModule.java index 91b20892f256aa..dd51f0ba7ba817 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcModule.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcModule.java @@ -46,8 +46,6 @@ /** * A module that contains Starlark utilities for C++ support. * - *

This is a work in progress. The API is guarded behind - * --experimental_cc_skylark_api_enabled_packages. The API is under development and unstable. */ public class BazelCcModule extends CcModule implements BazelCcModuleApi< diff --git a/src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java b/src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java index 8941b1ad45b706..716926711c60bb 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java +++ b/src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java @@ -126,6 +126,7 @@ public class BuildLanguageOptions extends OptionsBase implements Serializable { + " key.") public List experimentalBuiltinsInjectionOverride; + @Option( name = "experimental_cc_skylark_api_enabled_packages", converter = CommaSeparatedOptionListConverter.class, @@ -644,9 +645,6 @@ public StarlarkSemantics toStarlarkSemantics() { .set(EXPERIMENTAL_BUILTINS_BZL_PATH, experimentalBuiltinsBzlPath) .setBool(EXPERIMENTAL_BUILTINS_DUMMY, experimentalBuiltinsDummy) .set(EXPERIMENTAL_BUILTINS_INJECTION_OVERRIDE, experimentalBuiltinsInjectionOverride) - .set( - EXPERIMENTAL_CC_STARLARK_API_ENABLED_PACKAGES, - ImmutableList.copyOf(experimentalCcStarlarkApiEnabledPackages)) .setBool( EXPERIMENTAL_ENABLE_ANDROID_MIGRATION_APIS, experimentalEnableAndroidMigrationApis) .setBool(EXPERIMENTAL_GOOGLE_LEGACY_API, experimentalGoogleLegacyApi) @@ -776,10 +774,6 @@ public StarlarkSemantics toStarlarkSemantics() { new StarlarkSemantics.Key<>("experimental_builtins_bzl_path", ""); public static final StarlarkSemantics.Key> EXPERIMENTAL_BUILTINS_INJECTION_OVERRIDE = new StarlarkSemantics.Key<>("experimental_builtins_injection_override", ImmutableList.of()); - public static final StarlarkSemantics.Key> - EXPERIMENTAL_CC_STARLARK_API_ENABLED_PACKAGES = - new StarlarkSemantics.Key<>( - "experimental_cc_starlark_api_enabled_packages", ImmutableList.of()); public static final StarlarkSemantics.Key MAX_COMPUTATION_STEPS = new StarlarkSemantics.Key<>("max_computation_steps", 0L); public static final StarlarkSemantics.Key NESTED_SET_DEPTH_LIMIT = diff --git a/src/test/java/com/google/devtools/build/lib/packages/semantics/ConsistencyTest.java b/src/test/java/com/google/devtools/build/lib/packages/semantics/ConsistencyTest.java index 79124ce7a73e12..7f79eb380c7031 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/semantics/ConsistencyTest.java +++ b/src/test/java/com/google/devtools/build/lib/packages/semantics/ConsistencyTest.java @@ -17,7 +17,6 @@ import static com.google.common.truth.Truth.assertThat; -import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.devtools.build.lib.skyframe.serialization.DeserializationContext; import com.google.devtools.build.lib.skyframe.serialization.DynamicCodec; @@ -121,10 +120,6 @@ private static BuildLanguageOptions buildRandomOptions(Random rand) throws Excep "--experimental_sibling_repository_layout=" + rand.nextBoolean(), "--experimental_builtins_bzl_path=" + rand.nextDouble(), "--experimental_builtins_dummy=" + rand.nextBoolean(), - "--experimental_cc_skylark_api_enabled_packages=" - + rand.nextDouble() - + "," - + rand.nextDouble(), "--experimental_enable_android_migration_apis=" + rand.nextBoolean(), "--experimental_google_legacy_api=" + rand.nextBoolean(), "--experimental_ninja_actions=" + rand.nextBoolean(), @@ -170,9 +165,6 @@ private static StarlarkSemantics buildRandomSemantics(Random rand) { .setBool(BuildLanguageOptions.EXPERIMENTAL_SIBLING_REPOSITORY_LAYOUT, rand.nextBoolean()) .set(BuildLanguageOptions.EXPERIMENTAL_BUILTINS_BZL_PATH, String.valueOf(rand.nextDouble())) .setBool(BuildLanguageOptions.EXPERIMENTAL_BUILTINS_DUMMY, rand.nextBoolean()) - .set( - BuildLanguageOptions.EXPERIMENTAL_CC_STARLARK_API_ENABLED_PACKAGES, - ImmutableList.of(String.valueOf(rand.nextDouble()), String.valueOf(rand.nextDouble()))) .setBool( BuildLanguageOptions.EXPERIMENTAL_ENABLE_ANDROID_MIGRATION_APIS, rand.nextBoolean()) .setBool(BuildLanguageOptions.EXPERIMENTAL_GOOGLE_LEGACY_API, rand.nextBoolean()) diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/BUILD b/src/test/java/com/google/devtools/build/lib/rules/cpp/BUILD index 7ff9a85a5643cc..2b9b8c08de7bcc 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/BUILD +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/BUILD @@ -63,8 +63,6 @@ java_library( name = "CcImportBaseConfiguredTargetTest", srcs = ["CcImportBaseConfiguredTargetTest.java"], deps = [ - ":StarlarkCcCommonTestHelper", - "//src/main/java/com/google/devtools/build/lib/actions", "//src/main/java/com/google/devtools/build/lib/actions:artifacts", "//src/main/java/com/google/devtools/build/lib/analysis:configured_target", "//src/main/java/com/google/devtools/build/lib/collect/nestedset", @@ -77,11 +75,6 @@ java_library( ], ) -java_library( - name = "StarlarkCcCommonTestHelper", - srcs = ["StarlarkCcCommonTestHelper.java"], -) - java_test( name = "CcBadDependenciesTest", srcs = ["CcBadDependenciesTest.java"], @@ -661,7 +654,6 @@ java_test( srcs = ["StarlarkCcCommonTest.java"], shard_count = 4, deps = [ - ":StarlarkCcCommonTestHelper", "//src/main/java/com/google/devtools/build/lib/actions:artifacts", "//src/main/java/com/google/devtools/build/lib/actions:commandline_item", "//src/main/java/com/google/devtools/build/lib/analysis:analysis_cluster", diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcImportBaseConfiguredTargetTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcImportBaseConfiguredTargetTest.java index d6031230624dee..0204434110d720 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcImportBaseConfiguredTargetTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcImportBaseConfiguredTargetTest.java @@ -36,7 +36,6 @@ public abstract class CcImportBaseConfiguredTargetTest extends BuildViewTestCase @Before public void setStarlarkImplementationLoadStatement() throws Exception { - setBuildLanguageOptions(StarlarkCcCommonTestHelper.CC_STARLARK_WHITELIST_FLAG); invalidatePackages(); setIsStarlarkImplementation(); } diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/StarlarkCcCommonTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/StarlarkCcCommonTest.java index 56652986cf46f3..8745eee369d2ae 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/StarlarkCcCommonTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/StarlarkCcCommonTest.java @@ -84,10 +84,7 @@ public class StarlarkCcCommonTest extends BuildViewTestCase { @Before - public void setBuildLanguageOptions() throws Exception { - this.setBuildLanguageOptions(StarlarkCcCommonTestHelper.CC_STARLARK_WHITELIST_FLAG); - invalidatePackages(); - + public void setUp() throws Exception { scratch.file("myinfo/myinfo.bzl", "MyInfo = provider()"); scratch.file("myinfo/BUILD"); diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/StarlarkCcCommonTestHelper.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/StarlarkCcCommonTestHelper.java deleted file mode 100644 index 0eab05608d96c1..00000000000000 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/StarlarkCcCommonTestHelper.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2018 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.rules.cpp; - -/** Methods useful for tests testing the C++ Starlark API. */ -public final class StarlarkCcCommonTestHelper { - public static final String CC_STARLARK_WHITELIST_FLAG = - "--experimental_cc_skylark_api_enabled_packages=tools/build_defs,experimental"; - - private StarlarkCcCommonTestHelper() {} -}