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

Error w/ dtrace build when installing in a directory with a '(' in the path on OSX #65

Closed
andyburke opened this issue Jul 6, 2015 · 1 comment

Comments

@andyburke
Copy link

LD_LIBRARY_PATH=/Users/aburke/Dropbox (Personal)/...
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `LD_LIBRARY_PATH=/Users/aburke/Dropbox (Personal)/...
make: *** [.] Error 2

Probably need some quotes around filepaths.

@davepacheco
Copy link
Collaborator

As far as I can tell, this is an issue with GYP. I reproduced it with:

$ V=1 npm install

> [email protected] install /Users/dap/work/foo bar/node-dtrace-provider
> node scripts/install.js

  LD_LIBRARY_PATH=/Users/dap/work/foo bar/node-dtrace-provider/build/Release/lib.host:/Users/dap/work/foo bar/node-dtrace-provider/build/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../.; sh libusdt-build.sh
/bin/sh: bar/node-dtrace-provider/build/Release/lib.host:/Users/dap/work/foo: No such file or directory
Building libusdt for x86_64
make[1]: *** No rule to make target `clean'.  Stop.
make: *** [.] Error 2
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/dap/install/node-v0.12.2-amd64/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:1074:12)
gyp ERR! System Darwin 12.6.0
gyp ERR! command "node" "/Users/dap/install/node-v0.12.2-amd64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/dap/work/foo bar/node-dtrace-provider
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok 

The problem is that something is setting LD_LIBRARY_PATH to a value that has spaces in it, but it's not quoting that assignment. On my system, I found this code in $npm_exec_path/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py:

 884       # Set LD_LIBRARY_PATH in case the action runs an executable from this
 885       # build which links to shared libs from this build.
 886       # actions run on the host, so they should in theory only use host
 887       # libraries, but until everything is made cross-compile safe, also use
 888       # target libraries.
 889       # TODO(piman): when everything is cross-compile safe, remove lib.target
 890       self.WriteLn('cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:'
 891                    '$(builddir)/lib.target:$$LD_LIBRARY_PATH; '
 892                    'export LD_LIBRARY_PATH; '
 893                    '%s%s'
 894                    % (name, cd_action, command))
 895       self.WriteLn()

There was a change submitted at https://codereview.chromium.org/287393002/, but I can't tell if it was integrated.

This (or a similar issue) seems to have been seen by a number of other projects: trentm/node-bunyan#58, kelektiv/node.bcrypt.js#121, and those seem to be nodejs/node-gyp#65.

Anyway, this does not appear to be a dtrace-provider issue, but I don't know how to make forward progress. Sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants