Skip to content

Commit

Permalink
Flip --incompatible_require_ctx_in_configure_features
Browse files Browse the repository at this point in the history
    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 envoyproxy/envoy#7058, and Tensorflow is fixed in Bazel@HEAD by bazelbuild/bazel@cab65ff.

    RELNOTES: Incompatible flag `--incompatible_require_ctx_in_configure_features` has been flipped. See bazelbuild/bazel#7793 for more information.
    PiperOrigin-RevId: 250458681
  • Loading branch information
Luca Di Grazia committed Sep 4, 2022
1 parent e3454be commit 2e1a376
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,",
" ),",
Expand All @@ -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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1213,7 +1212,6 @@ private void doTestCcLinkingContext(
List<String> dynamicLibraryList)
throws Exception {
useConfiguration("--features=-supports_interface_shared_libraries");
setSkylarkSemanticsOptions("--incompatible_depset_for_libraries_to_link_getter");
setUpCcLinkingContextTest();
ConfiguredTarget a = getConfiguredTarget("//a:a");

Expand All @@ -1231,9 +1229,8 @@ private void doTestCcLinkingContext(
.collect(ImmutableList.toImmutableList()))
.containsExactly("b.lds", "d.lds");
@SuppressWarnings("unchecked")
Collection<LibraryToLink> librariesToLink =
info.getValue("libraries_to_link", SkylarkNestedSet.class)
.toCollection(LibraryToLink.class);
SkylarkList<LibraryToLink> librariesToLink =
(SkylarkList<LibraryToLink>) info.getValue("libraries_to_link", SkylarkList.class);
assertThat(
librariesToLink.stream()
.filter(x -> x.getStaticLibrary() != null)
Expand Down

0 comments on commit 2e1a376

Please sign in to comment.