Closed toly-k closed 9 years ago
I might not be the best source for solutions, but the only thing that I see is that when building the module, you're not setting HOME to the appropriate value. From what I can glean from trying to disect the plugin, that should be something like
HOME="~/.test/.node-gyp/0.21.0" node-gyp rebuild --target=0.21.2 ...
where the version in the home is the same as the nodeVersion in the grunt config. I may be wrong, but that's where I'd start.
@Akudrevatykh You shouldn't be calling node-gyp rebuild at all if you're using this Task, it's done for you automatically.
@maxkorp hey, thanks for the pointer in the right direction! :) I'm not sure what "HOME" would be on Windows, but replacing C:\Users\user.node-gyp\0.21.2\Release\node.lib with node.lib built by this task totally worked.
@paulcbetts I am calling node-gyp rebuild
to build my native addon.
@Akudrevatykh That's what I'm saying, you should not do that, at all. grunt-build-atom-shell already rebuilds all of your native modules installed via npm install.
@paulcbetts thats impying that all of your node modules youre using in whichever app you're building are currently contained in the current projects node_modules, which is not necessarily a guarantee.
@maxkorp It's recursive, you don't have to do that. Or are you saying you have separate, top-level node_modules folders?
@paulcbetts Thanks for your response, but I am still struggling to understand at what point is this grunt task supposed to rebuild my native addon.
I have a private native addon(not installed via npm), that I want to use in my app. What I did: 1) Build test.exe with grunt-build-atom-shell 2) Copy app to resources or call test.exe + path to the app 3) At this point the native module fails to load (unless I replace C:\Users\user.node-gyp\0.21.2\Release\node.lib with a .lib built by the script and rebuild the addon).
Basically I only use the script to build atom-shell with a different name. At no point it is aware of my native app. How do I fix that? is targetDir supposed to point to my app folder or something?
@paulcbetts I had a module that existed in another folder somewhere else on the drive that isn't npm linked (or symlinked). I got around to basically copying the components needed to rebuild into my node modules folder, but that shouldn't have to be the case.
build-atom-shell script generates an executable that can't load C++ addons.
To reproduce the issue, I have built a hello world addon following these steps: https://nodejs.org/api/addons.html#addons_hello_world rebuilt it for atom-shell
node-gyp rebuild --target=0.21.2 --arch=ia32 --dist-url=https://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist
Downloaded atom-shell 0.21.2 loads the addon as expected:
atom-shell built with the following grunt task:
throws an error:
test.exe is built on Windows 7, node v0.10.36
Is it a known issue? Is there a version that will work or a workaround?