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 failure when builddir contains spaces. #65

Closed
jasondavies opened this Issue May 16, 2012 · 31 comments

Comments

Projects
None yet
@jasondavies
Copy link

jasondavies commented May 16, 2012

See also: brianmcd/contextify#30.

For example, a home directory of Brad Old causes the build to fail:

> contextify@0.1.2 install /Users/Brad Old/Desktop/DEMO_jason/node_modules/d3/node_modules/jsdom/node_modules/contextify
> node-gyp rebuild

info it worked if it ends with ok 
info downloading: http://nodejs.org/dist/v0.6.17/node-v0.6.17.tar.gz 
spawn python [ '/Users/Brad Old/.node-gyp/0.6.17/tools/gyp_addon',
  'binding.gyp',
  '-I/Users/Brad Old/Desktop/DEMO_jason/node_modules/d3/node_modules/jsdom/node_modules/contextify/build/config.gypi',
  '-f',
  'make' ]
spawn make [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/contextify/src/contextify.o
clang: error: no such file or directory: 'Old/.node-gyp/0.6.17/src'
clang: error: no such file or directory: 'Old/.node-gyp/0.6.17/deps/uv/include'
clang: error: no such file or directory: 'Old/.node-gyp/0.6.17/deps/v8/include'
make: *** [Release/obj.target/contextify/src/contextify.o] Error 1
ERR! Error: `make` failed with exit code: 2
    at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
    at ChildProcess.emit (events.js:70:17)
    at maybeExit (child_process.js:362:16)
    at Process.onexit (child_process.js:398:5)
ERR! not ok
npm WARN optional dependency failed, continuing contextify@0.1.2

Notice the -I parameter is not escaped.

@TooTallNate

This comment has been minimized.

Copy link
Contributor

TooTallNate commented May 16, 2012

Confirmed. It looks like it might be a gyp bug, but I'll have to experiment a little bit more.

@TooTallNate

This comment has been minimized.

Copy link
Contributor

TooTallNate commented Jul 10, 2012

As a workaround, set your HOME env variable to something that doesn't contain spaces.

@cshenoy

This comment has been minimized.

Copy link

cshenoy commented Oct 15, 2012

Any updates to this issue?

@trentm

This comment has been minimized.

Copy link

trentm commented Nov 15, 2012

Added a pull that fixes at least the node-dtrace-provider (and hence the node-bunyan) issues mentioned here: #164

@jmwohl

This comment has been minimized.

Copy link

jmwohl commented Nov 12, 2013

This still seems to be an issue... any progress on it? Setting the HOME env var didn't seem to help, though I may not be doing that correctly.

@Glavin001

This comment has been minimized.

Copy link

Glavin001 commented Jan 6, 2014

I still think this is an issue, @jmwohl.

Looking at the latest commit: https://github.com/TooTallNate/node-gyp/blob/7e98c99ce7e04e1599677a8b7919f7c387ad6a09/lib/configure.js#L311
And looking at the purposed solution: trentm@bbd979b

Looks like Pull Request was never merged: #164

Proposed Solution (lines 311+), from @trentm:

Old

argv.push('-Dnode_root_dir=' + nodeDir)
argv.push('-Dmodule_root_dir=' + process.cwd())

Fixed

Add:

function shellEscape(str) {
   return str.replace(/(["\s'$`\\])/g, '\\$1');
};

Change to:

argv.push('-Dnode_root_dir=' + shellEscape(nodeDir))
argv.push('-Dmodule_root_dir=' + shellEscape(process.cwd()))

Maybe I am missing something? My only confirmation that it is still not working is from the issue I made on another repository: nodegit/nodegit#123

Hope this can be resolved and merged soon!


Update:
Looks like the solution didn't completely work. Sorry for the false alarm 👎 .

@sebnapi

This comment has been minimized.

Copy link

sebnapi commented May 28, 2014

This is an Open Issue:

> fsevents@0.2.0 install /usr/local/lib/node_modules/karma/node_modules/chokidar/node_modules/fsevents
> node-gyp rebuild

make: *** No rule to make target `../../../../../../../../../../Volumes/Macintosh', needed by `Makefile'.  Stop.
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:807:12)
gyp ERR! System Darwin 13.2.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/karma/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 

workaround not working for me too

@kfancy

This comment has been minimized.

Copy link

kfancy commented Aug 1, 2014

Work-around (definitely OS X, probably unix*) until this is fixed:

  1. create a new account, with no spaces in the folder name
  2. log in as that user
  3. install globally:

npm install -g PACKAGENAME

(this worked for me, to install zmq)

@carstenhag

This comment has been minimized.

Copy link

carstenhag commented Jan 23, 2015

Bump I guess? This still is an issue afaik.

@Mike-Dunton

This comment has been minimized.

Copy link

Mike-Dunton commented Feb 3, 2015

I am still having this issue here is a log output.

lwip@0.0.5 install /Users/michael dunton/projects/optimlol/node_modules/css-sprite/node_modules/lwip
> node-gyp rebuild

  CXX(target) Release/obj.target/lwip_decoder/src/decoder/init.o
clang: error: no such file or directory: 'dunton/.node-gyp/0.10.36/src'
clang: error: no such file or directory: 'dunton/.node-gyp/0.10.36/deps/uv/include'
clang: error: no such file or directory: 'dunton/.node-gyp/0.10.36/deps/v8/include'
make: *** [Release/obj.target/lwip_decoder/src/decoder/init.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Darwin 14.1.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/michael dunton/projects/optimlol/node_modules/css-sprite/node_modules/lwip
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 
@freder

This comment has been minimized.

Copy link

freder commented Mar 30, 2015

yep, still an issue:

clang: error: no such file or directory: 'HD'
clang: error: no such file or directory: '2/Projects/bla/code/bla.js/node_modules/libxslt/node_modules/libxmljs/src'
clang: error: no such file or directory: 'HD'
clang: error: no such file or directory: '2/Projects/bla/code/bla.js/node_modules/libxslt/node_modules/libxmljs/vendor/libxml/include'
make: *** [Release/obj.target/libexslt/deps/libxslt/libexslt/common.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
@Zae

This comment has been minimized.

Copy link

Zae commented Jun 9, 2015

Any progress on this?

@nemoDreamer

This comment has been minimized.

Copy link

nemoDreamer commented Jun 29, 2015

👍 Not just a Windows issue: I'm trying to install an Atom plug-in that uses node-gyp as a dependency, and my ~/.atom is stored on my cloud, by symlinking it to my "Google Drive" folder. I can't exactly rename that folder to not have a space, as it's tied into Google Drive's software...

Seems like this is a case for delimiting strings using a null character rather that splitting at spaces, kind of like find . -print0 | xargs -0 ... does, no?

@davidrhoderick

This comment has been minimized.

Copy link

davidrhoderick commented Jul 15, 2015

Still an issue on Mac OS X 10.9.5.

@kfancy

This comment has been minimized.

Copy link

kfancy commented Jul 15, 2015

It's probably going to remain an issue, my recommendation is to either
create a separate account to install global modules as necessary, or go
through the steps of removing the space from your user account directory
name, steps outlined in the link below.

https://support.apple.com/en-us/HT201548

On Wed, Jul 15, 2015 at 9:45 AM, David Rhoderick notifications@github.com
wrote:

Still an issue on Mac OS X 10.9.5.


Reply to this email directly or view it on GitHub
#65 (comment)
.

@4lador

This comment has been minimized.

Copy link

4lador commented May 15, 2016

Still an issue, even if it has a workaround it should be great if node-gyp could manage spaces in paths or send a warning about that :)

@vedraan

This comment has been minimized.

Copy link

vedraan commented May 20, 2016

Yes, this is still a problem, hacking with SYMLINK doesn't seem like a good solution.

salomvary added a commit to salomvary/node-gyp that referenced this issue Oct 18, 2016

@nickvorie

This comment has been minimized.

Copy link

nickvorie commented Feb 27, 2018

Bumping

@bnoordhuis

This comment has been minimized.

Copy link
Member

bnoordhuis commented Feb 27, 2018

^ Rude.

Closing. It's been discussed in other issues and it's not going to change; gyp itself doesn't support blanks in paths.

@bnoordhuis bnoordhuis closed this Feb 27, 2018

@gibfahn

This comment has been minimized.

Copy link
Member

gibfahn commented Feb 27, 2018

it's not going to change; gyp itself doesn't support blanks in paths.

If someone would like to patch gyp to handle spaces in paths that would be fine, but raising issues in node-gyp isn't helpful.

@bnoordhuis

This comment has been minimized.

Copy link
Member

bnoordhuis commented Feb 27, 2018

The rabbit hole goes even deeper because not all tools that gyp calls out to handle them either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment