-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Modify output directory #848
Comments
It's hard-coded currently. Why would you want to change it? It would break most add-ons. |
I'm adding Node.js bindings to a C library as part of the C library's repository. The C library uses Kconfig, and the node bindings depend on the whole of the C library. By default, the C library places its output into build/. So, when npm install runs as the last step of the library's build process, it removes build/ and then creates it - but the bindings depend on everything that has previously been put into build/, such as public headers etc. This is only a problem because I'd like to
If it were possible to build into another directory, I could still move it back to build/ after npm install was done, because npm install is getting called from a make target in the parent C library. |
I think what you're describing is because npm does a I'm open to a PR that makes the build directory configurable but it may not be necessary is my point. :-) |
Why is it that, when you install node, it automatically installs npm, which automatically installs node-gyp, but node and npm end up in your PATH, whereas node-gyp does not? I ask because the C library build script makes the availability of the bindings contingent upon the presence of node on the PATH. It would be nice if I didn't have to deduce the location of node-gyp from the directory in which I find node - i.e., Anyhoo, my solution so far is to node_bindings: $(SOL_LIB_OUTPUT)
# Install dependencies
node -e 'Object.keys(require("./package.json").dependencies).map(function(item){console.log(item);})' | xargs npm install
# Build the package without clobbering build/
SOLETTA_FROM_MAKE=true $(dirname `which node`)/../lib/node_modules/npm/bin/node-gyp-bin/node-gyp configure
SOLETTA_FROM_MAKE=true $(dirname `which node`)/../lib/node_modules/npm/bin/node-gyp-bin/node-gyp build
PHONY += node_bindings I guess if there's no cleaner solution then this issue can be closed. |
Maybe you can raise an issue over at https://github.com/nodejs/node/issues if you feel strongly about that? I personally would be okay with making the installers put node-gyp on the PATH and it's already the recommended practice to use the node-gyp that's distributed with node. I'll go ahead and close this issue. |
Currently, I cannot find a documented way to change the output directory from "build/". I've noticed that node-gyp runs gyp_main.sh passing in
--generator-output build
essentially without an opportunity to modify it.Is it nevertheless possible to modify it?
The text was updated successfully, but these errors were encountered: