Got BUILD_FAILED error message trying to install zlib with vcpkg and CMake 3.28.0-rc1 or CMake 3.28.0-rc2.
For more details see [zlib] build failure with vcpkg · Issue #34597 · microsoft/vcpkg · GitHub (Resolved by using CMake 3.27.7)
I think there is a regression/incompatible change somewhere because it works with CMake 3.27.7.
Neumann-A
(Alexander Neumann)
October 20, 2023, 4:02pm
2
The problem here ist that vcpkg CI updated to 3.28.0-rc2 is not able to reproduce the observed issue and I was also not able to reproduce the issue on my machine. So something is going on here since there are at least two persons reporting the issue.
Tamis
(Panagiotis Tamtamis)
October 21, 2023, 5:12pm
3
Please see comment at github:
opened 11:39AM - 19 Oct 23 UTC
closed 12:10PM - 20 Oct 23 UTC
category:community-triplet
Hello I am trying to build zlib in my Windows 11 PC but it emits errors.
If I t… ry another package like bzip2 it is working fine. But it fails all the time with the zlib.
**Host Environment**
Host: x64-windows 11
Compiler: Microsoft (R) C/C++ Optimizing Compiler Version 19.38.33126.1 for x64
vcpkg-tool version: git log -1
commit 2815578f4a3486cec24c9b07d17e18e03bbaf667 (HEAD -> master, origin/master, origin/HEAD)
Visual Studio Community Edition 2022 (Preview), 2019, 2017 are installed with C++.
Windows 10 SDK is also install, multiple versions (10.0.14, 15, 16, 17, 18 ...)
RAM: 64GB
**To Reproduce**
.\vcpkg install zlib
**Failure logs**
.\vcpkg install zlib --triplet=x64-windows-vs22
> Computing installation plan...
> The following packages will be built and installed:
> zlib:x64-windows-vs22 -> 1.3
> Detecting compiler hash for triplet x64-windows-vs22...
> Restored 0 package(s) from C:\Users\PTamt\AppData\Local\vcpkg\archives in 74.5 us. Use --debug to see more details.
> Installing 1/1 zlib:x64-windows-vs22...
> Building zlib:x64-windows-vs22...
> -- Using cached madler-zlib-v1.3.tar.gz.
> -- Cleaning sources at C:/Users/PTamt/source/repos/VCPKG/vcpkg/buildtrees/zlib/src/v1.3-8825ee792f.clean. Use --editable to skip cleaning for the packages you specify.
> -- Extracting source C:/Users/PTamt/source/repos/VCPKG/vcpkg/downloads/madler-zlib-v1.3.tar.gz
> -- Applying patch 0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch
> -- Applying patch 0002-skip-building-examples.patch
> -- Applying patch 0003-build-static-or-shared-not-both.patch
> -- Applying patch 0004-android-and-mingw-fixes.patch
> -- Using source at C:/Users/PTamt/source/repos/VCPKG/vcpkg/buildtrees/zlib/src/v1.3-8825ee792f.clean
> -- Found external ninja('1.11.0').
> -- Configuring x64-windows-vs22
> -- Building x64-windows-vs22-dbg
> CMake Warning at scripts/cmake/vcpkg_execute_build_process.cmake:65 (message):
> Please ensure your system has sufficient memory.
> Call Stack (most recent call first):
> installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
> installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
> ports/zlib/portfile.cmake:26 (vcpkg_cmake_install)
> scripts/ports.cmake:168 (include)`
>
>
> -- Restarting build without parallelism
> CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
> Command failed: "C:/Program Files/CMake/bin/cmake.exe" --build . --config Debug --target install -- -v -j33
> Working Directory: C:/Users/PTamt/source/repos/VCPKG/vcpkg/buildtrees/zlib/x64-windows-vs22-dbg
> See logs for more information:
> C:\Users\PTamt\source\repos\VCPKG\vcpkg\buildtrees\zlib\install-x64-windows-vs22-dbg-out.log
> C:\Users\PTamt\source\repos\VCPKG\vcpkg\buildtrees\zlib\install-x64-windows-vs22-dbg-out-1.log
>
> Call Stack (most recent call first):
> installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
> installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
> ports/zlib/portfile.cmake:26 (vcpkg_cmake_install)
> scripts/ports.cmake:168 (include)
>
>
> error: building zlib:x64-windows-vs22 failed with: BUILD_FAILED
> Elapsed time to handle zlib:x64-windows-vs22: 6.9 s
> Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
> Then check for known issues at:
> https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+zlib
> You can submit a new issue at:
> https://github.com/microsoft/vcpkg/issues/new?title=[zlib]+Build+error&body=Copy+issue+body+from+C%3A%2FUsers%2FPTamt%2Fsource%2Frepos%2FVCPKG%2Fvcpkg%2Finstalled%2Fvcpkg%2Fissue_body.md
I also attach the diagnostic logs
C:\Users\PTamt\source\repos\VCPKG\vcpkg\buildtrees\zlib\install-x64-windows-vs22-dbg-out.log
C:\Users\PTamt\source\repos\VCPKG\
[install-x64-windows-vs22-dbg-out-1.log](https://github.com/microsoft/vcpkg/files/13041932/install-x64-windows-vs22-dbg-out-1.log)
[install-x64-windows-vs22-dbg-out.log](https://github.com/microsoft/vcpkg/files/13041927/install-x64-windows-vs22-dbg-out.log)
I tried to run execute the commands stated in the logs by hand:
` C:\Users\PTamt\source\repos\VCPKG\vcpkg\buildtrees\zlib\x64-windows-vs22-dbg> C:/PROGRA~1/CMake/bin/cmcldeps.exe RC C:\Users\PTamt\source\repos\VCPKG\vcpkg\buildtrees\zlib\src\v1.3-8825ee792f.clean\win32\zlib1.rc CMakeFiles\zlib.dir\win32\zlib1.rc.res.d CMakeFiles\zlib.dir\win32\zlib1.rc.res "Note: including file: " "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33126/bin/Hostx64/x64/cl.exe" "C:\PROGRA~2\Windows Kits\10\bin\10.0.22621.0\x64\rc.exe" -DNO_FSEEKO -DZLIB_DLL -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE -I C:\Users\PTamt\source\repos\VCPKG\vcpkg\buildtrees\zlib\src\v1.3-8825ee792f.clean -I C:\Users\PTamt\source\repos\VCPKG\vcpkg\buildtrees\zlib\x64-windows-vs22-dbg -c65001 /DWIN32 -D_DEBUG /fo CMakeFiles\zlib.dir\win32\zlib1.rc.res C:\Users\PTamt\source\repos\VCPKG\vcpkg\buildtrees\zlib\src\v1.3-8825ee792f.clean\win32\zlib1.rc`
output
`cl : Command line warning D9002 : ignoring unknown option '-c65001'
C:\Users\PTamt\source\repos\VCPKG\vcpkg\buildtrees\zlib\src\v1.3-8825ee792f.clean\win32\zlib1.rc(1): fatal error C1083: Cannot open include file: 'winver.h': No such file or directory`
So it seems that `winver.h` seems not to be found. But the file exists in my machine under path:
`C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um`
What it might goes wrong?
Does vcpkg needs any includes in order to work and find that file?
I am at your disposal for any additional logs
I was able to bisect the commit chain and reproduce the issue.
brad.king
(Brad King)
October 23, 2023, 4:11pm
4
For reference, this is now tracked as CMake Issue 25355 .