albanm / node-libxml-xsd

XSD validation for node.js using libxml.
70 stars 28 forks source link

Building libxml-xsd against Node 10 has fatal compile error #29

Open corvinrok opened 6 years ago

corvinrok commented 6 years ago

In a current working project using libxml-xsd (version 0.5.2), I tried rebuilding after upgrading to Node 10.0.0

The compile of libxml-xsd fails with a fatal compile error, as seen below:

..\src\schema.cc(31): error C2661: 'v8::Function::NewInstance': no overloaded function takes 0 arguments [C:\git\my-project\node_modules\libxml-xsd\build\node-libxml-xsd.vcxproj]

You can see the detailed compile stream below:

C:\git\my-project>npm rebuild 

> libxml-xsd@0.5.2 install C:\git\my-project\node_modules\libxml-xsd
> node-gyp rebuild

C:\git\my-project\node_modules\libxml-xsd>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) 
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  schema.cc
  node_libxml_xsd.cc
  win_delay_load_hook.cc
..\src\node_libxml_xsd.cc(1): warning C4005: 'BUILDING_NODE_EXTENSION': macro redefinition [C:\git\my-project\node_modules\libxml-xsd\build\node-libxml-xsd.vcxproj]
  ..\src\node_libxml_xsd.cc(1): note: command-line arguments:  see previous definition of 'BUILDING_NODE_EXTENSION'
..\src\schema.cc(31): error C2661: 'v8::Function::NewInstance': no overloaded function takes 0 arguments [C:\git\my-project\node_modules\libxml-xsd\build\node-libxml-xsd.vcxproj]
..\src\node_libxml_xsd.cc(76): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\git\my-project\node_modules\libxml-xsd\build\node-libxml-xsd.vcxproj]
  C:\git\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\node_libxml_xsd.cc(79): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\git\my-project\node_modules\libxml-xsd\build\node-libxml-xsd.vcxproj]
  C:\git\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\node_libxml_xsd.cc(83): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\git\my-project\node_modules\libxml-xsd\build\node-libxml-xsd.vcxproj]
  C:\git\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\node_libxml_xsd.cc(171): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\git\my-project\node_modules\libxml-xsd\build\node-libxml-xsd.vcxproj]
  C:\git\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'
..\src\node_libxml_xsd.cc(174): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\git\my-project\node_modules\libxml-xsd\build\node-libxml-xsd.vcxproj]
  C:\git\my-project\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call'

gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\git\my-project\node_modules\libxml-xsd
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! libxml-xsd@0.5.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the libxml-xsd@0.5.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\myuser\AppData\Roaming\npm-cache\_logs\2018-04-24T22_57_40_698Z-debug.log

It would be wonderful if I could use this package with my Node 10 application. Can this be fixed?

corvinrok commented 6 years ago

@albanm @samzilverberg Do you have any idea how this can be moved forward? Is this package abandoned?

samzilverberg commented 6 years ago

idea: dont use node 10 šŸ˜ but really, if you cant figure this issue out, and you dont need a specific feature from node 10, just use node 6/7/8 instead

albanm commented 6 years ago

Sorry for the absence of response. This project is not actively maintained, I do not use it anymore and I lack the time and the will to work on it. But I gladly accept pull requests, and if someone has a better maintained fork I am willing to transfer ownership of the name on npm.

I will put a notice on top of the README soon to state this.

corvinrok commented 6 years ago

The latest release from libxmljs https://github.com/libxmljs/libxmljs/releases/tag/v0.18.8 now supports successful build with Node 10. I am hoping that since this is a fork of that library that updating it with libxmljs changes is somewhat trivial to those who know what is up.

If that is not the case, and its too much work to do so, can someone point me to a link or resources where I could begin to learn how I might do a pull request that could move this fork forward to match the supported updates made in the original repo that allows Node 10 support? I'm saying, I'll help, I just honestly don't where to to start exactly.

albanm commented 6 years ago

I think you wanted to send this message here, no ? https://github.com/gagern/libxmljs/issues/12

It is a fork of libxmljs published as libxmljs-mt, and we rely on it.

corvinrok commented 6 years ago

you are absolutely correct.. thanks. I will do that. Sorry, it takes a bit to see all the build tree from a novice perspective... I know code, but the github ecosystem / npm world is still on my learning curve.. thanks for your help

hilleer commented 5 years ago

@corvinrok did you solve this issue?

hicom150 commented 5 years ago

I've been looking for this issue and since libxmljs-mt seems not actively maintained, I propose to use original libxmljs feature to validate against xsd schema as it is well maintained and compatible with nodejs 10.

rastkojokic commented 5 years ago

idea: dont use node 10 šŸ˜ but really, if you cant figure this issue out, and you dont need a specific feature from node 10, just use node 6/7/8 instead

This could be the worst response in the history of GitHub.

hilleer commented 5 years ago

@rastkojokic why would anyone consider using the latest (read: when written was) LTS version of Node? ;-)

samzilverberg commented 5 years ago

@rastkojokic as hilleer wrote, check when reply was written, your'e emberassing yourself. you replied 7 hours ago to a comment I wrote on 2018-05.

At that time, node 10 was just released, there was not even 10.1.0, and it was definitelt not considered stable (and not yet LTS). If something was not working for you with v10 at that time, it was worth reconsidering using a more stable version and upgrading later on.

anyone who trusts me to do some work knows i'm practical and dependable, and can make exactly these type of considerations.

sorry for the flame war, but you started šŸ˜›

more seriously, this project looks like its not maintained anymore, so either fork/take over and fix or find another lib. hicom150 suggests libxmljs has caught up and works now. cheers šŸ„‚