Skip to content

Commit

Permalink
C++: Flips incompatible_depset_for_libraries_to_link_getter
Browse files Browse the repository at this point in the history
Testing downstream works https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/994

upb breakage is unrelated. Filed https://github.com/protocolbuffers/upb/issues/174 just in case.

GH issue: bazelbuild#8118

Please do not rollback, fix is very easy following instructions in GH issue.

RELNOTES:none
PiperOrigin-RevId: 250844223
  • Loading branch information
oquenchil authored and copybara-github committed May 31, 2019
1 parent aec9f99 commit f34458b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ public class StarlarkSemanticsOptions extends OptionsBase implements Serializabl

@Option(
name = "incompatible_depset_for_libraries_to_link_getter",
defaultValue = "false",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.STARLARK_SEMANTICS,
effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS},
metadataTags = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public static Builder builderWithDefaults() {
.incompatibleStringJoinRequiresStrings(true)
.internalSkylarkFlagTestCanary(false)
.incompatibleDoNotSplitLinkingCmdline(true)
.incompatibleDepsetForLibrariesToLinkGetter(false)
.incompatibleDepsetForLibrariesToLinkGetter(true)
.build();

/** Builder for {@link StarlarkSemantics}. All fields are mandatory. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
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 @@ -1212,6 +1213,7 @@ 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 @@ -1229,8 +1231,9 @@ private void doTestCcLinkingContext(
.collect(ImmutableList.toImmutableList()))
.containsExactly("b.lds", "d.lds");
@SuppressWarnings("unchecked")
SkylarkList<LibraryToLink> librariesToLink =
(SkylarkList<LibraryToLink>) info.getValue("libraries_to_link", SkylarkList.class);
Collection<LibraryToLink> librariesToLink =
info.getValue("libraries_to_link", SkylarkNestedSet.class)
.toCollection(LibraryToLink.class);
assertThat(
librariesToLink.stream()
.filter(x -> x.getStaticLibrary() != null)
Expand Down

0 comments on commit f34458b

Please sign in to comment.