Missing dependency information prevents parallelized building of NSS
Categories
(NSS :: Build, defect, P3)
Tracking
(Not tracked)
People
(Reporter: georg.schwarz, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: helpwanted)
Attachments
(12 files, 6 obsolete files)
484 bytes,
patch
|
Details | Diff | Splinter Review | |
588 bytes,
patch
|
Details | Diff | Splinter Review | |
196 bytes,
patch
|
Details | Diff | Splinter Review | |
5.02 KB,
patch
|
Details | Diff | Splinter 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 |
Comment 1•20 years ago
|
||
Updated•19 years ago
|
Updated•18 years ago
|
Updated•13 years ago
|
Comment 3•13 years ago
|
||
Comment 4•13 years ago
|
||
Comment 5•13 years ago
|
||
Comment 6•13 years ago
|
||
Comment 7•13 years ago
|
||
Comment 8•13 years ago
|
||
Comment 9•13 years ago
|
||
Comment 10•13 years ago
|
||
Comment 11•13 years ago
|
||
Comment 12•13 years ago
|
||
Comment 13•13 years ago
|
||
Comment 14•5 years ago
|
||
If these files exist and aren't directories, there might be other
problems. Trying to fix them just will break the build.
Comment 15•5 years ago
|
||
Depends on D68692
Comment 16•5 years ago
|
||
This way we can separate shared and static build much easier.
And IMPORT_LIB_SUFFIX if now really a WIN32 platform specific.
Comment 17•5 years ago
|
||
I have no real clue, why PROGRAMS is actually working in the
sequence build. There is no special make code really handling it,
except for the install target.
This patches code is inspired by the $(eval ...) example in the
GNU make documentation. It generates a program specific make
target and maps the programs objects based on the defined
variables.
Depends on D69015
Comment 18•5 years ago
|
||
Stuff actually depends on the generated target to be copied into
the dist/ directory. And order-depend on the SOURCE_* directories,
so they are created before any copy attempts.
Depends on D69016
Comment 19•5 years ago
|
||
If these files exist and aren't directories, there might be other
problems. Trying to "fix" them by removing will break the build.
Depends on D69017
Comment 20•5 years ago
|
||
This still serializes many targets, but at least these targets
themself run their build in parallel. The main serialization
happens in nss/Makefile and nss/coreconf/rules.mk's all target.
We can't add these as real dependencies, as all Makefile snippets
use the same variable names. I tried to always run sub-makes to
hack in the depndencies, but these don't know of each other, so
targets very often run twice, and this breaks the build.
Having a tests:: target and a tests directory leads to misery (and
doesn't work), so it's renamed to check.
Depends on D69018
Comment 21•5 years ago
|
||
Copying private headers is now simply included in the exports
target, as these headers use an extra directory anyway.
Depends on D69019
Comment 22•5 years ago
|
||
Gets rid of a lot of duplicate Makefile code.
Depends on D69021
Comment 23•5 years ago
|
||
Double-colon rule behaviour isn't really compatible with parallel
build. This gets rid of all of them, so we can codify the
directory dependencies.
This leaves just three problems, which aren't really fixable with
the current build system without completely replacing it:
- everything depends on nsinstall
- everything depends on installed headers
- ckfw child directories depend on the build parent libs
This is handled by the prepare_build target.
Overall this allows most if the build to run in parallel.
Depends on D69022
Updated•5 years ago
|
Comment 24•5 years ago
|
||
In my build none of the dlls have the "32" included in their name.
Comment 25•5 years ago
|
||
Bob,
I've done a first pass through these patches but still need to rekindle my Make-fu. In the meantime, could you suggest someone at RH to add as a reviewer for these Makefile changes, too? They look to be quite valuable! Thanks!
Comment 26•5 years ago
|
||
either Daiki or I would be fine. You can add me if you want. (serves me right for passing on a gmake patch review to you yesterday).
bob
Comment 27•5 years ago
|
||
- Drop "32" default DLL suffix
- Generalize resource file handling
- Generate IMPORT_LIBRARY based on IMPORT_LIB_SUFFIX
Comment 28•5 years ago
|
||
I just realized, that all the patches from Phabricator are mirrored in Bugzilla and there are some additional comments. Maybe I should have added the following info here, before I starting submitting my patches.
My main motivation for these patches is making the LibreOffice Windows CI builds a few minutes faster, because they have to run the NSS build with -j1, even if the CI VM has a multitude of CPUs / cores. For Linux and Mac it's a smaller problem, as these platforms use ccache normally, but the first build is still slow.
FWIW: the original work was done in https://gerrit.libreoffice.org/c/core/+/74751 and there even was my - also reverted - predecessor in https://gerrit.libreoffice.org/c/core/+/62011
LO tested gyp + ninja last month (some info in https://lists.freedesktop.org/archives/libreoffice/2020-February/084461.html), but had too many different failures on Windows, so that change was reverted in general after a week of fixes in https://gerrit.libreoffice.org/c/core/+/91199.
I didn't look into this in detail, but AFAIK we had some problems with crashing python binaries for Win32 builds, rpath problems, utf-8 encoding, etc.
And there are a few more NSS build patches in https://git.libreoffice.org/core/+/refs/heads/master/external/nss/, but I guess most are a result of the way LO builds NSS on all the different platforms.
Updated•5 years ago
|
Comment 29•5 years ago
|
||
The google_test gtest build doesn't provide any exports for the
shared library on Windows and the gyp build also builds just a
static library. So build gtest and gtestutil libraries as static.
For whatever reason, the Windows linker doesn't find the main
function inside the gtestutil library, if we don't tell it to
build a console executable. But linking works fine, if the object
file is used directly. But since we can have different main()
objects based on build flags, we enforce building console
applications binaries.
Depends on D69021
Comment 30•5 years ago
|
||
I just pushed a stripped down patchset. I removed all the cleanup patches, except for the private_exports patch, which saves one complete walk of the whole NSS source tree. It now passes the LibreOffice CI build on Linux, Windows and MacOS with debug and release config, including the previously failing gtests build. I'll open a new bug for all the patches I've currently removed / couldn't push, because of the missing bug number.
My main "problem" is still the freebl Makefile. While the current solution in D69023 seem to work, I don't like it. OTOH it's the already existing solution without the double-colon libs target. I kind of understand why it works, but I don't like overwriting the libs: rule. What I don't understand is the fact, that using TARGETS += and .PHONY += instead didn't work for me in my LibreOffice environment, but it worked in my separate NSS only environment :-(
The missing patches remove a few thousand lines of Makefile comments, duplicate empty lines, a further reworked LIBRARY_NAME rule and remove a few now basically empty config.mk snippets. There is also a minor VERSION define change in the pk11wrap code, to get rid of the naming "clash" with the LIBRARY_VERSION in the Makefile (not really a clash, as the library is actually static, but it's confusing to read). Current diffstat of the remaining patches is "239 files changed, 213 insertions(+), 4757 deletions(-)".
Thanks for the review and comments so far.
Comment 31•5 years ago
|
||
Comment on attachment 9137161 [details]
Bug 290526 Use eval templates for export and freebl
Revision D69022 was moved to bug 1629553. Setting attachment 9137161 [details] to obsolete.
Comment 32•5 years ago
|
||
Comment on attachment 9139466 [details]
Bug 290526 Cleanup WIN shared library rules
Revision D70369 was moved to bug 1629553. Setting attachment 9139466 [details] to obsolete.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 33•5 years ago
|
||
https://hg.mozilla.org/projects/nss/rev/d30a6953b897a8c8beff5ac5e29c7d75d71530ff
https://hg.mozilla.org/projects/nss/rev/585942b1d556a689b72e6a9f84c6ee23413f07a4
https://hg.mozilla.org/projects/nss/rev/fb377d36262de7bd204187491dc2e3455b97fee0
https://hg.mozilla.org/projects/nss/rev/5d0bfa092e0fc37be1791132fa00f7f2e74f5a9b
https://hg.mozilla.org/projects/nss/rev/989ecbd870f3c2f81f0e2c559e277b11aa0c577b
https://hg.mozilla.org/projects/nss/rev/a82a55886c1d84ac17c9fd6c31ce03f682e93cfe
https://hg.mozilla.org/projects/nss/rev/f3a0ef69c0569c8512845075a48e796bc08bf636
Comment 34•5 years ago
|
||
While the dependency information is now fixed, the parallel debug build will still fail on Windows, because the NSPR patch isn't merged yet.
And will someone adapt the CI, so it'll test the parallel build? Should I file an additional bug for that?
Comment 35•5 years ago
|
||
and NSPR .. oops, thanks Jan-Marek!
https://hg.mozilla.org/projects/nspr/rev/23940b78e965762287b772a8b6e7acf314d1aa2f
For parallel building, I think we should file a companion bug to https://bugzilla.mozilla.org/show_bug.cgi?id=1637102. IMO we should just make all Make builds parallel for CI.
If you want to file the bug and take a crack at editing the build config - it should just be this line and the equiv ones to set MAKEOPTS
to -j16
or similar: https://searchfox.org/nss/rev/81ca42b7138b63ec48eec02fea6f76d87a099c60/automation/taskcluster/graph/src/extend.js#196
Comment 36•5 years ago
|
||
How soon do you need to pick up the NSPR change? FF 78 or 79?
Updated•5 years ago
|
Comment 37•4 years ago
|
||
AFAIK Firefox uses gyp to build NSS (from bug 1638289), so probably also NSPR. So while the NSS patches are in 3.53, the included NSPR version is still 4.25, which doesn't include the patch. In the end that NSPR change just matters for NSPR, configure + make, parallel, Windows, MS VS, debug
builds. But since the FF builds aren't constantly failing and AFAIK nobody ever complained about this failure, I seem to be the only one running this kind of builds. Mainly - I guess - because everyone had to build NSS sequential since "ever". And I'll just patch LibreOffice's NSS build with this minimal change, until it lands upstream.
So from my POV the NSPR patch doesn't matter for FF at all.
Comment 38•4 years ago
|
||
The NSPR patch should be in this next release set. Clearing my needinfo -- and Ben made some progress in Bug 1640328, just have to figure out some gcc-4 issues.
Description
•