Skip to content

Commit

Permalink
C++: Flips --incompatible_do_not_split_linking_cmdline
Browse files Browse the repository at this point in the history
GH issue: bazelbuild#7687

The flag is now true by default in Bazel.

Tested:
https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/996

Envoy is showing up as broken. Udp breakage is due to a different reason.

The Remote Execution is also fine to break with this change according to buchgr@. That project is using an old version of the default crosstool which still patches features from Bazel.

For Envoy I filed envoyproxy/envoy#6968, suggested a fix and they will fix it soonish. If they don't, please disable Envoy downstream or I might miss the 0.27 cut.

RELNOTES:
PiperOrigin-RevId: 250252235
  • Loading branch information
oquenchil authored and irengrig committed Jul 15, 2019
1 parent cab8bf1 commit 05553fb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ public class StarlarkSemanticsOptions extends OptionsBase implements Serializabl

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1171,40 +1171,4 @@ public void testSplitExecutableLinkCommandDynamicWithNoSplitting() throws Except
"--sysroot=/usr/grte/v1")
.inOrder();
}

@Test
@Deprecated
// TODO(b/113358321): Remove once #7670 is finished.
public void testSplitExecutableLinkCommandDynamicWithSplitting() throws Exception {
RuleContext ruleContext = createDummyRuleContext();

FeatureConfiguration featureConfiguration = getMockFeatureConfiguration();

CppLinkAction linkAction =
createLinkBuilder(
ruleContext,
LinkTargetType.DYNAMIC_LIBRARY,
"dummyRuleContext/out.so",
ImmutableList.of(),
ImmutableList.of(),
featureConfiguration)
.setLibraryIdentifier("library")
.build();
Pair<List<String>, List<String>> result = linkAction.getLinkCommandLine().splitCommandline();

assertThat(
result.first.stream()
.map(x -> removeOutDirectory(x))
.collect(ImmutableList.toImmutableList()))
.containsExactly(
"crosstool/gcc_tool",
"-shared",
"-o",
"/k8-fastbuild/bin/dummyRuleContext/out.so",
"-Wl,-S",
"--sysroot=/usr/grte/v1",
"@/k8-fastbuild/bin/dummyRuleContext/out.so-2.params")
.inOrder();
assertThat(result.second).isEmpty();
}
}
4 changes: 3 additions & 1 deletion src/test/py/bazel/bazel_windows_cpp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,9 @@ def testWinDefFileAttribute(self):
# Test specifying DEF file in cc_binary
exit_code, _, stderr = self.RunBazel(['build', '//:lib_dy.dll', '-s'])
self.AssertExitCode(exit_code, 0, stderr)
self.assertIn('/DEF:my_lib.def', ''.join(stderr))
filepath = bazel_bin + '/lib_dy.dll-2.params'
with open(filepath, 'r', encoding='latin-1') as param_file:
self.assertIn('/DEF:my_lib.def', param_file.read())

def testCcImportRule(self):
self.ScratchFile('WORKSPACE')
Expand Down

0 comments on commit 05553fb

Please sign in to comment.