Skip to content
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

Merged
merged 1 commit into from
May 3, 2019

Conversation

refack
Copy link
Contributor

@refack refack commented Apr 30, 2019

This captures the intent to build with ninja from configure --ninja to be used in the Makefile.

/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), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot nodejs-github-bot added the build Issues and PRs related to build files or the CI. label Apr 30, 2019
@refack refack self-assigned this Apr 30, 2019
@sam-github
Copy link
Contributor

Will it cause make test to use the ninja-built node? If so, this might be good for me, but I'm not sure if the impact on everyone else is excessive. fwiw, I never build with Make anymore. I run test.py directly, and make lint directly. Besides the issues in #25135, ninja is faster and gives a better progess indicator (in fairness, make doesn't even try to give progress indication).

@refack
Copy link
Contributor Author

refack commented Apr 30, 2019

Will it cause make test to use the ninja-built node?

Yes. make test delegates to make node or make node_g which are the targets I've patched.
BTW: this will use ninja iff configure was run with --ninja

@@ -1627,23 +1627,35 @@ def make_bin_override():
' '.join([pipes.quote(arg) for arg in original_argv]) + '\n')
os.chmod('config.status', 0o775)


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stray whitespace change?

Copy link
Contributor Author

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

@sam-github
Copy link
Contributor

BTW: this will use ninja iff configure was run with --ninja

That's a really important point. I'll give it a dry-run tomorrow (no time today)

Makefile Outdated Show resolved Hide resolved
@joyeecheung
Copy link
Member

joyeecheung commented May 1, 2019

+100

The default is make, it seems. Can we get CI coverage for this? I assume this just needs a custom freestyle build with --use_ninja as CONFIG_FLAGS? (But does any of the machine have ninja? Or maybe the one that builds the V8 CI should have it?)

@refack
Copy link
Contributor Author

refack commented May 1, 2019

Can we get CI coverage for this?

I'll think of a way to cover this without adding bloat to the CI matrix 🤔 ...

@refack refack changed the title build: delegate building from Makefile to ninja build: opt-in to delegate building from Makefile to ninja May 1, 2019
else
ifeq ($(BUILD_WITH), ninja)
ifeq ($(V),1)
NINJA_ARGS := $(NINJA_ARGS) -v
Copy link
Contributor

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.

Copy link
Contributor Author

@refack refack May 2, 2019

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.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added $(filter -j%,$(MAKEFLAGS))

Copy link
Contributor

@sam-github sam-github left a 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.

Copy link
Contributor

@ryzokuken ryzokuken left a 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.

@sam-github
Copy link
Contributor

IMO, If it doesn't work, those of using ninja will notice pretty quickly, I don't know that it needs ci coverage.

@refack refack force-pushed the auto-support-ninja branch from 76b89aa to 821f143 Compare May 2, 2019 20:15
@nodejs-github-bot
Copy link
Collaborator

@refack refack force-pushed the auto-support-ninja branch from 858adb2 to f45e940 Compare May 2, 2019 20:26
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

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>
@refack refack force-pushed the auto-support-ninja branch from f45e940 to 46eb532 Compare May 3, 2019 01:05
@refack refack merged commit 46eb532 into nodejs:master May 3, 2019
@refack refack deleted the auto-support-ninja branch May 3, 2019 01:06
targos pushed a commit that referenced this pull request May 4, 2019
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>
@targos targos mentioned this pull request May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants