-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Conversation
Will it cause |
Yes. |
@@ -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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
No. I meant to better delineate the lines that generate config.mk
.
Optimally I'd wrap this code into a function, but that will just conflict with #26725
That's a really important point. I'll give it a dry-run tomorrow (no time today) |
+100 The default is make, it seems. Can we get CI coverage for this? I assume this just needs a custom freestyle build with |
I'll think of a way to cover this without adding bloat to the CI matrix 🤔 ... |
else | ||
ifeq ($(BUILD_WITH), ninja) | ||
ifeq ($(V),1) | ||
NINJA_ARGS := $(NINJA_ARGS) -v |
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 in MAKEFLAGS
, should be copied into NINJA_ARGS
? So that make -j2
ends up calling ninja -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.
Perhaps the
-jN
flag, if it's present inMAKEFLAGS
, should be copied intoNINJA_ARGS
? So thatmake -j2
ends up callingninja -j2
.
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.
Also make
or even gmake
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))
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.
Worked for me when I tried it, seems pretty reasonable.
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.
Can't thank you enough for this.
LGTM w/ @sam-github's concern taken care of.
IMO, If it doesn't work, those of using ninja will notice pretty quickly, I don't know that it needs ci coverage. |
PR-URL: nodejs#27504 Refs: https://mobile.twitter.com/refack/status/1118484079077482498 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
PR-URL: #27504 Refs: https://mobile.twitter.com/refack/status/1118484079077482498 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
This captures the intent to build with ninja from
configure --ninja
to be used in theMakefile
./CC @nodejs/build-files
/CC @joyeecheung @ryzokuken @sam-github (who expressed interest in the past)
Refs: https://mobile.twitter.com/refack/status/1118484079077482498
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes