icebob / node-rdkafka

Node.js bindings for librdkafka
MIT License
0 stars 0 forks source link

Prebuild issues #1

Open icebob opened 6 years ago

icebob commented 6 years ago

Hi @cjhoward92,

could you help me? I have some problem.

  1. First I want to config AppVeyor to create prebuilts for Node 6, 8, 9. You can check the appveyor.yml in the repo. It works on v6 &v8. It publishes prebuilt to releases. But node-gyp can't build for v9: https://ci.appveyor.com/project/icebob/node-rdkafka/build/job/iql02j2fwlxiq8qn But I don't know what is the reason. Do you have any idea?
  2. I can't build x86 binaries. I think this is the reason.
  3. I tried to install prebuilt with npm install icebob/node-rdkafka. It founds the prebuilts, download & install it. But in the last step, prebuild-install require the .node file in order to test that it works. Everythings fine, but when npm close this process it exits with exit code 3221225477. Therefore NPM detects it crashed and as fallback it starts to build it from source. This exit code means C0000005 wich is the error code of an access violation.
    
    > @icebob/node-rdkafka@2.3.2 install d:\Work\tmp\rdkafka-test\node_modules\@icebob\node-rdkafka     
    > prebuild-install --verbose                                                                        

prebuild-install info begin Prebuild-install version 2.5.3
prebuild-install info looking for local prebuild @ prebuilds\node-rdkafka-v2.3.2-node-v57-win32-x64. tar.gz
prebuild-install info looking for cached prebuild @ C:\Users\Bobcsi\AppData\Roaming\npm-cache_prebu ilds\https-github.com-icebob-node-rdkafka-releases-download-v2.3.2-node-rdkafka-v2.3.2-node-v57-win3 2-x64.tar.gz
prebuild-install info found cached prebuild
prebuild-install info unpacking @ C:\Users\Bobcsi\AppData\Roaming\npm-cache_prebuilds\https-github. com-icebob-node-rdkafka-releases-download-v2.3.2-node-rdkafka-v2.3.2-node-v57-win32-x64.tar.gz
prebuild-install info unpack resolved to d:\Work\tmp\rdkafka-test\node_modules\@icebob\node-rdkafka\ build\Release\node-librdkafka.node
prebuild-install info unpack required d:\Work\tmp\rdkafka-test\node_modules\@icebob\node-rdkafka\bui ld\Release\node-librdkafka.node successfully
prebuild-install info install Successfully installed prebuilt binary!
npm WARN rdkafka-test@1.0.0 No description
npm WARN rdkafka-test@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 3221225477
npm ERR! @icebob/node-rdkafka@2.3.2 install: prebuild-install --verbose
npm ERR! Exit status 3221225477
npm ERR!
npm ERR! Failed at the @icebob/node-rdkafka@2.3.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Bobcsi\AppData\Roaming\npm-cache_logs\2018-04-25T20_49_58_714Z-debug.lo


I tried with an empty js file to require the node file and it really exits with code.

```js
// index.js
require("./binary/node-librdkafka.node");
// start.bat
start /wait node.exe index.js
echo %errorlevel%

Of course it's working properly on Linux

I have no any idea, how can I fix them.

I give you access to this fork, so you can modify files and check the result on Appveyor: https://ci.appveyor.com/project/icebob/node-rdkafka

cjhoward92 commented 6 years ago

I will take a look tonight or this weekend and see if I can come up with anything! So far, nice progress! I am excited!

icebob commented 6 years ago

Thank you in advance!

cjhoward92 commented 6 years ago

I am going to try and build this with node v9 on my home machine, but I need to download vs 2013 and all the stuff it needs. I may not have a fix for you today, but I will look at it.

cjhoward92 commented 6 years ago

I don't think we are going to get to build on version 9 until we get node-rdkafka building with Visual Studio 2015, which it really should support. That will take major changes to the librdkafka.gyp, though. Although it is something I have been wanting to do. Right now, the build process shells out to MSBuild. In reality, we should be using node-gyp to build from source.

cjhoward92 commented 6 years ago

As for the x86 builds... if we want those we will need to add a second path to build with the condition based on the arch. It shouldn't be too hard, but again, if we upgrade to vs 2015 we can do it then.

icebob commented 6 years ago

Thanks, it sounds more complex than I thought :disappointed: