From 2e1a376f8601b40fb071fcd2f116446b104aa8e9 Mon Sep 17 00:00:00 2001 From: Luca Di Grazia Date: Sun, 4 Sep 2022 19:42:49 +0200 Subject: [PATCH] Flip --incompatible_require_ctx_in_configure_features Last run of the CI (https://buildkite.com/bazel/bazelisk-plus-incompatible-flags/builds/124) shows only Tensorflow and Envoy issues. Envoy is fixed by https://github.com/envoyproxy/envoy/pull/7058, and Tensorflow is fixed in Bazel@HEAD by https://github.com/bazelbuild/bazel/commit/cab65ff6f2a81bac81af781f77cf6c2ed023ce8f. RELNOTES: Incompatible flag `--incompatible_require_ctx_in_configure_features` has been flipped. See https://github.com/bazelbuild/bazel/issues/7793 for more information. PiperOrigin-RevId: 250458681 --- .../build/lib/rules/cpp/CppOptions.java | 17 +---------------- .../lib/rules/cpp/CcToolchainProviderTest.java | 6 ------ .../lib/rules/cpp/SkylarkCcCommonTest.java | 7 ++----- 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java b/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java index 52a0619c789..58fd83c8ef7 100644 --- a/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java +++ b/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java @@ -726,7 +726,7 @@ public Label getFdoPrefetchHintsLabel() { @Option( name = "incompatible_dont_enable_host_nonhost_crosstool_features", - defaultValue = "true", + defaultValue = "false", documentationCategory = OptionDocumentationCategory.TOOLCHAIN, effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS}, metadataTags = { @@ -864,20 +864,6 @@ public Label getFdoPrefetchHintsLabel() { help = "Save the state of enabled and requested feautres as an output of compilation.") public boolean saveFeatureState; - @Option( - name = "incompatible_use_specific_tool_files", - defaultValue = "false", - documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, - effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS}, - metadataTags = { - OptionMetadataTag.INCOMPATIBLE_CHANGE, - OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES - }, - help = - "Use cc toolchain's compiler_files, as_files, and ar_files as inputs to appropriate " - + "actions. See https://github.com/bazelbuild/bazel/issues/8531") - public boolean useSpecificToolFiles; - @Override public FragmentOptions getHost() { CppOptions host = (CppOptions) getDefault(); @@ -932,7 +918,6 @@ public FragmentOptions getHost() { host.dontEnableHostNonhost = dontEnableHostNonhost; host.requireCtxInConfigureFeatures = requireCtxInConfigureFeatures; host.useStandaloneLtoIndexingCommandLines = useStandaloneLtoIndexingCommandLines; - host.useSpecificToolFiles = useSpecificToolFiles; // Save host options for further use. host.hostCoptList = hostCoptList; diff --git a/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProviderTest.java b/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProviderTest.java index 3062a51baf4..1e3cf1d27a0 100644 --- a/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProviderTest.java +++ b/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProviderTest.java @@ -59,7 +59,6 @@ public void testSkylarkCallables() throws Exception { " sysroot = provider.sysroot,", " cpu = provider.cpu,", " ar_executable = provider.ar_executable,", - " ar_executable_call = provider.ar_executable(),", " use_pic_for_dynamic_libraries = provider.needs_pic_for_dynamic_libraries(", " feature_configuration = feature_configuration,", " ),", @@ -82,12 +81,7 @@ public void testSkylarkCallables() throws Exception { Label.parseAbsolute("//test:rule.bzl", ImmutableMap.of()), "MyInfo"); StructImpl info = (StructImpl) ct.get(key); - // Observe: provider.ar_executable == provider.ar_executable(). - // That's because ToolchainInfo has an ar_executable field in its values map, - // and a @SkylarkCallable method of that name, and x.f() calls the method - // whereas x.f retrieves the field. This inconsistency is b/145735895. assertThat((String) info.getValue("ar_executable")).endsWith("/usr/bin/mock-ar"); - assertThat((String) info.getValue("ar_executable_call")).endsWith("/usr/bin/mock-ar"); assertThat(info.getValue("cpu")).isEqualTo("k8"); diff --git a/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/rules/cpp/SkylarkCcCommonTest.java b/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/rules/cpp/SkylarkCcCommonTest.java index ced60083fa0..2a2a4eead52 100644 --- a/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/rules/cpp/SkylarkCcCommonTest.java +++ b/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/rules/cpp/SkylarkCcCommonTest.java @@ -63,7 +63,6 @@ import com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.ToolPath; import com.google.protobuf.TextFormat; import java.io.IOException; -import java.util.Collection; import java.util.List; import org.junit.Before; import org.junit.Test; @@ -1213,7 +1212,6 @@ private void doTestCcLinkingContext( List dynamicLibraryList) throws Exception { useConfiguration("--features=-supports_interface_shared_libraries"); - setSkylarkSemanticsOptions("--incompatible_depset_for_libraries_to_link_getter"); setUpCcLinkingContextTest(); ConfiguredTarget a = getConfiguredTarget("//a:a"); @@ -1231,9 +1229,8 @@ private void doTestCcLinkingContext( .collect(ImmutableList.toImmutableList())) .containsExactly("b.lds", "d.lds"); @SuppressWarnings("unchecked") - Collection librariesToLink = - info.getValue("libraries_to_link", SkylarkNestedSet.class) - .toCollection(LibraryToLink.class); + SkylarkList librariesToLink = + (SkylarkList) info.getValue("libraries_to_link", SkylarkList.class); assertThat( librariesToLink.stream() .filter(x -> x.getStaticLibrary() != null)