Closed lepapareil closed 3 years ago
We had a PR about Windows support so those builds were supposed to have been enabled recently: https://github.com/KWARC/rust-libxml/pull/77
I don't usually develop on Windows so it may take me a bit of time before I diagnose - need to figure out if the crate build regressed, or some other detail is off.
Did you run vcpkg integrate install
and set env VCPKGRS_DYNAMIC
to 1 before?
Did you run
vcpkg integrate install
and set envVCPKGRS_DYNAMIC
to 1 before?
I've just tried it but I have the same result using x86_x64 cross tools command prompt for VS 2019
or cmd
:
>vcpkg integrate install
Applied user-wide integration for this vcpkg root.
All MSBuild C++ projects can now #include any installed libraries.
Linking will be handled automatically.
Installing new libraries will make them instantly available.
CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=C:/Applications/vcpkg/scripts/buildsystems/vcpkg.cmake"
>set VCPKGRS_DYNAMIC=1
>echo %VCPKGRS_DYNAMIC%
1
>cargo clean
>del cargo.lock
>set RUST_BACKTRACE=1
>cargo check --verbose
........
error: failed to run custom build command for `libxml v0.2.15`
Caused by:
process didn't exit successfully: `C:\Applications\hurl\target\debug\build\libxml-19fee8ddbe173fc8\build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Could not find libxml2.', C:\Users\frxn7205\.cargo\registry\src\github.com-1ecc6299db9ec823\libxml-0.2.15\build.rs:16:3
stack backtrace:
0: std::panicking::begin_panic<str*>
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\library\std\src\panicking.rs:521
1: build_script_build::main
at .\build.rs:16
2: core::ops::function::FnOnce::call_once<fn(),tuple<>>
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\library\core\src\ops\function.rs:227
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...
error: build failed
We had a PR about Windows support so those builds were supposed to have been enabled recently:
77
I don't usually develop on Windows so it may take me a bit of time before I diagnose - need to figure out if the crate build regressed, or some other detail is off.
Me neither, my only goal is to get a windows version of my application. I tried cross platform compilation from linux without success. So I have to do it on a windows directly :)
You are using x86_64 msvc abi, so you need specify vcpkg's target architecture (default is x86-windows).
vcpkg install libxml2:x64-windows
Thanks for helping out here @oiatz , really appreciated! If either of you wants to write a small snippet about windows installation (or link to existing vcpkg docs that explain this), I will be happy to add it to the repo README. Not crucial for me though, I'm mostly happy @lepapareil may have a path to a working installation here.
You are the best @oiatz @dginev ! Finally the libxml compilation works :) Thank you very much for your help, I would never have finished without your answers :)
I have other little problems but I should be able to do it this time :) Thank you again for the speed of your answers :)
Excellent! I will close the issue here then. But my offer to add the installation fine-print to the README stands, it's just that I can't write it myself since I haven't done the Windows install - if anyone feels like it, a comment or a PR are welcome any time.
Excellent! I will close the issue here then. But my offer to add the installation fine-print to the README stands, it's just that I can't write it myself since I haven't done the Windows install - if anyone feels like it, a comment or a PR are welcome any time.
I will re-test the whole procedure and the software to be installed to ensure that the compilation is fully functional under windows. Then I will let you know to integrate it in your doc. :)
Hi @dginev, finally I have finished all my win64 build tests for hurl project. Here are all the steps required to build windows 64bit rust exe that use libxml:
builds tools c++
and english language
by executing https://visualstudio.microsoft.com/fr/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16choco
by executing https://docs.chocolatey.org/en-us/choco/setup (you can install all softwares by yourself but choco is as simple and fast as apt)cmd prompt
with admin
privileges and execute these commands sequentially: C:\> choco install -y curl git unxUtils winlibs-llvm-free
C:\> refreshenv
C:\> %ChocolateyInstall%\bin\curl --output "c:\rustup-init.exe" "https://static.rust-lang.org/rustup/dist/i686-pc-windows-gnu/rustup-init.exe"
C:\> c:\rustup-init.exe -y --default-toolchain stable-x86_64-pc-windows-msvc
C:\> git clone https://github.com/microsoft/vcpkg
C:\> .\vcpkg\bootstrap-vcpkg.bat
C:\> setx /M PATH "%PATH%;c:\vcpkg" && setx VCPKGRS_DYNAMIC "1" /M
C:\> refreshenv
C:\> vcpkg install libxml2:x64-windows
C:\> vcpkg integrate install
C:\> git clone <projectGitUrl>
C:\> cd <projectDir>
C:\> cargo build
enjoy 😄
Hi,
I try to build my application on windows, and during the compilation the libxml compilation fails:
however I installed gcc and the libxml2 on my windows with win-builds and vcpkg:
Can you help me with this? Is it even possible to compile under windows with the use of libxml ?
thks :)