Closed Bug 1654465 Opened 4 years ago Closed 4 years ago

7.57 - 9.16% build times (linux64-shippable, osx-shippable) regression on pushrange 034864174a - bb79da633a (Mon July 20 2020)

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(firefox-esr68 fixed, firefox-esr78 fixed, firefox78 unaffected, firefox79 unaffected, firefox80 fixed, firefox81 fixed)

RESOLVED FIXED
81 Branch
Tracking Status
firefox-esr68 --- fixed
firefox-esr78 --- fixed
firefox78 --- unaffected
firefox79 --- unaffected
firefox80 --- fixed
firefox81 --- fixed

People

(Reporter: alexandrui, Assigned: glandium)

References

(Regression)

Details

(Keywords: perf-alert, regression)

Attachments

(2 files)

Perfherder has detected a build_metrics performance regression from push range 034864174a6f8d7f7042e0e4b42abf8201e4c1c8 - bb79da633a2efe12f7a0a6e89d925961b8b444a7. As author of one of the patches included in that push, we need your help to address this regression.

Regressions:

9% build times linux64-shippable opt nightly taskcluster-c5d.4xlarge 2,725.86 -> 2,975.56
9% build times osx-shippable opt nightly taskcluster-c5d.4xlarge 2,716.07 -> 2,958.21
8% build times osx-shippable opt nightly taskcluster-m5.4xlarge 2,877.22 -> 3,094.93

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests. Please follow our guide to handling regression bugs and let us know your plans within 3 business days, or the offending patch(es) will be backed out in accordance with our regression policy.

For more information on performance sheriffing please see our FAQ.

Component: Performance → General
Product: Testing → Firefox Build System
Summary: 7.57 - 9.16% build times (linux64-shippable, osx-shippable) regression on push 034864174a6f8d7f7042e0e4b42abf8201e4c1c8 (Mon July 20 2020) → 7.57 - 9.16% build times (linux64-shippable, osx-shippable) regression on pushrange 034864174a - bb79da633a (Mon July 20 2020)
Flags: needinfo?(rstewart)

It's due to -C lto now being passed to rustc for at least http3server, which was not the case before.

Assignee: nobody → mh+mozilla
Flags: needinfo?(rstewart)
Flags: needinfo?(mh+mozilla)

And other more annoying things that also lead to bug 1654458

It turns out setting CARGO_PROFILE_RELEASE_LTO has unwanted side
effects.

First it's not actually strictly equivalent to using cargo rustc -- -Clto. For instance, it apparently also enables cross-language LTO in
newer versions of cargo.

Second, it changes the rust computed hash for all the dependencies of
the crate being built with the variable set, which makes them diverge
from when the same dependencies are built through another crate in the
tree that is not LTOed. This effectively makes us build a lot of
crates twice, many of which are not cacheable.

Since the original problem is that cargo >= 1.45 passes extra flags (-C embed-bitcode=no) to rustc that are incompatible with -Clto, and while
it knows to adjust based on the lto setting in the build profile
(which CARGO_PROFILE_RELEASE_LTO overrides the default of), cargo
ignores flags passed via cargo rustc -- ... when making those
adjustments.

So, we need to override with -C embed-bitcode=yes on our own at the
same time we pass -Clto. But doing that through cargo rustc -- ...
is not enough because all the dependencies of the crate built with
-Clto need to be built with -C embed-bitcode=yes. So we need to
override with RUSTFLAGS, which will affect all the dependencies.
But we also need to do this consistently across all crates, not only the
dependencies of crates built with -Clto, otherwise we'd still end up
building crates twice (once with and once without the override).

Unfortunately, the -C embed-bitcode=* flag is also not supported in
versions older than 1.45, so we have to avoid adding it on older
versions.

We unfortunately support a large range of versions of rustc (albeit only
for tools/crashreporter), but we actually need to upgrade the smaller
supported version because rustc < 1.38 doesn't support our top-level
Cargo.lock. This makes the version check slightly less awful.

Has Regression Range: --- → yes
Blocks: 1617782
No longer blocks: 1617782
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/e5d2a6d5187b Set -Cembed-bitcode=yes instead of CARGO_PROFILE_RELEASE_LTO. r=firefox-build-system-reviewers,rstewart
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch

Comment on attachment 9165606 [details]
Bug 1654465 - Set -Cembed-bitcode=yes instead of CARGO_PROFILE_RELEASE_LTO.

Beta/Release Uplift Approval Request

  • User impact if declined: Slower builds after bug 1640982
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The patch reverts a "small" side effect of bug 1640982 that increased build times, and adds something that has no effect on mozilla CI builds because it only applies on newer versions of the rust compiler we're not using yet.
  • String changes made/needed:

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: See Beta/Release uplift approval request
  • User impact if declined:
  • Fix Landed on Version:
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky):
  • String or UUID changes made by this patch:
Attachment #9165606 - Flags: approval-mozilla-release?
Attachment #9165606 - Flags: approval-mozilla-esr78?
Attachment #9165606 - Flags: approval-mozilla-esr68?
Attachment #9165606 - Flags: approval-mozilla-beta?

Comment on attachment 9165606 [details]
Bug 1654465 - Set -Cembed-bitcode=yes instead of CARGO_PROFILE_RELEASE_LTO.

approved for 80.0b2

Attachment #9165606 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

== Change summary for alert #26621 (as of Wed, 29 Jul 2020 17:10:55 GMT) ==

Improvements:

18% build times linux64 debug base-toolchains-clang taskcluster-m5.4xlarge 1,959.48 -> 1,598.27
13% build times linux64-shippable opt nightly taskcluster-c5.4xlarge 2,995.51 -> 2,613.45
12% build times linux64-shippable opt nightly taskcluster-m5.4xlarge 3,021.78 -> 2,644.77
12% build times osx-shippable opt nightly taskcluster-m5.4xlarge 2,995.90 -> 2,630.89
11% build times linux64-shippable opt nightly taskcluster-c5d.4xlarge 2,803.46 -> 2,483.17
11% build times osx-shippable opt nightly taskcluster-c5.4xlarge 2,972.54 -> 2,639.70
11% build times osx-shippable opt nightly taskcluster-c5d.4xlarge 2,814.39 -> 2,513.19
9% build times linux64 debug base-toolchains-clang taskcluster-c5d.4xlarge 1,625.79 -> 1,481.19

For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=26621

Comment on attachment 9165606 [details]
Bug 1654465 - Set -Cembed-bitcode=yes instead of CARGO_PROFILE_RELEASE_LTO.

Approved for 78.2esr and 68.12esr.

Attachment #9165606 - Flags: approval-mozilla-esr78?
Attachment #9165606 - Flags: approval-mozilla-esr78+
Attachment #9165606 - Flags: approval-mozilla-esr68?
Attachment #9165606 - Flags: approval-mozilla-esr68+

Comment on attachment 9165606 [details]
Bug 1654465 - Set -Cembed-bitcode=yes instead of CARGO_PROFILE_RELEASE_LTO.

This needs a rebased patch for ESR68.

Flags: needinfo?(mh+mozilla)
Attachment #9165606 - Flags: approval-mozilla-esr68+

The backport for esr68 requires more version exclusions.

Flags: needinfo?(mh+mozilla)

(In reply to Ryan VanderMeulen [:RyanVM] from comment #13)

Comment on attachment 9165606 [details]
Bug 1654465 - Set -Cembed-bitcode=yes instead of CARGO_PROFILE_RELEASE_LTO.

This needs a rebased patch for ESR68.

https://phabricator.services.mozilla.com/D85788 is the version for ESR68.

Flags: needinfo?(ryanvm)

Comment on attachment 9167748 [details]
Bug 1654465 - Set -Cembed-bitcode=yes instead of CARGO_PROFILE_RELEASE_LTO.

Carrying over previous esr68 approval.

Flags: needinfo?(ryanvm)
Attachment #9167748 - Flags: approval-mozilla-esr68+

Comment on attachment 9165606 [details]
Bug 1654465 - Set -Cembed-bitcode=yes instead of CARGO_PROFILE_RELEASE_LTO.

bug 1640982 wasn't uplifted to 79

Attachment #9165606 - Flags: approval-mozilla-release? → approval-mozilla-release-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: