Skip to content
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 #176

Closed
shimondoodkin opened this issue Dec 20, 2012 · 47 comments
Closed

windows support #176

shimondoodkin opened this issue Dec 20, 2012 · 47 comments

Comments

@shimondoodkin
Copy link

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
Copy link
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
Copy link
Collaborator

polotek commented Dec 20, 2012

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.

@kessler
Copy link

kessler commented Dec 20, 2012

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
Copy link

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. 💃

@kessler
Copy link

kessler commented Dec 22, 2012

@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
Copy link
Author

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

@kessler
Copy link

kessler commented Dec 22, 2012

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

@matthewkastor
Copy link

@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
Copy link

kessler commented Jan 2, 2013

@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
Copy link
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
Copy link

moondev commented Jan 4, 2013

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 link

kessler commented Jan 4, 2013

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
Copy link
Author

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

@kessler
Copy link

kessler commented Jan 4, 2013

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

@kessler
Copy link

kessler commented Jan 4, 2013

@moondev did u manage to fix the include issue?

@moondev
Copy link

moondev commented Jan 4, 2013

@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
Copy link
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
Copy link

kessler commented Jan 4, 2013

@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
Copy link

kessler commented Jan 4, 2013

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

@defunctzombie
Copy link
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 Jan 4, 2013
@moondev
Copy link

moondev commented Jan 4, 2013

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

@kessler
Copy link

kessler commented Jan 4, 2013

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

@polotek
Copy link
Collaborator

polotek commented Jan 4, 2013

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
Copy link

kessler commented Jan 16, 2013

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

@kessler
Copy link

kessler commented Jan 29, 2013

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

@kessler
Copy link

kessler commented Feb 3, 2013

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

@matthewkastor
Copy link

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

@matthewkastor
Copy link

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

@thallium205
Copy link

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
Copy link
Collaborator

polotek commented Apr 9, 2013

@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
Copy link
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
Copy link

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.

@matthewkastor
Copy link

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
Copy link
Collaborator

polotek commented Apr 10, 2013

@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
Copy link
Collaborator

Yep. Basically, there is one function (vargs related or something) that
just needs finalizing on windows and then it is good to go. I have some
time recently and might be vigilant enough to just finish it up and publish
the RC. It is very close already.

On Tue, Apr 9, 2013 at 9:38 PM, Marco Rogers notifications@github.comwrote:

@shtylman https://github.com/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.


Reply to this email directly or view it on GitHubhttps://github.com//issues/176#issuecomment-16150775
.

@defunctzombie
Copy link
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
Copy link
Collaborator

landed in 0.8.0

@mgol
Copy link

mgol commented Feb 10, 2014

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
Copy link

q00u commented Mar 21, 2015

What happened to the vendor-src branch?

@kjsmita6
Copy link

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.

@BHare1985
Copy link

Running Windows 10 and Node 0.12.0 I have to supply --msvs_version=2013

@benoror
Copy link

benoror commented Oct 29, 2015

@BHare1985 where do you make that change? I have a windows setup with compilation issues, I would like to confirm

@BHare1985
Copy link

Execute npm install --msvs_version=2013 .. 2013 works for me because i have visual studio 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

13 participants