-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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: opt-in to delegate building from Makefile to ninja #27504
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1627,23 +1627,35 @@ def make_bin_override(): | |
' '.join([pipes.quote(arg) for arg in original_argv]) + '\n') | ||
os.chmod('config.status', 0o775) | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stray whitespace change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. I meant to better delineate the lines that generate |
||
config = { | ||
'BUILDTYPE': 'Debug' if options.debug else 'Release', | ||
'PYTHON': sys.executable, | ||
'NODE_TARGET_TYPE': variables['node_target_type'], | ||
} | ||
|
||
# Not needed for trivial case. Useless when it's a win32 path. | ||
if sys.executable != 'python' and ':\\' not in sys.executable: | ||
config['PYTHON'] = sys.executable | ||
|
||
if options.prefix: | ||
config['PREFIX'] = options.prefix | ||
|
||
config = '\n'.join(['='.join(item) for item in config.items()]) + '\n' | ||
if options.use_ninja: | ||
config['BUILD_WITH'] = 'ninja' | ||
|
||
config_lines = ['='.join((k,v)) for k,v in config.items()] | ||
# Add a blank string to get a blank line at the end. | ||
config_lines += [''] | ||
config_str = '\n'.join(config_lines) | ||
|
||
# On Windows there's no reason to search for a different python binary. | ||
bin_override = None if sys.platform == 'win32' else make_bin_override() | ||
if bin_override: | ||
config = 'export PATH:=' + bin_override + ':$(PATH)\n' + config | ||
config_str = 'export PATH:=' + bin_override + ':$(PATH)\n' + config_str | ||
|
||
write('config.mk', do_not_edit + config_str) | ||
|
||
|
||
write('config.mk', do_not_edit + config) | ||
|
||
gyp_args = ['--no-parallel', '-Dconfiguring_node=1'] | ||
|
||
|
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.
Perhaps the
-jN
flag, if it's present inMAKEFLAGS
, should be copied intoNINJA_ARGS
? So thatmake -j2
ends up callingninja -j2
.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.
Added support via a
JOBS
env var.FTR: By default
ninja
runs in multiproc mode so adding-j
is used to change the default or limit the number of parallel processes.Alsomake
or evengmake
do not readily expose the value that was passed to them.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.
Added
$(filter -j%,$(MAKEFLAGS))