microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.68k stars 6.27k forks source link

[zlib] build failure #29480

Closed Valentin-Otte closed 1 year ago

Valentin-Otte commented 1 year ago

Hello, I wanted to install the curl package via vcpkg, and while installing some dependencies an error with zlib happened.

Heres some context to reproduce the error:

To get this error i just try this command inside the vcpkg folder:

vcpkg install curl:x64-windows

This tries to do the following:

//-------------------------------------------------------------------------------------------------------------------------------------// Computing installation plan... The following packages will be built and installed: curl[core,non-http,schannel,ssl,sspi]:x64-windows -> 7.87.0#1

Additional packages (*) will be modified to complete this operation. Detecting compiler hash for triplet x64-windows... A suitable version of powershell-core was not found (required v7.2.8) Downloading portable powershell-core 7.2.8... Downloading powershell-core... https://github.com/PowerShell/PowerShell/releases/download/v7.2.8/PowerShell-7.2.8-win-x86.zip->C:\Users\Valentín\vcpkg\downloads\PowerShell-7.2.8-win-x86.zip Downloading https://github.com/PowerShell/PowerShell/releases/download/v7.2.8/PowerShell-7.2.8-win-x86.zip Extracting powershell-core... Restored 0 package(s) from C:\Users\Valentín\AppData\Local\vcpkg\archives in 265.7 us. Use --debug to see more details. Installing 1/4 vcpkg-cmake:x64-windows... Building vcpkg-cmake[core]:x64-windows... -- Installing: C:/Users/Valentín/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg_cmake_configure.cmake -- Installing: C:/Users/Valentín/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg_cmake_build.cmake -- Installing: C:/Users/Valentín/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg_cmake_install.cmake -- Installing: C:/Users/Valentín/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg-port-config.cmake -- Installing: C:/Users/Valentín/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/copyright -- Performing post-build validation A suitable version of 7zip was not found (required v21.7.0) Downloading portable 7zip 21.7.0... Downloading 7zip... https://www.7-zip.org/a/7z2107-extra.7z->C:\Users\Valentín\vcpkg\downloads\7z2107-extra.7z Downloading https://www.7-zip.org/a/7z2107-extra.7z Extracting 7zip... Stored binary cache: "C:\Users\Valentín\AppData\Local\vcpkg\archives\2c\2c48e9b3e4aa6bd05732490f58f67baa6b1041518b5d525c950fc350dbd6eece.zip" Elapsed time to handle vcpkg-cmake:x64-windows: 2.428 s Installing 2/4 vcpkg-cmake-config:x64-windows... Building vcpkg-cmake-config[core]:x64-windows... -- Installing: C:/Users/Valentín/vcpkg/packages/vcpkg-cmake-config_x64-windows/share/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake -- Installing: C:/Users/Valentín/vcpkg/packages/vcpkg-cmake-config_x64-windows/share/vcpkg-cmake-config/vcpkg-port-config.cmake -- Installing: C:/Users/Valentín/vcpkg/packages/vcpkg-cmake-configx64-windows/share/vcpkg-cmake-config/copyright -- Performing post-build validation Stored binary cache: "C:\Users\Valentín\AppData\Local\vcpkg\archives\e7\e765588fd357d36fbe9637ef132f3b64db9ce8a6fb919a585bbb33c17b3a643e.zip" Elapsed time to handle vcpkg-cmake-config:x64-windows: 164.9 ms Installing 3/4 zlib:x64-windows... Building zlib[core]:x64-windows... -- Downloading https://github.com/madler/zlib/archive/v1.2.13.tar.gz -> madler-zlib-v1.2.13.tar.gz... -- Extracting source C:/Users/Valentín/vcpkg/downloads/madler-zlib-v1.2.13.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/Valentín/vcpkg/buildtrees/zlib/src/v1.2.13-f30d2a168d.clean -- Found external ninja('1.11.0'). -- Configuring x64-windows -- Building x64-windows-dbg -- Building x64-windows-rel -- Installing: C:/Users/Valentín/vcpkg/packages/zlib_x64-windows/share/zlib/vcpkg-cmake-wrapper.cmake -- Fixing pkgconfig file: C:/Users/Valentín/vcpkg/packages/zlib_x64-windows/lib/pkgconfig/zlib.pc -- Downloading https://repo.msys2.org/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-3-any.pkg.tar.zst;https://www2.futureware.at/~nickoe/msys2-mirror/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-3-any.pkg.tar.zst;https://mirror.yandex.ru/mirrors/msys2/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-3-any.pkg.tar.zst;https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-3-any.pkg.tar.zst;https://mirrors.ustc.edu.cn/msys2/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-3-any.pkg.tar.zst;https://mirror.bit.edu.cn/msys2/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-3-any.pkg.tar.zst;https://mirror.selfnet.de/msys2/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-3-any.pkg.tar.zst;https://mirrors.sjtug.sjtu.edu.cn/msys2/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-3-any.pkg.tar.zst -> msys-mingw-w64-i686-pkg-config-0.29.2-3-any.pkg.tar.zst... -- Downloading https://repo.msys2.org/mingw/i686/mingw-w64-i686-libwinpthread-git-9.0.0.6373.5be8fcd83-1-any.pkg.tar.zst;https://www2.futureware.at/~nickoe/msys2-mirror/mingw/i686/mingw-w64-i686-libwinpthread-git-9.0.0.6373.5be8fcd83-1-any.pkg.tar.zst;https://mirror.yandex.ru/mirrors/msys2/mingw/i686/mingw-w64-i686-libwinpthread-git-9.0.0.6373.5be8fcd83-1-any.pkg.tar.zst;https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/i686/mingw-w64-i686-libwinpthread-git-9.0.0.6373.5be8fcd83-1-any.pkg.tar.zst;https://mirrors.ustc.edu.cn/msys2/mingw/i686/mingw-w64-i686-libwinpthread-git-9.0.0.6373.5be8fcd83-1-any.pkg.tar.zst;https://mirror.bit.edu.cn/msys2/mingw/i686/mingw-w64-i686-libwinpthread-git-9.0.0.6373.5be8fcd83-1-any.pkg.tar.zst;https://mirror.selfnet.de/msys2/mingw/i686/mingw-w64-i686-libwinpthread-git-9.0.0.6373.5be8fcd83-1-any.pkg.tar.zst;https://mirrors.sjtug.sjtu.edu.cn/msys2/mingw/i686/mingw-w64-i686-libwinpthread-git-9.0.0.6373.5be8fcd83-1-any.pkg.tar.zst -> msys-mingw-w64-i686-libwinpthread-git-9.0.0.6373.5be8fcd83-1-any.pkg.tar.zst... -- Using msys root at C:/Users/Valentín/vcpkg/downloads/tools/msys2/9a1ec3f33446b195 CMake Error at scripts/cmake/vcpkg_fixup_pkgconfig.cmake:135 (message):

C:/Users/Valentín/vcpkg/downloads/tools/msys2/9a1ec3f33446b195/mingw32/bin/pkg-config.exe --exists zlib failed with error code: 1

  ENV{PKG_CONFIG_PATH}: "C:/Users/Valentín/vcpkg/packages/zlib_x64-windows/lib/pkgconfig;C:/Users/Valentín/vcpkg/packages/zlib_x64-windows/share/pkgconfig;C:/Users/Valentín/vcpkg/installed/x64-windows/lib/pkgconfig;C:/Users/Valentín/vcpkg/installed/x64-windows/share/pkgconfig"
  output: Package zlib was not found in the pkg-config search path.

Perhaps you should add the directory containing `zlib.pc'

to the PKG_CONFIG_PATH environment variable

No package 'zlib' found Call Stack (most recent call first): scripts/cmake/vcpkg_fixup_pkgconfig.cmake:200 (z_vcpkg_fixup_pkgconfig_check_files) ports/zlib/portfile.cmake:43 (vcpkg_fixup_pkgconfig) scripts/ports.cmake:147 (include)

error: building zlib:x64-windows failed with: BUILD_FAILED error: 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?template=report-package-build-failure.md&title=[zlib]+Build+error Include '[zlib] Build error' in your bug report title, the following version information in your bug description, and attach any relevant failure logs from above. vcpkg-tool version: 2023-01-24-8a88d63f241d391772fbde69af9cab96c3c64c75 vcpkg-scripts version: 185a7aa23 2023-02-06 (10 minutes ago)

Please use the prefilled template from C:\Users\Valentín\vcpkg\installed\vcpkg\issue_body.md when reporting your issue. //-------------------------------------------------------------------------------------------------------------------------------------// Everything except zlib gets installed properly, I tried some of the recommendations in the following posts:

https://github.com/microsoft/vcpkg/issues/29278 https://github.com/microsoft/vcpkg/issues/29189 https://github.com/microsoft/vcpkg/issues/2895 https://github.com/microsoft/vcpkg/issues/15268 https://github.com/microsoft/vcpkg/issues/13614

I checked the folders given in the PKG_CONFIG_PATH, and the first one contains the zlib.pc. I got the latest versions of everything, so updating vcpkg is not an option. I even tried to cleanly uninstall almost everything needed, and re-installed from scratch.

Any suggestions I should try?

Hope anyone knows how to solve this issue, thanks in advance!

dg0yt commented 1 year ago

C:/Users/Valentín...

I guess it is this letter in your name which breaks some tools when used it is in a file path.

Valentin-Otte commented 1 year ago

That was it, after changing the user name everything worked as it should. Thank you for the fast reply!

bnry1 commented 9 months ago

Hi @Valentin-Otte Can you provide the file offline Now all links are having 404 . Thanks