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
Feature request: support for Microsoft Windows #30
Comments
I've looked into it a bit. if someone could update it to use all the correct new stuff for 0.6 (I think it's still utilizing some older things) I think I can get it done. I'm just had a bit of trouble trying to translate both old libev APIs at the same time as trying to get libffi integrated. |
I have plans for this. I have an EIO shim for the old The bigger problem (or rather, the unsolved problem) is that there's no node-waf on windows, meaning I believe that a gyp script will need to take it's place. |
Yeah I can handle either making a gyp for it or failing that providing the compiled binaries, as that is the usual mode of things for Windows. Most people don't have the tools the compile, but binaries work nearly universally between Windows installs anyway. I have libffi compiled using the the Visual C++ compiled path introduced not too long ago so it should be possible to use that with Node. |
I have just read package.json and seen that node-ffi does not depend on any other npm-registered package. That means, @TooTallNate, if you still see the need of a gyp script as a big problem at installation time, then you (or some other dev) probably should follow @Benvie's idea and work around the problem by providing some pre-compiled Windows binary that won't need any You may have already seen how some other module devs already do that for some time and they seem successful. For example, since at least November 2011 node-firebird-libfbclient provides a pre-compiled (and zip-packed) Windows build:
Users unpack it, and it just works: there's no need to build anything on user's system by a script. |
Yeah I'm fairly sure the MSVC compiled lib-ffi target is portable between at least any of the same architecture version of Windows, so one for 32 bit and one for 64 bit. Possibly a single binary to cover them all but I'm not sure. |
Ya I'll be looking into it shortly. It shouldn't be too bad, but it will require bundling libffi in this repo and adding a hand-crafted gyp file for libffi as well as this module. It should be relatively easy, I'll have a look into it soon. Also, fwiw, I've been bundling a precompiled binary for windows in my node-weak module for a little while, and it's been working well. Cheers guys! Sent from my iPhone On Dec 25, 2011, at 21:05, Brandon Benviereply@reply.github.com wrote:
|
When I compiled it I had MozillaBuild already from doing SpiderMonkey stuff which you can get here http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe. The MSVC compile route for libffi compiles using the VC++ compiler and linker but still runs through the whole Mingw build system otherwise so it's kind of a Frankenstein thing. Ran the start-msvc10.bat in the base of mozilla-build, switch to libffi source directory, |
And yeah I already had mingw and whatnot setup but it wouldn't work. There has to be some magical dependencies that mozilla-build has that I couldn't figure out. Also don't try and build 64 bit. |
Well node only builds as 32-bit on Windows anyways, so I wasn't too worried about 64-bit libffi :) |
Oh another thing I think I did when I compiled which might matter due to the whole MinGW different filesystem thing was specifying the whole path (make sure no spaces in it). My resulting config.log says that was the ultimate command used: |
Yay! Seems like it compiled okay! Now to try to integrate with the node module... |
What's your take on it? I thought it might not be too bad once node-ffi was On Wed, Jan 4, 2012 at 9:22 PM, Nathan Rajlich <
|
So 2 problems so far:
There's some other more minor ones as well. But these are the bigger stopping points at the moment (though nothing impossible, just need some time). If you guys wanna help on that note I'd be happy :) The Windows-compatible branch is being worked on in the |
So for pthreads I can help a bit there having looked into it initially when I was trying to port some modules to windows. First, libuv has had mutxes type support added for 0.7 because it'd be impossible to do things like isolates without it. For a more direct (and not requiring node 0.7) solution, there's a some good but simple wrapper header files that supply pthread functionality via Windows API with zero modification to original code for most things. The simplest (if I recall) was this http://locklessinc.com/articles/pthreads_on_windows/ http://locklessinc.com/downloads/winpthreads.h |
Ok so looks like there's |
Shoot, you're right, looks like the |
lol, the windows mutex API is like a 1-1 mapping, just different names :\ |
Yeah that header is good there as well. It starts with the simplest and works up, so you can grab a subsection of it starting from the top and going down. At basic it implements mutexes and rwlocks with like 50 lines of simple wrapper code. |
So I've started to work in the winpthreads.h and dlfcn-win32 libraries. They both needed some fixing in some places where explicit casting was needed. New stumbling block is the |
Also, the "winpthreads.h" file seems to need a lot more fixes. It currently spits out like 50 errors when trying to compile :\ |
I would be helping more on this but managed to myself in a serious car wreck last night hopefully will be home from the hospital tomorrow and will work on this. |
@Mithgol @Benvie So in the |
So far so good playing with the pre-compiled version on Windows 7, working right out of the box. Going to go through the whole compile process...once I'm finished making dialogs popup using the win32 API and giggling. Awesome job! |
I just want to say awesome work fellas. I am looking forward to this feature to perform Windows domain authentication in SQL Server as the local, logged-in user via SSPI (basically just a couple calls in security.dll). |
@cretz Thanks for the compliment :) Everything should be good to go if you try out the |
Ok guys so |
I've also tried making dialogs popup using the win32 API, but run into some problem (unreadable dialog text) which (as far as I guess) is a result of some ABI mismatch (#34). However, if you've been making dialogs popup successfully, I may be wrong in my supposition. Please have a look at #34 for some time. |
Forget it, I've already found where I was wrong. |
This looks great and gave me hope, but... where is it? |
Ah, found it... in 0.5.7, but for Node 0.6. Seems like since then no one took the trouble to build a new release and maybe add a |
@AndreKR There is no precompiled binary of node-ffi at this time. |
Several latest versions of Node.js support Microsoft Windows.
libffi homepage says the library can also work on Windows. (To be precise: atgreen/libffi says the project can be compiled by Microsoft's Visual C++ compiler since version 3.0.10 of libffi, which is dated Aug-23-11.)
Is it possible to hope that node-ffi would eventually be ported to Microsoft Windows as well? It would make writing numerous wrapper modules (around existing libraries) a whole lot easier, and in some cases that would also facilitate providing pre-compiled binaries to end users.
The text was updated successfully, but these errors were encountered: