Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -no_deduplicate for darwin dbg/fastbuild #15635

Conversation

keith
Copy link
Member

@keith keith commented Jun 7, 2022

The -no_deduplicate linker flag saves some time for debug builds at the
cost of binary size. In testing envoy the difference was 50s -> 9s to
link a debug build with this flag enabled. This change enables it as a
separate feature so it can be opted out of by users if needed, and
leaves the default for opt to get this optimization for release builds.

Fixes #10910

The -no_deduplicate linker flag saves some time for debug builds at the
cost of binary size. In testing envoy the difference was 50s -> 9s to
link a debug build with this flag enabled. This change enables it as a
separate feature so it can be opted out of by users if needed, and
leaves the default for opt to get this optimization for release builds.

Fixes bazelbuild#10910
@sgowroji sgowroji added team-Rules-CPP Issues for C++ rules awaiting-review PR is awaiting review from an assigned reviewer labels Jun 8, 2022
@keith
Copy link
Member Author

keith commented Sep 13, 2022

@sgowroji bump

@oquenchil oquenchil requested review from googlewalt and removed request for oquenchil September 16, 2022 12:45
@googlewalt
Copy link
Contributor

FYI I made a couple of NFCs to the PR, to be more consistent with our internal toolchain.

@keith keith deleted the ks/add-no_deduplicate-for-darwin-dbg-fastbuild branch September 20, 2022 17:40
aiuto pushed a commit to aiuto/bazel that referenced this pull request Oct 12, 2022
The -no_deduplicate linker flag saves some time for debug builds at the
cost of binary size. In testing envoy the difference was 50s -> 9s to
link a debug build with this flag enabled. This change enables it as a
separate feature so it can be opted out of by users if needed, and
leaves the default for opt to get this optimization for release builds.

Fixes bazelbuild#10910

Closes bazelbuild#15635.

PiperOrigin-RevId: 475592901
Change-Id: I8746ffa9492ebffed52dd680c3dd4e0283772447
@jwnimmer-tri
Copy link
Contributor

If I'm reading correctly, this change was first released in bazel 6.0.0? I don't see it mentioned in the release notes, though.

This caused a 9% increase in our build farm disk use, which was severe enough that we needed to opt-out of this feature. For that reason, I think it might be worth adding this to the release notes retroactively, so that it's easier for others to discover what might have changed to cause the bloat they're seeing when they upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review PR is awaiting review from an assigned reviewer team-Rules-CPP Issues for C++ rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add -no_deduplicate to crosstool for ld64 flags for dbg/fastbuild builds
5 participants