-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
build,win: re-enable ninja & multiple build optimizations #22698
Conversation
a8638d0
to
e705961
Compare
@@ -269,23 +269,11 @@ | |||
'msvs_settings': { | |||
'VCCLCompilerTool': { | |||
'StringPooling': 'true', # pool string literals | |||
'DebugInformationFormat': 3, # Generate a PDB | |||
'DebugInformationFormat': 1, # /Z7 embed info in .obj files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We currently publish the pdb, e.g. https://nodejs.org/dist/v10.9.0/win-x64/node_pdb.zip so this is semver-major?
cc @nodejs/platform-windows @nodejs/diagnostics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See also
Lines 372 to 378 in 4cea01a
echo Creating node_pdb.7z | |
del node_pdb.7z > nul 2> nul | |
7z a -mx9 -t7z node_pdb.7z node.pdb > nul | |
echo Creating node_pdb.zip | |
del node_pdb.zip > nul 2> nul | |
7z a -mx9 -tzip node_pdb.zip node.pdb > nul |
which is only run on the CI for releases (not for regular PR's).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh. This generates a .pdb
file but only a single one during linking.
vcbuild.bat
Outdated
set "msbcpu=/m:2" | ||
if "%NUMBER_OF_PROCESSORS%"=="1" set "msbcpu=/m:1" | ||
set "msbcpu=/maxcpucount" | ||
if defined NUMBER_OF_PROCESSORS set "msbcpu=%msbcpu%:%NUMBER_OF_PROCESSORS%" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will exhaust the memory available in some machines (including our CI). Ref 6cfedf0 and #12184 (comment) . I tested this extensively when I made this change, to find the best combination that uses a reasonable number of threads, and this was the best. CL will use one thread for each processor, but since some of our projects are quite small this helps a lot. If we did it the other way around, not limiting here and limiting in CL, V8 would keep compiling long after everything else finished.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my 4 CPU box this does not affect compilation time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll continue testing this, but meanwhile I'll remove this from this PR.
node.gyp
Outdated
|
||
# - "C4244: conversion from 'type1' to 'type2', possible loss of data" | ||
# Ususaly safe. Disable for `dep`, enable for `src` | ||
'msvs_disabled_warnings!': [4244], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't test yet, but this looks quite nice. Is it possible to simply set a much lower warning level for deps
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been thinking about that, the problem is common.gypi
is used by node-gyp
so I didn't want to make a big change without further testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was needed in L482 as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't test yet, but this looks quite nice.
output is filled with:
d:\code\node\src\node_internals.h(321): warning C4244: 'argument': conversion from 'const uint64_t' to 'const NativeT', possible loss of data
209a88a
to
84bed12
Compare
Could you describe this a bit more? Why are these required to re-enable ninja builds? |
|
This looks mostly good. @refack just two notes about the commit messages:
|
84bed12
to
6c8cb91
Compare
https://ci.nodejs.org/job/node-test-commit-windows-fanned/20664/ @joaocgreis updated messages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks @refack!
* Fixes ninja build PR-URL: nodejs#22698 Reviewed-By: João Reis <[email protected]>
* previusly set to generate a .pdb file for each .obj file * enables clcache PR-URL: nodejs#22698 Reviewed-By: João Reis <[email protected]>
* also unify warning exclusion directive PR-URL: nodejs#22698 Reviewed-By: João Reis <[email protected]>
6c8cb91
to
54e76fb
Compare
landed in |
* Fixes ninja build PR-URL: #22698 Reviewed-By: João Reis <[email protected]>
* previusly set to generate a .pdb file for each .obj file * enables clcache PR-URL: #22698 Reviewed-By: João Reis <[email protected]>
* also unify warning exclusion directive PR-URL: #22698 Reviewed-By: João Reis <[email protected]>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes