-
Notifications
You must be signed in to change notification settings - Fork 38
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
Fails to build on windows #72
Comments
Short answer is that the crate has never been used under windows, so it is expected behavior for it to fail on a first try. I haven't actually even used rust itself under windows, so I wouldn't be able to offer any patches on a short notice. Happy to merge in any PRs that offer upgrades in this direction however, always welcome! |
Thanks, I have no clue why it fails so unfortunately cannot submit any PR. This is the only lib which I found to be working well in case of XML and HTML xpath parsing. Only thing I tried is downloading libxml2 for windows and adding it to path with no luck |
Somehow got it built on windows using MSYS2 and mingw64 , is it possible to statically link libxml2 so that on windows I do not need the libxml2 and its dependecies? |
Good to hear @coding-yogi . And I wouldn't bundle in libxlm2 directly no, definitely not a fan of carrying it around. I am instead waiting on the complete rust transpilation of libxml2 by c2rust. We've had some discussions with them that they may either publish that as a standalone crate or bundle it with this wrapper, when they feel ready, so that may be a roundabout way of getting simpler windows builds. |
Good to know, will close this issue for now |
I've tested rust-libxml built on windows with if pkg_config::find_library("libxml-2.0").is_ok() {
} else if vcpkg::find_package("libxml2").is_ok() {
} else {
panic!("Could not find libxml2")
} |
Hi @simoin , any reason Thanks for sharing! |
I'm using MSVC ABI XD. Vcpkg is a package manager for C and C++ libraries made by MS, so it's easy to integrate with MSVC ABI by And Yes, it's an equivalent alternative.
|
That verbatim change mentioned in the first comment may be a bit heavy, since it means we'll have both I can also do the work myself, but no promises as to when just yet... |
@dginev I haven't had any luck at all getting pkg_config to work on Windows, so I think this would be a big help. I'm not at all familiar with C++ and generating bindings, but I'll try to take a stab the feature guard and see if I can get my project to compile on my windows box. If I can make it work, I'll submit a PR. Should I use this issue or make a new one? |
Feel free to use this one, and thanks for giving it a shot! I'll look into setting up CI for a windows build for the repo, should help maintain both builds operational. |
I worked on it tonight, I have the feature flag working, but a question and an issue:
I also tried it on debian WSL, where those tests pass, but some others fail due to windows line endings...
|
@JoshuaNitschke The reason why failed is that some of those tests are platform-specific. |
add opt in dependency for vcpkg make pkg-config optional but default
@dginev looks like merging didn't close this issue since I failed to tag it properly. |
No worries, will close here as soon as I get the release out 👍 |
Alright, thanks to @JoshuaNitschke we now have a working vcpkg build with OS detection, and I have added an Appveyor build to keep that tested and operational. Thanks to everyone here for pushing for Windows support, it feels great to simply be a facilitator 👍 I've shipped a version |
I am using libxml as a dependency for one of my projects but it fails to build on windows. Any pointers to resolve this issue?
The text was updated successfully, but these errors were encountered: