From 63b8b509383c01a1ac528d85cc40ef70d2a48060 Mon Sep 17 00:00:00 2001 From: Jason Yundt Date: Wed, 25 Dec 2024 08:28:56 -0500 Subject: [PATCH 1/2] build: replace "$(NODE)" with $(NODE) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this change, Makefile would sometimes use quotation marks when expanding the NODE Make variable and sometimes would not use quotation marks when expanding the NODE Make variable. This change makes it so that the Makefile never uses quotation marks when expanding the NODE variable. Line 82 of the Makefile sets the NODE variable to this: NODE ?= "$(PWD)/$(NODE_EXE)" Since there are already quotation marks embedded in the value of the NODE variable, we don’t need to add additional quotes when expanding the variable. In fact, adding quotes can cause issues. For example, before this change, line 97 of the Makefile said this: if [ -x "$(NODE)" ] && [ -e "$(NODE)" ]; then \ If you tried to run “make test-only” and the path your copy of the Node.js source code contained spaces, then that line would expand to something like this: if [ -x ""/Path that contains spaces/node"" ] && [ -e ""/Path that contains spaces/node"" ]; then \ The shell would then fail to run that command because of the improper quoting. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7192c6473d97cf..a3cf6f98f98a07 100644 --- a/Makefile +++ b/Makefile @@ -94,8 +94,8 @@ V ?= 0 # Use -e to double check in case it's a broken link available-node = \ - if [ -x "$(NODE)" ] && [ -e "$(NODE)" ]; then \ - "$(NODE)" $(1); \ + if [ -x $(NODE) ] && [ -e $(NODE) ]; then \ + $(NODE) $(1); \ elif [ -x `command -v node` ] && [ -e `command -v node` ] && [ `command -v node` ]; then \ `command -v node` $(1); \ else \ From 7273860d47e5ce367f118ea705c00c28933485b3 Mon Sep 17 00:00:00 2001 From: Jason Yundt Date: Fri, 27 Dec 2024 10:18:42 -0500 Subject: [PATCH 2/2] =?UTF-8?q?build:=20add=20quotes=20to=20run-npm-ci?= =?UTF-8?q?=E2=80=99s=20value?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Makefile contains two variable: NODE and run-npm-ci. Here’s the line that sets the NODE variable: NODE ?= "$(PWD)/$(NODE_EXE)" The value of the NODE variable contains quotation marks just in case $(PWD) contains spaces. Before this change, here’s how the run-npm-ci variable was set: run-npm-ci = $(PWD)/$(NPM) ci The value of the run-npm-ci variable does not contain quotation marks. $(run-npm-ci) is supposed expand into two words when interpreted by a shell, but if $(PWD) contained spaces, then it would expand into more than 2 words. This change adds quotation marks to the value of run-npm-ci. This change makes the Makefile more consistent and helps make sure that $(run-npm-ci) does the right thing, even if $(PWD) contains spaces. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a3cf6f98f98a07..827c2d32f0a260 100644 --- a/Makefile +++ b/Makefile @@ -788,7 +788,7 @@ out/doc/api/assets/%: doc/api_assets/% | out/doc/api/assets @cp $< $@ ; $(RM) out/doc/api/assets/README.md -run-npm-ci = $(PWD)/$(NPM) ci +run-npm-ci = "$(PWD)/$(NPM)" ci LINK_DATA = out/doc/apilinks.json VERSIONS_DATA = out/previous-doc-versions.json