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
[SR-15203] Building Swift toolchain on Windows fails with "no libxml2" #57525
Comments
Comment by Stefan Springer (JIRA) I tried again with a configuration matching very close the one given on https://github.com/apple/swift/blob/main/docs/WindowsBuild.md (also with CMAKE_BUILD_TYPE=Release this time):
The only difference to the configuration given on https://github.com/apple/swift/blob/main/docs/WindowsBuild.md is the addition of the following lines:
I also reduced the additions to the PATH environment variable to a minimum:
(So no paths to an existing Swift installation etc.) Further, Python files are associated with py.exe installed by pylauncher (https://bitbucket.org/vinay.sajip/pylauncher/downloads/). No further configuration besides the ones listed on https://github.com/apple/swift/blob/main/docs/WindowsBuild.md. The current error message (practically the same as the old one above):
UPDATE: Bringing back those three lines with LIBXML2_... on that basis does not help, still the same "no libxml2" error on [4196/6194]. I do not think I can variate much more. Please help. Thanks. |
Comment by Stefan Springer (JIRA) See attached my log from the configuration step (last version). conf.log |
Comment by Stefan Springer (JIRA) UPDATE: Without the following lines, the "no libxml2" error already comes earlier at "[10/1997]":
|
Comment by Stefan Springer (JIRA) RESOLVED: The commands listed under "One-time Setup (re-run on Visual Studio upgrades)" on https://github.com/apple/swift/blob/main/docs/WindowsBuild.md did not work, because – of course – making a symbolic link does not work if at the path of the link file a file already exists, you need to delete it first. Unfortunately, it did not see the error message. I now use the the following commands instead (not all deletions are actually needed, only two of them):
|
This seems like a setup issue, not an actual issue with the tooling. |
Comment by Stefan Springer (JIRA)
On https://github.com/stefanspringer1/BuildingSwiftOnWindows.git, I documented the exact steps I have done on a fresh Windows installation, it is basically what https://github.com/apple/swift/blob/main/docs/WindowsBuild.md says but with some checks and correction, incorporating the problems I had and described on https://forums.swift.org/t/swift-package-manager-spm-still-not-working-on-windows/51388. It might be a setup problem but that is exactly what all this is about: Trying to describe the steps that are necessary for the Swift toolchain to be built. The description on https://github.com/apple/swift/blob/main/docs/WindowsBuild.md is at least uncomplete. The configuration step says: ```text
I am willing to see and try what works and maybe enhance the description or complete my description for the may less experts. I think it is a real problem if the description for building the Swift toolchain is not enough for the "average" person to really execute it, and just to close this bug is not a solution. |
Attachment: Download
Environment
Windows Home 64 Bit running in a Parallels VM, using sources checkout-out with tag "5.4.3-RELEASE".
Additional Detail from JIRA
md5: 384aed368c84597fa826fac5e2b93688
Issue Description:
UPDATE: Issue resolved see my comment "RESOLVED: ..." from Sep. 18, 2021. (The instructions on https://github.com/apple/swift/blob/main/docs/WindowsBuild.md should be improved accordingly.)
UPDATE 2: No, I had to change from VS 2022 to VS 2019 because of a "expected Clang 12.0.0 or newer" error, and there it is again, the old "no libxml2" error despite of correct copying of the files. Note: I had to use MSVC\14.29.30133, because using Windows10SDK.17763 what only work without "Universal Windows App Development", as on https://github.com/apple/swift/blob/main/docs/WindowsBuild.md is listed as necessary. But maybe I just remove "Universal Windows App Development" and try again with Windows10SDK.17763.
When trying to build the Swift toolchain, the test for Clang ends with an "no libxml2" error:
I am using libxml2 from https://github.com/stefanspringer1/Libxml2Validation.git (which is quite a current compilation, from this year), checked-out to `S:\Library\Libxml2Validation`, and `S:\Library\Libxml2Validation\Binaries\Windows.Intel` containing `libxml2.lib` and the DLLs added to the PATH environment variable, my command for building the whole toolchain is:
With `-D LIBXML2_LIBRARY` and `-D LIBXML2_INCLUDE_DIR` and the addition to PATH I could resolve another "no libxml2" error at an earlier step, I got `-D LIBXML2_LIBRARY` and `-D LIBXML2_INCLUDE_DIR` from https://github.com/apple/swift/blob/main/docs/WindowsBuild.md under "Build swift-corelibs-foundation", was was not sure about whether to also add the `-D LIBXML2_DEFINITIONS="/DLIBXML_STATIC"` (got one message about that something is not static when using it).
I am also not sure about how really use the stuff in `S:\Library`, if more should be added to PATH.
(On the good side: it is "[4149/6194]", so I have already come a long way, cf. https://forums.swift.org/t/swift-package-manager-spm-still-not-working-on-windows/51388/38, it would be nice if I get the building done, many thanks in advance.)
The text was updated successfully, but these errors were encountered: