Coder Social home page Coder Social logo

Comments (5)

TooTallNate avatar TooTallNate commented on September 22, 2024

Hey @arturadib, so except for the last one, these are more or less expected:

Problem 1

At first node-gyp seems to look for a bindings.gyp file rather than binding.gyp:

Yes this is actually expected, and arguably a usability bug in node-gyp. But basically the Windows target generates a <name of gyp file>.sln, whereas the Make target generates a (hard-coded predictable name) Makefile.gyp file. I've been meaning to change Windows to glob for the first .sln file in the cwd but haven't done that yet. (You can currently specify which sln to use with node-gyp build --solution=binding.sln, but ideally you don't need that).

Problem 2

If I rename binding.gyp to bindings.gyp then it seems to build OK, except for a warning message concerning a mismatch of extensions (.dll vs .node):

This is also expected. Node renames the resulting shared object to .node rather than .dll. MSVC decides to complain about that. Not sure if there's a way to silence that warning..

Problem 3

Since the build was seemingly OK, I tried to run test.js, but it complains that there is no binary in ./out/Release/binding. Instead, the binary was produced in ./Release/binding.

Again, this is just a Windows-ism of the build system. The same thing happens when building node.exe itself! There is never an out directory, just top level Debug and Release. This also may be fixable (in the node repo), but I'm not sure really. Note that node-bindings takes care of normalizing that for you at runtime.

Problem 4

Fixing the path issue above and running test.js again now leads to the following error:

node.js:201
       throw e; // process.nextTick error, or 'error' event on first tick
             ^
Error: unknown error

"unknown error", lovely :
I haven't actually ever seen that one yet! Are you trying out the 64-bit node.exe or something? I doubt it's related to the .dll vs .node thing. I'll fire up my Windows VM in a bit to verify that the Hello World addon builds properly...

from node-gyp.

TooTallNate avatar TooTallNate commented on September 22, 2024

So Problem #4 is fixed by nodejs/node-v0.x-archive#2828.

I'll open a new issue to glob for .sln files on Windows, so that the --solution argument is not necessary.

Closing.

from node-gyp.

TooTallNate avatar TooTallNate commented on September 22, 2024

@arturadib Check out nodejs/node-v0.x-archive#2833 which fixes Windows to build addons properly in the out dir. Cheers!

from node-gyp.

arturadib avatar arturadib commented on September 22, 2024

@TooTallNate Awesome, thanks Nate. I was actually going to ask you about those random files scattered around root :)

I suppose this feature will not work when the user has older versions of Node installed, right? (Since as I understand it, node-gyp will download the corresponding minor version source, which won't have the new features in yet).

from node-gyp.

TooTallNate avatar TooTallNate commented on September 22, 2024

@arturadib You're correct about node-gyp downloading the source tarball, however node-gyp also copies over newer versions of the gyp config files when they exist from its "legacy" dir. Eventually this "fixing" hopefully won't be necessary, and node-gyp can just use the node version's gypi files as they come, but for now (at least until 0.8) node-gyp has to do some "cleanup" on the dev files.

from node-gyp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.