Closed Bug 1557785 Opened 6 months ago Closed 6 months ago

Switch Windows PGO builds to the 3-tier model

Categories

(Firefox Build System :: Task Configuration, task)

task
Not set

Tracking

(firefox69 fixed)

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: mshal, Assigned: mshal)

References

Details

Attachments

(9 files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

Linux and Android PGO builds both use the 3-tier model, but Windows still uses the old 1-tier model. We should switch Windows over as well so that all PGO builds use the same PGO logic.

Blocks: 1557788

The run-profileserver.sh script is a bridge between the Taskcluster task
and profileserver.py. It was originally written as a Linux-only script,
but with a few modifications it can support Windows as well. The xvfb
support needs to be optional, and the UPLOAD_PATH and PGO_RUNDIR
variables must not assume a Linux filesystem.

Depends on D34795

MOZ_PGO_PROFILE_USE is set when the use-pgo attribute is defined in the
task. This environment variable is used to enable --enable-profile-use
and related configure flags.

Depends on D34797

Windows finds llvm-profdata in the PATH, in contrast to Linux or Android
builds that set LLVM_PROFDATA as an environment variable in mozconfigs.
The pgo_profile_path() configure checks should still work in this case.

Depends on D34798

With clang-cl and PGO enabled, toolchain.configure automatically turns
on LTO for compatibility with MSVC. However, MOZ_PGO is set for both the
profile-generate and profile-use builds, but we only want LTO enabled
for the profile-use build. We can check for --enable-profile-use
explicitly and to avoid setting LTO on profile-generate.

Depends on D34799

Our version of mozmake in Windows has issues with how it shells out to
commands that are prefixed with environment variable settings. For
example, "FOO=bar $(PYTHON) script.py" behaves differently than
"$(PYTHON) script.py". In this case, packager.py is called with
JARLOG_FILE_AB_CD as a command-line argument, which gets processed
differently without the environment variable prefix. With a prefix, a
backslash gets slurped, so Z:\task/foo becomes Z:task/foo, and python
fails to open the file.

The backslash comes from the WORKSPACE variable in Taskcluster, which is
used in many places, so it seems prudent here to simply escape the
backslash as a workaround for the issue. Other possible fixes are: 1)
Convert the NO_PKG_FILES environment variable to a command-line
argument, 2) Upgrade mozmake to a newer version that fixes the shell
issues, or 3) Change WORKSPACE to use forward-slashes, and work around
any potential issues with that.

Depends on D34800

Windows 1-tier PGO builds only partially clobber between the
profile-generate and profile-use stages, so that exports/installed files
don't have to be reprocessed. Unfortunately we can't skip the install
manifests in 3-tier PGO because the profile-generate build happens on a
different machine, so we have to differentiate between 1-tier and 3-tier
PGO builds. A new variable, MOZ_1TIER_PGO, is used for this purpose.

Eventually this logic can be cleaned up in bug 1557788 once all PGO
builds use the 3-tier model.

Depends on D34801

Attachment #9071761 - Attachment description: Bug 1557785 - Fix automatic setting of LTO with clang-cl; r?dmajor → Bug 1557785 - Don't default to LTO on Windows PGO; r?dmajor
Attachment #9071761 - Attachment description: Bug 1557785 - Don't default to LTO on Windows PGO; r?dmajor → Bug 1557785 - Fix automatic setting of LTO with clang-cl; r?dmajor
Attachment #9071762 - Attachment description: Bug 1557785 - Escape backslashes in JARLOG_FILE_AB_CD for Windows; r?#firefox-build-system-reviewers → Bug 1557785 - Switch backslashes to forward-slashes in JARLOG_FILE_AB_CD for Windows; r?#firefox-build-system-reviewers
Attachment #9071762 - Attachment description: Bug 1557785 - Switch backslashes to forward-slashes in JARLOG_FILE_AB_CD for Windows; r?#firefox-build-system-reviewers → Bug 1557785 - Switch backslashes to forward-slashes in JARLOG_FILE_AB_CD for Windows; r?glandium
Blocks: 1561144
Blocks: 1561146
Pushed by mshal@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1bc6ee0c6672
Add win64 PGO-instrumented task; r=tomprince
https://hg.mozilla.org/integration/autoland/rev/2989571031f9
Update run-profileserver.sh for Windows compatibility; r=firefox-build-system-reviewers,chmanchester
https://hg.mozilla.org/integration/autoland/rev/516aa5eb9732
Add Windows generate profile task; r=tomprince
https://hg.mozilla.org/integration/autoland/rev/0b6522f13bcf
Hook MOZ_PGO_PROFILE_USE environment variable into common Windows mozconfig; r=firefox-build-system-reviewers,chmanchester
https://hg.mozilla.org/integration/autoland/rev/3430c89be449
Allow LLVM_PROFDATA to work even if not explicitly set in the environment; r=firefox-build-system-reviewers,chmanchester
https://hg.mozilla.org/integration/autoland/rev/b5c65f2ea1ac
Fix automatic setting of LTO with clang-cl; r=dmajor
https://hg.mozilla.org/integration/autoland/rev/861e83cc1b9b
Switch backslashes to forward-slashes in JARLOG_FILE_AB_CD for Windows; r=glandium
https://hg.mozilla.org/integration/autoland/rev/91b34c90d2a9
Process install manifests in 3-tier Windows builds; r=firefox-build-system-reviewers,chmanchester
https://hg.mozilla.org/integration/autoland/rev/a91cc939f112
Enable 3-tier PGO on Windows builds; r=tomprince
Regressions: 1562725

== Change summary for alert #21604 (as of Wed, 26 Jun 2019 13:00:38 GMT) ==

Improvements:

3% raptor-speedometer-firefox windows10-64-shippable-qr opt 82.81 -> 85.22
2% raptor-speedometer-firefox windows10-64-shippable opt 82.50 -> 84.43

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

== Change summary for alert #21601 (as of Wed, 26 Jun 2019 08:22:19 GMT) ==

Improvements:

40% build times windows2012-64-shippable opt nightly taskcluster-c5.4xlarge 5,335.07 -> 3,182.93

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

Regressions: 1570619
You need to log in before you can comment on or make changes to this bug.