Fixes for building when the path to the repo contains spaces#56401
Draft
Jayman2000 wants to merge 2 commits intonodejs:mainfrom
Draft
Fixes for building when the path to the repo contains spaces#56401Jayman2000 wants to merge 2 commits intonodejs:mainfrom
Jayman2000 wants to merge 2 commits intonodejs:mainfrom
Conversation
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The “Building Node.js” guide says:
This pull request contains a few fixes that are directed at that problem. I still haven’t been able to successfully build and test Node.js while it’s stored in a path that contains spaces, but the changes in this pull request have gotten me closer to being able to do that.
Unfortunately, in order to test one of the commits in this pull request, a vendored dependency of a vendored dependency of a vendored dependency needs to be patched. I’m going to mark this pull request as a draft until the following has happened: