-
Notifications
You must be signed in to change notification settings - Fork 397
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
Windows support #248
Windows support #248
Conversation
Fixes #45 |
I was hoping to experiment with this branch, but it isn't building for me. I notice "ls -1" and "find" in binding.gyp and librdkafka.gyp. Are these fulfilled by an implicit dependency (cygwin/msys/some SDK)? Is it desirable to write these in node instead, such as
|
That Have not fully tested anything, and those dependencies were satisfied on my specific machine, although I don't plan on depending on them long term. |
I just adjusted the sources list to just explicitly call out the source files |
Any status on the other changes for the build process? I'm not familiar enough with gyp bindings to know how exactly to manage the build process, but I do see a few commands that will fail on windows, namely the I'd love to be able to use this project, the Kerberos support is awesome, but our tests need to pass on win, Linux and mac systems. If there's anything I can do to help move this along I'd be happy to help out |
Is it still running find for you when you try to install it? That should be isolated behind a condition of I just need to test this on linux and mac before I merge it - so that's what I'm waiting for :) |
Yeah I get an exception saying the file wasn't found during the build process. I just wiped the repo I cloned so give me a moment to try and re-clone and rebuild and I can get you some more details. |
Here's the stracktrace I get when I try to install using C:\github\node-kafka\node_modules\node-rdkafka>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\n
ode-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
File not found - *.c
gyp: Call to 'find librdkafka/src -name *.c ! -name rdkafka_sasl*' returned exit status 2 while in C:\github\node-kafka\node_modules\node-rdkafka\deps\librdkafka.gyp. w
hile loading dependencies of binding.gyp while trying to load binding.gyp edit I get the same error if I clone and build (I also have to execute edit v2 It appears to be line 217 in 'sources': [
'<!@(find librdkafka/src -name *.c ! -name rdkafka_sasl* )'
], Which appears outside of the source restrictions. |
a4b9c9d
to
1c5eada
Compare
@matthax This should now all be guarded behind a conditional. Can you try one more time? |
If it means I can finally use this library, of course!
…On Oct 18, 2017 12:56 PM, "Stephen Parente" ***@***.***> wrote:
@matthax <https://github.com/matthax> This should now all be guarded
behind a conditional. Can you try one more time?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#248 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALc70H58leW_PhlQWNenf36FtrW6PyN8ks5sti3HgaJpZM4PNlR2>
.
|
1c5eada
to
a7cfea7
Compare
No dice, however, the issue may be related to my machine. I'm getting I'll let you know what happens in those environments... |
So one of the things I could NOT get around is that you need to be using the v120 toolset. Node gyp is not really good at selecting the correctly installed version, so I actually had to link MSBuild.exe to the correct one. This won't build on VS2015 because it uses a version of openssl precompiled by VS2013. |
How did you do the linking? I tried setting the build version through
node-gyp and environment variables but no dice.
…On Oct 18, 2017 4:00 PM, "Stephen Parente" ***@***.***> wrote:
So one of the things I could NOT get around is that you need to be using
the v120 toolset. Node gyp is not really good at selecting the correctly
installed version, so I actually had to link MSBuild.exe to the correct
one. This won't build on VS2015 because it uses a version of openssl
precompiled by VS2013.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#248 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALc70LiPvfucX60azBY2VP4z3lbR7Dn3ks5stljdgaJpZM4PNlR2>
.
|
I'm going to merge it now because getting to this step means it's working as far as I can tell, and there are more gyp changes I need to make. I'm going to write some docs up on how to get it all working and add them to the README in the next commit. |
|
I had previously specified the path for the 14.0 build tools in the path, which was why the link wasn't taking place. I've gotten through the actual configuration to the build process, I get Changing my path is a small price to pay to be able to develop locally... |
I updated the README with instructions that got me up and running. Hopefully it helps :) |
They did! And I got a fair bit farther, I cloned the repo locally to add the
Inside
Odd that |
Sorry about that. I think I fixed that issue. I had to have a c++ file in there just to force things to compile but it was in the deps directory, so it was gitignored and I didn't catch it. Just updated the repo. Can you try once more pulling from github? I wish I could try this stuff more but I don't have a Windows PC to work on currently. If I get some time I'll set up a VM so I can tests this, but hopefully this is the last change. |
Okay so we've gotten past the
As for not having a Windows machine, it's all good. I appreciate you making the effort. |
Hmm. That's a new method I added a few commits ago and rebased into the windows PR. I'm going to need to get it compiling on a windows machine and toy around with it to find out why that isnt working. The type mangling c++ does is making it kind of difficult to know what it wants that signature to be, but that should be available in common.cc as far as I can tell. |
You've been able to successfully compile it on Unix though right? I haven't tried the latest set of commits but I had no issues before. Let me know what comes of your investigation and if you need me to retest stuff, I'd be happy to. |
Correct. It's been compiling fine on Arch linux and Mac OS X. I'll let you know when i figure things out. |
Turns out windows is a bit more picky with const correctness than GCC 😛 Pushed up a change to master that should fix that issue, and was able to successfully get it to compile on my Windows machine. |
You wonderful person! I'm actually going to have to forgive you for being a Mei main because I'm so excited about this. Compiled successfully on Windows. Going to test on CentOS7 shortly but I doubt I'll have any issues there. Thanks a ton. edit works on CentOS7 :) |
Is there any way we can bundle the nuget dependency for windows with the package? Originally I was going to write a post install script to run when the os was win32 but since the install will still actually fail, so no post install scripts will run. I was thinking maybe just having an optional dependency on I don't know if it would be as simple as not ignoring If any of those sound like a potential solution, or you've got other ideas, let me know. I would be happy to loan a hand, make a PR, whatever, to make this easier on you. Also, super happy with the performance so far :) |
I don't really know the best way to do this. I know it's very annoying to install on Windows and I wish it was easier, but I don't really want to ship a binary as part of the library. You could edit the |
Yeah let me take a crack at that and see what I can do. |
Got something, let me update the readme and I'll make a PR. Basically all I did was add another build action to the MS portion of the |
Hi guys, I'm trying to build node-rdkafka on Windows 7 x64 (all current updates) + VS 2013 Update 5 and have some problems... MSBUILD : error MSB1009: файл проекта не существует. (Project file doesn't exist) It also strange that npm yields those warnings BEFORE build process: Missing input binary files? Well, they supposed to be compiled! )) I was able to successfully build a core librdkafka repository, both Win32 and x64 with appropriate OpenSSL packages I downloaded, as stated here: https://github.com/edenhill/librdkafka/blob/master/README.win32 |
@d-sphinx Please open a new issue for this and don't comment on the PR. PR conversations should be for discussing the code changes :) As far as your problem it looks like you downloaded this and did not clone the submodule. You need to |
@webmakersteve OK, I'll open a new issue for that. BTW what is a "PR"? ) |
@d-sphinx Pull Request |
For the current version of node-gyp using some feature of c++11, its minimum version of Visual Studio is VS 2015 ( see here ). I think the project can not been compiled with VS 2013 in node-gyp. |
I am using in my javascript project package json: I set the following environment variable to be able to compile and resolve libraries libeay32MT.lib and ssleay32MT.lib related to OpenSSL set CL=/I C:\OpenSSL-Win32\include I got errors related to resolving external symbol in open ssl like when it reach this line: rdkafka_broker.obj : error LNK2019: unresolved external symbol ERR_remove_thread_state referenced in function rd_kafka_broker_thread_main [C:\projects\code\kafka-nodejs\kafka-nodejs\node_modules\node-rdkafka\deps\librdkafka\wi rdkafka_sasl_scram.obj : error LNK2019: unresolved external symbol BIO_set_flags referenced in function rd_base64_decode [C:\projects\code\kafka-nodejs\kafka-nodejs\node_modules\node-rdkafka\deps\librdkafka\win32\librdkafka.vc It sounds related to how the lib (may be because it is MT mutili-threaded or static) are link. Any suggestion to fix this issue or any direction will be much appreciated thank you |
Do not merge yet. Still needs conditional adjustments based on architecture and debug/release.