Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

windows support #176

Closed
shimondoodkin opened this Issue · 44 comments
@shimondoodkin

can you make a windows version for this? i have made xml2-config.bat
https://gist.github.com/4341933

i can't get the gyp to work

@defunctzombie
Collaborator

I don't think this is going to happen. None of the people currently working on the project have the time (or machines I think) to properly test this and then support the various issues that arrise. I am afraid that windows users are on their own for this. We would accept readme contributions or other improvements that are reasonable if you can make it work.

@polotek
Owner

Actually I'm trying to talk to people who can help with this. And I'm in a position to get just about any windows machine you can imagine :) Reopening this. But we are still strapped for time, so don't expect things to move super quick.

@polotek polotek reopened this
@kessler

There is a windows version of the libxml2 binaries maybe there is a buildable project out there too, just need a guiding hand and maybe I can make it work with @shimondoodkin 's script?

@matthewkastor

If you download the source code for libxml2 you will find build instructions for windows in there. I got it to compile, per the documented instructions in the source code, using visual studio express but note that there are other projects that it depends on so you will have to download those as well. For the best compatibility with this node module be sure to get whatever revision of libxml2 and dependencies they're expecting here.

Libxml2 is also available from GIT:

See libxml2 Git web. To checkout a local tree use:

git clone git://git.gnome.org/libxml2

The libxslt module is also present there.

Then, when this node module is updated, research all the dependencies for everything again and do the whole process over...

It would make a lot more sense to use something else or, if you're hell bent on using libxml2 with node on windows right this minute, you could control the libxml console application through node. If you want to do that, then you may find atropa-cmd useful for managing command lines. https://npmjs.org/package/atropa-cmd

The best way for this node module to move forward and support all platforms that node runs on, is to include the source code into the build process and only use the tools provided either in the source code packages or by node/compatible node modules. That way there won't be revision issues or a plethora of other problems that could arise. There could be something built into the build script that checked if the proper version of libxml is already installed on the system if anyone is really that worried about the filesystem bulk incurred by possibly duplicating these tiny files...

Those are my two cents. I'm only trying to help so if you're reading this and get agitated, re-read it and imagine I'm saying it with a big grin on my face and wearing a purple tutu. :dancer:

@kessler

@matthewkastor thanks again :)

afaik there is no "native" lib to do xml parsing inside node in windows, that is why I'm looking into libxml.

@shimondoodkin

@yanush will you do it?
or should i try again?

@kessler

@shimondoodkin it'll take me about a week or two (probably two) to get to it, but yes ill do it

@matthewkastor

@yanush

You are right, node doesn't come with an xml parser natively, I don't believe I said anything to mislead you into assuming that it did... I was talking about using the executables available at http://www.zlatkovic.com/libxml.en.html as directed to by the download page of xmlsoft http://xmlsoft.org/downloads.html or using one of the other xml parsing/processing packages available through npm that work on windows.

There are libraries for parsing xml built into windows which I'm sure could be integrated into node but that's just silly. We would just use jscript if we wanted to go that route. ;)

I do like libxml and would prefer to have the library built against node so if you come up with a solution that would be integrated and maintained in this project, that would be really cool. :D Let me know if you get it put together.

@kessler

@shimondoodkin - your batch file worked great, I placed it in the root of the "project" and brutally attached a ".bat" suffix to all the instances of xml2-config in bindings.gyp and voila I moved to the next stage.

@matthewkastor @polotek @shtylman

So proceeded to the next stage, I ran the build and it was looking for the libxml header files, no problem - placed them temporarily in the main include folder of v8 :) ran the build again and it printed a slew of syntax errors (?!) when I examined the code it looked syntax error free to me, so maybe this has to do with difference in OS line terminators or something?

Here is the output, your speedy comments would be greatly appreciated :)

https://gist.github.com/4437661

@defunctzombie
Collaborator

I think I have reached the point where this has gotten a little out of hand. I have created a new branch (vendor-src) where I have included the libxml source code and updated the bindings.gyp to build using that. All tests pass and the build works on my linux box. I am taking a look at what is needed to make it work on OSX (should be easy). For those with windows, please clone this branch and see if you can make the build work.

I think this will be the least painful way for this module to exist as relying on anything else to place the code in the right locations has shown to be a complete disaster. I welcome any feedback to this approach.

https://github.com/polotek/libxmljs/tree/vendor-src

@moondev

Thanks much for trying to get this working on windows! Much appreciated.

I have the following in my package.json

"libxmljs": "git://github.com/polotek/libxmljs.git#vendor-src"

I made sure I had python 2.7 and vidual c++ express 2010 installed. npm install gives me the following. Any ideas?

https://gist.github.com/4449263

@kessler

copy all the libxml missing.h dependencies to an include folder such as

%UserProfile%\.node-gyp\0.8.9\deps\v8\include

although this is far from ideal solution, it will probably save you the trouble of modifying the vs project file.

@shimondoodkin

why do you build libxml? i think it is not required

@kessler

He doesn't build libxml he is building the c++ nodejs addon part, which requires header files from libxml in order to compile

@kessler

@moondev did u manage to fix the include issue?

@moondev

@yanush I pasted everything from the includes folder from git://git.gnome.org/libxml2 into my .node-gyp include folder, but I still got all the same errors on npm install :(

I ended up just using https://github.com/yaronn/xpath.js + https://github.com/jindw/xmldom since they are cross platform and i'm on a tight deadline. It works but is much slower than libxmljs for sure.

@defunctzombie
Collaborator

Just to clarify to avoid confusion.

Yes, I am building libxml with the module in the vendor-src branch. Windows is a terrible environment when it comes to expecting 3rd party libraries. Also, to avoid version mismatches on other platforms (we have seen those in the past), it is easier and better to bundle it all with the module.

Now, I personally don't care about windows nor will I spend any more of my time on this. I started to make it work in my windows vm, but as I don't need it I stopped. If you work for a company and wish to have windows support, please email me directly and I will tell you the bug bounty and work on it. If that doesn't work for you, please consider debugging yourself or making it work using one of the above suggested approaches.

I am closing this issue as no maintainer is going to work on this. At this point the only solution for this that I am really willing to accept is making the in-tree vendor-src branch work. If you can make it work on windows then I will make sure it can work on OSx and Linux. As a note, I got it to build fully in windows and many of the tests run using the vendor-src branch as a starting point. There are still some small details for the sax tests that I had commented out.

@kessler

@shtylman
I am working on it and I'll get it to work eventually and share it. We already understood your attitude towards windows in your initial post, but like it or not this is a problem for many developers, and those with that pain will take care of it.

For now this is the "spot" where we communicate about this, so please leave it open if its not too much trouble.

@kessler

@moondev I'll take it from here mate. thanks :)

@defunctzombie
Collaborator

@yanush Glad to hear you are working on it. Please note that you should work off of the vendor-src branch as it will get you most of the way there. Crazy solutions beyond that I won't be too keen on :).

@defunctzombie defunctzombie reopened this
@moondev

@yanush godspeed! my xml file is over 16k lines. doing it with js is sooo slow and I must deploy the app on windows :frowning: at least they let me use node :smile:

@kessler

I'll update soon, probably later today or tomorrow.... redis problems now :)

@polotek
Owner

Hey here's an idea. Why don't we get more maintainers. I want this windows thing to happen. I'm just ill-equipped to do it, and @shtylman doesn't care. Don't mind him though. He's a gruff sort of fellow, but this is actually him being helpful. I'd definitely be open to giving commit access to folks who are interested to getting a good windows story and helping to maintain it going forward.

The criteria are pretty simple and informal. Submit a few patches that show good judgment and get them merged, and talk with the current team a bit so we can make sure you're mostly aligned with us on the projects goals. If someone wants to PR a doc about this stuff, that'd be a nice contribution.

@yanush if you're interested, let's talk offline. Email me at marco.rogers at gmail. Thanks everyone.

@kessler

haven't forgotten about this, was just busy with release at work, will continue this middle of next week.

@kessler

woop woop! will check it out soon, you're a hero! :)

@kessler

@XApp-Studio, I had a look this is not what we meant, but thanks :)

@mc007

Yeah, but isn't it enough just to re-use and re-map the bindings to the dll(s) created from within Cygwin instead of going into compiler wars ?

@matthewkastor

Emscripten, the superdooper transpiler? https://github.com/kripken/emscripten#readme

That would make it run native on node, no matter where node is deployed. Bonus, no compiler confusion. Bonus bonus, everything would be in JavaScript! XD

SQLite has already been compiled to JavaScript. ;) https://github.com/kripken/sql.js
espeak too! https://github.com/kripken/speak.js

:P

@mc007

true true. i have heard about,. libxml should go well there too; gonna try this one next weekend :-O

@matthewkastor

Sweeet! If it works at any reasonable speed be sure to tell everyone! :D

@trevordixon trevordixon referenced this issue in trevordixon/excel.js
Closed

can't "npm install" on windows 7 64 bit #6

@thallium205

Is there a way we could use the compiled libraries from this project: https://github.com/ajaxorg/node-o3-xml

It appears they figured it out.

@polotek
Owner

@thallium205 I've talked to the o3 guys in the past. It was a while ago, but they didn't really seem aligned with our project. And it looks like this project hasn't been updated in a long time. You should feel free to reach out to them and see what the current status is. If they have ideas about how we can leverage what they've figured out about windows support, we'd be happy to hear it.

@defunctzombie
Collaborator

Windows support is very easy. Just look at the vendor-src branch and make the final few tests pass. In all honesty, just find someone that knows how to compile things on windows and they will be able to do this in half and hour :)

@matthewkastor

Or...
npm install edge
and use .NET xml classes.

Edge is written by the author of iisnode. You can find it at: https://github.com/tjanczuk/edge
Overview of XML in the .NET framework: http://msdn.microsoft.com/en-us/library/hfkahe27.aspx

The o3 project looks like it runs under cygwin which is cool and all but every time I've installed cygwin I've run into problems that I don't like dealing with.

@mc007

i like Net even less and a few cygwin linked files in the distro are not a problem at all. i don´t know what the license impacts are for a cygwin port distribution.

@matthewkastor

Then why not help @shtylman get the last few tests to pass in the vendor-src branch? He's got everything about finished. Starting over with some "oh by the way install cygwin" stuff isn't really any better than "hey this only works on linux". ??? Shtylman put in all the difficult work and only asked for someone to tweak the last few tests until everything passes on windows, linux, etc. No need to scrap all that! :D

@polotek
Owner

@shtylman I keep forgetting about your vendor-src branch. So the only thing keeping you from shipping it is having some people more familiar with windows try it out? I understand there are remaining bugs, but what do you think of shipping an RC version into npm? I think you can do this by adding a "-rc1" or something to the end of the semver (make sure it starts with an alpha and not a number). That's a tagged version. It won't be fetched by a simple install, but you can point people at it and have them fetch it directly to check out. Check out npm info semver to see the actual rules around tag versions.

@defunctzombie
Collaborator
@defunctzombie
Collaborator

Ok. For those still interested in windows support please try the following

npm install polotek/libxmljs#vendor-src

This should compile and be usable on windows. The vendor-src branch passes all tests on all of my systems (osX, Linux, and Win)

Please report if this works for you.

@defunctzombie
Collaborator

landed in 0.8.0

@mzgol

It still doesn't build for me on Windows. I've tried on a 64-bit Windows 7 using Git-Bash; I get this:

45226 info libxmljs@0.8.1 Failed to exec install script
45227 info d:\polona-gui\node_modules\libxmljs unbuild
45228 info preuninstall libxmljs@0.8.1
45229 verbose unsafe-perm in lifecycle true
45230 info uninstall libxmljs@0.8.1
45231 verbose true,d:\polona-gui\node_modules,d:\polona-gui\node_modules unbuild
 libxmljs@0.8.1
45232 info postuninstall libxmljs@0.8.1
45233 error libxmljs@0.8.1 install: `node-gyp rebuild`
45233 error Exit status 1
45234 error Failed at the libxmljs@0.8.1 install script.
45234 error This is most likely a problem with the libxmljs package,
45234 error not with npm itself.
45234 error Tell the author that this fails on your system:
45234 error     node-gyp rebuild
45234 error You can get their info via:
45234 error     npm owner ls libxmljs
45234 error There is likely additional logging output above.
45235 error System Windows_NT 6.1.7601
45236 error command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\no
dejs\\node_modules\\npm\\bin\\npm-cli.js" "i"
45237 error cwd d:\polona-gui
45238 error node -v v0.10.25
45239 error npm -v 1.3.24
45240 error code ELIFECYCLE
45241 verbose exit [ 1, true ]

EDIT: it seems I have to install some Visual C++ components, heh...

EDIT2: I had to install libxmljs manually via:

npm install libxmljs@0.8.1 --msvs_version=2012

This is far from ideal and makes it impossible to install libxmljs as a dependency. Is there any way to resolve this problem?

@q00u

What happened to the vendor-src branch?

@dragonbanshee

I don't know how relevant this is anymore, but running Windows 8.1 and Node 0.12.0, I am able to install this package via npm without any errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.