From 0a5c34c01374fea004c074c062e1317520056307 Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Fri, 19 Aug 2022 07:08:59 -0500 Subject: [PATCH 1/3] build: added NINJA env to customize ninja binary Fixes: https://github.com/nodejs/node/issues/44286 --- Makefile | 5 +++-- doc/contributing/building-node-with-ninja.md | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e0d756fea3ac35..9c01f8f244ee19 100644 --- a/Makefile +++ b/Makefile @@ -115,6 +115,7 @@ $(NODE_EXE) $(NODE_G_EXE): config.gypi out/Makefile ln -fs out/${build_type}/$(NODE_EXE) $@; fi else ifeq ($(BUILD_WITH), ninja) +NINJA ?= ninja ifeq ($(V),1) NINJA_ARGS := $(NINJA_ARGS) -v endif @@ -124,11 +125,11 @@ else NINJA_ARGS := $(NINJA_ARGS) $(filter -j%,$(MAKEFLAGS)) endif $(NODE_EXE): config.gypi out/Release/build.ninja - ninja -C out/Release $(NINJA_ARGS) + $(NINJA) -C out/Release $(NINJA_ARGS) if [ ! -r $@ ] || [ ! -L $@ ]; then ln -fs out/Release/$(NODE_EXE) $@; fi $(NODE_G_EXE): config.gypi out/Debug/build.ninja - ninja -C out/Debug $(NINJA_ARGS) + $(NINJA) -C out/Debug $(NINJA_ARGS) if [ ! -r $@ ] || [ ! -L $@ ]; then ln -fs out/Debug/$(NODE_EXE) $@; fi else $(NODE_EXE) $(NODE_G_EXE): diff --git a/doc/contributing/building-node-with-ninja.md b/doc/contributing/building-node-with-ninja.md index 8aae340e227034..1f3ea092653bba 100644 --- a/doc/contributing/building-node-with-ninja.md +++ b/doc/contributing/building-node-with-ninja.md @@ -40,4 +40,13 @@ To create a debug build rather than a release build: ./configure --ninja --debug && make ``` +## Customizing `ninja` path + +On some systems (RHEL7 and below), `ninja` is not offered in the yum package. +For these systems use the `NINJA` env var: + +```bash +./configure --ninja && NINJA="ninja-build" make +``` + [Ninja]: https://ninja-build.org/ From 901059f71e7bbc8c77fa061e30faa13f4c63844a Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Fri, 19 Aug 2022 12:30:06 -0500 Subject: [PATCH 2/3] Update doc/contributing/building-node-with-ninja.md Co-authored-by: Luigi Pinca --- doc/contributing/building-node-with-ninja.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/contributing/building-node-with-ninja.md b/doc/contributing/building-node-with-ninja.md index 1f3ea092653bba..795543da501560 100644 --- a/doc/contributing/building-node-with-ninja.md +++ b/doc/contributing/building-node-with-ninja.md @@ -42,7 +42,8 @@ To create a debug build rather than a release build: ## Customizing `ninja` path -On some systems (RHEL7 and below), `ninja` is not offered in the yum package. +On some systems (such as RHEL7 and below), the Ninja binary might be installed +with a different name. For these systems use the `NINJA` env var: ```bash From 20aa75638fd44a35beca73a4b200ced2b62673ac Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Fri, 19 Aug 2022 13:00:01 -0500 Subject: [PATCH 3/3] Update doc/contributing/building-node-with-ninja.md Co-authored-by: Luigi Pinca --- doc/contributing/building-node-with-ninja.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/contributing/building-node-with-ninja.md b/doc/contributing/building-node-with-ninja.md index 795543da501560..01a04c3c2cfbe2 100644 --- a/doc/contributing/building-node-with-ninja.md +++ b/doc/contributing/building-node-with-ninja.md @@ -43,8 +43,7 @@ To create a debug build rather than a release build: ## Customizing `ninja` path On some systems (such as RHEL7 and below), the Ninja binary might be installed -with a different name. -For these systems use the `NINJA` env var: +with a different name. For these systems use the `NINJA` env var: ```bash ./configure --ninja && NINJA="ninja-build" make