Skip to content
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

[zlib] AppVeyor build failure #13105

Closed
Hoikas opened this issue Aug 24, 2020 · 18 comments · Fixed by #13537
Closed

[zlib] AppVeyor build failure #13105

Hoikas opened this issue Aug 24, 2020 · 18 comments · Fixed by #13537
Assignees
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) requires:repro The issue is not currently repro-able

Comments

@Hoikas
Copy link
Contributor

Hoikas commented Aug 24, 2020

Host Environment

  • OS: AppVeyor Visual Studio 2017 Image
  • Compiler: Visual Studio 2017

To Reproduce
Execute ./vcpkg install zlib on the AppVeyor Visual Studio 2017 image.

Failure logs

-- Downloading http://www.zlib.net/zlib-1.2.11.tar.gz...
-- Extracting source C:/tools/vcpkg/downloads/zlib1211.tar.gz
-- Applying patch cmake_dont_build_more_than_needed.patch
-- Applying patch 0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch
-- Applying patch add_debug_postfix_on_mingw.patch
-- Using source at C:/tools/vcpkg/buildtrees/zlib/src/1.2.11-63309e48e5.clean
-- Configuring x86-windows
-- Building x86-windows-dbg
-- Building x86-windows-rel
-- Downloading https://repo.msys2.org/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-1-any.pkg.tar.xz...
-- Downloading https://repo.msys2.org/mingw/i686/mingw-w64-i686-libwinpthread-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst...
-- Fixing pkgconfig file: C:/tools/vcpkg/packages/zlib_x86-windows/lib/pkgconfig/zlib.pc
-- Fixing pkgconfig file: C:/tools/vcpkg/packages/zlib_x86-windows/debug/lib/pkgconfig/zlib.pc
-- CHECK_LIB_zlibd_DEBUG:CHECK_LIB_zlibd_DEBUG-NOTFOUND
CMake Error at scripts/cmake/vcpkg_fixup_pkgconfig.cmake:232 (message):
  Library "zlibd" was not found! If it is a system library use the
  SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise,
  correct the *.pc file
Call Stack (most recent call first):
  scripts/cmake/vcpkg_fixup_pkgconfig.cmake:329 (vcpkg_fixup_pkgconfig_check_files)
  ports/zlib/portfile.cmake:48 (vcpkg_fixup_pkgconfig)
  scripts/ports.cmake:79 (include)
Error: Building package zlib:x86-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: zlib:x86-windows
  Vcpkg version: 2020.06.15-nohash
Additionally, attach any relevant sections from the log files above.
Failed to build static libs

Additional context
This works on my local machine with Visual Studio 2019. Here is an example appveyor.yml file and here is an example of a failing build.

@JackBoosY JackBoosY added the requires:repro The issue is not currently repro-able label Aug 24, 2020
@JackBoosY
Copy link
Contributor

Hi @Hoikas, thanks for reporting this issue!
Can you list the files in VCPKG_ROOT/packages/zlib_x86-windows?

Thanks.

@JackBoosY JackBoosY added the requires:more-information This Issue requires more information to solve label Aug 24, 2020
@JackBoosY
Copy link
Contributor

And please make sure your vcpkg is latest,

@Hoikas
Copy link
Contributor Author

Hoikas commented Aug 24, 2020

Each time CI is run, we always pull the latest commit from Microsoft/vcpkg/master. Here is a list of the files in VCPKG_ROOT/packages/zlib_x86-windows:

PS C:\Tools\vcpkg\packages\zlib_x86-windows> ls -r


    Directory: C:\Tools\vcpkg\packages\zlib_x86-windows

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----         8/24/2020  6:05 AM                bin
d-----         8/24/2020  6:05 AM                debug
d-----         8/24/2020  6:05 AM                include
d-----         8/24/2020  6:05 AM                lib
d-----         8/24/2020  6:05 AM                share

    Directory: C:\Tools\vcpkg\packages\zlib_x86-windows\bin

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----         8/24/2020  6:05 AM          73216 zlib1.dll

    Directory: C:\Tools\vcpkg\packages\zlib_x86-windows\debug

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----         8/24/2020  6:05 AM                bin
d-----         8/24/2020  6:05 AM                lib

    Directory: C:\Tools\vcpkg\packages\zlib_x86-windows\debug\bin

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----         8/24/2020  6:05 AM         156160 zlibd1.dll

    Directory: C:\Tools\vcpkg\packages\zlib_x86-windows\debug\lib

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----         8/24/2020  6:05 AM                pkgconfig
-a----         8/24/2020  6:05 AM          16842 zlibd.lib

    Directory: C:\Tools\vcpkg\packages\zlib_x86-windows\debug\lib\pkgconfig

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----         8/24/2020  6:05 AM            444 zlib.pc

    Directory: C:\Tools\vcpkg\packages\zlib_x86-windows\include

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----         8/24/2020  6:05 AM          17151 zconf.h
-a----         1/15/2017  5:29 PM          96239 zlib.h

    Directory: C:\Tools\vcpkg\packages\zlib_x86-windows\lib

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----         8/24/2020  6:05 AM                pkgconfig
-a----         8/24/2020  6:05 AM          16734 zlib.lib

    Directory: C:\Tools\vcpkg\packages\zlib_x86-windows\lib\pkgconfig

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----         8/24/2020  6:05 AM            428 zlib.pc

    Directory: C:\Tools\vcpkg\packages\zlib_x86-windows\share

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----         8/24/2020  6:05 AM                zlib

    Directory: C:\Tools\vcpkg\packages\zlib_x86-windows\share\zlib

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----         8/24/2020  6:05 AM           1348 vcpkg_abi_info.txt

@JackBoosY
Copy link
Contributor

@Neumann-A Could you please take a look?

Thanks.

@Neumann-A
Copy link
Contributor

@JackBoosY need output with set(PORT_DEBUG ON) to investigate this further

@JackBoosY
Copy link
Contributor

@Hoikas Please add set(PORT_DEBUG ON) to VCPKG_ROOT/ports/zlib/portfile.cmake line 1, try again and provide the printed message.

Thanks.

@JackBoosY JackBoosY added the requires:more-information This Issue requires more information to solve label Aug 24, 2020
@Hoikas
Copy link
Contributor Author

Hoikas commented Aug 24, 2020

It was easier for me to add it to a custom triplet. This is the output:

Starting package 1/1: zlib:x86-windows-port-debug
Building package zlib[core]:x86-windows-port-debug...
Could not locate cached archive: C:\Users\appveyor\AppData\Local\vcpkg/archives\f7\f7f3dda3fe0b448f9ce50e76c488f38b8ca5fa26.zip
-- Downloading http://www.zlib.net/zlib-1.2.11.tar.gz...
-- Extracting source C:/tools/vcpkg/downloads/zlib1211.tar.gz
-- Applying patch cmake_dont_build_more_than_needed.patch
-- Applying patch 0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch
-- Applying patch add_debug_postfix_on_mingw.patch
-- Using source at C:/tools/vcpkg/buildtrees/zlib/src/1.2.11-63309e48e5.clean
-- Configuring x86-windows-port-debug
-- Building x86-windows-port-debug-dbg
-- Building x86-windows-port-debug-rel
-- Downloading https://repo.msys2.org/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-1-any.pkg.tar.xz...
-- Downloading https://repo.msys2.org/mingw/i686/mingw-w64-i686-libwinpthread-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst...
-- [DEBUG] Using pkg-config from: C:/tools/vcpkg/downloads/tools/pkg-config/0.29.2-1/mingw32/bin/pkg-config.exe
-- [DEBUG] Release Files: C:/tools/vcpkg/packages/zlib_x86-windows-port-debug/lib/pkgconfig/zlib.pc
-- Fixing pkgconfig file: C:/tools/vcpkg/packages/zlib_x86-windows-port-debug/lib/pkgconfig/zlib.pc
-- [DEBUG] Checking package (RELEASE): zlib
-- [DEBUG] pkg-config returned:0
-- [DEBUG] pkg-config output:
-- [DEBUG] pkg-config error output:
-- [DEBUG] pkg-config returned:0
-- [DEBUG] pkg-config output:-LC:/tools/vcpkg/packages/zlib_x86-windows-port-debug/lib -lzlib
-- [DEBUG] pkg-config error output:
-- [DEBUG] pkg-config returned:0
-- [DEBUG] pkg-config output:-LC:/tools/vcpkg/packages/zlib_x86-windows-port-debug/lib
-- [DEBUG] pkg-config error output:
-- [DEBUG] -L LIST TRANSFORMATION:';C:/tools/vcpkg/packages/zlib_x86-windows-port-debug/lib'
-- [DEBUG] REMOVING:'C:/tools/vcpkg/packages/zlib_x86-windows-port-debug/lib'
-- [DEBUG] FROM:'-LC:/tools/vcpkg/packages/zlib_x86-windows-port-debug/lib -lzlib'
-- [DEBUG] LIBS AFTER -L<path> REMOVAL:';-lzlib'
-- [DEBUG] pkg-config output lib paths after replacement (cmake style):C:/tools/vcpkg/packages/zlib_x86-windows-port-debug/lib
-- [DEBUG] pkg-config output lib after replacement (cmake style):-lzlib
-- [DEBUG] IGNORED FLAGS:''
-- [DEBUG] BEFORE IGNORE FLAGS REMOVAL: -lzlib
-- [DEBUG] SYSTEM LIBRARIES:'advapi32;bcrypt;dinput8;gdi32;imm32;oleaut32;ole32;psapi;secur32;setupapi;shell32;shlwapi;strmiids;user32;uuid;version;vfw32;winmm;wsock32;Ws2_32'
-- [DEBUG] LIBRARIES in PC:'-lzlib'
-- [DEBUG] REMOVING:'advapi32'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'bcrypt'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'dinput8'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'gdi32'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'imm32'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'oleaut32'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'ole32'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'psapi'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'secur32'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'setupapi'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'shell32'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'shlwapi'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'strmiids'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'user32'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'uuid'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'version'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'vfw32'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'winmm'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'wsock32'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] REMOVING:'Ws2_32'
-- [DEBUG] FROM:'-lzlib'
-- [DEBUG] AFTER REMOVAL:'-lzlib'
-- [DEBUG] Library search paths:C:/tools/vcpkg/packages/zlib_x86-windows-port-debug/lib
-- [DEBUG] Libraries to search:-lzlib
-- [DEBUG] Library match: CMAKE_MATCH_1:zlib
-- [DEBUG] CHECK_LIB_zlib_RELEASE before: 
-- [DEBUG] CHECK_LIB_zlib_RELEASE after: C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib/zlib.lib
-- [DEBUG] CHECK_LIB_zlib_RELEASE after unset: 
-- [DEBUG] Debug Files: C:/tools/vcpkg/packages/zlib_x86-windows-port-debug/debug/lib/pkgconfig/zlib.pc
-- Fixing pkgconfig file: C:/tools/vcpkg/packages/zlib_x86-windows-port-debug/debug/lib/pkgconfig/zlib.pc
-- [DEBUG] Checking package (DEBUG): zlib
-- [DEBUG] pkg-config returned:0
-- [DEBUG] pkg-config output:
-- [DEBUG] pkg-config error output:
-- [DEBUG] pkg-config returned:0
-- [DEBUG] pkg-config output:-LC:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib -lzlibd
-- [DEBUG] pkg-config error output:
-- [DEBUG] pkg-config returned:0
-- [DEBUG] pkg-config output:-LC:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib
-- [DEBUG] pkg-config error output:
-- [DEBUG] -L LIST TRANSFORMATION:';C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib'
-- [DEBUG] REMOVING:'C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib'
-- [DEBUG] FROM:'-LC:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib -lzlibd'
-- [DEBUG] LIBS AFTER -L<path> REMOVAL:';-lzlibd'
-- [DEBUG] pkg-config output lib paths after replacement (cmake style):C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib
-- [DEBUG] pkg-config output lib after replacement (cmake style):-lzlibd
-- [DEBUG] IGNORED FLAGS:''
-- [DEBUG] BEFORE IGNORE FLAGS REMOVAL: -lzlibd
-- [DEBUG] SYSTEM LIBRARIES:'advapi32;bcrypt;dinput8;gdi32;imm32;oleaut32;ole32;psapi;secur32;setupapi;shell32;shlwapi;strmiids;user32;uuid;version;vfw32;winmm;wsock32;Ws2_32'
-- [DEBUG] LIBRARIES in PC:'-lzlibd'
-- [DEBUG] REMOVING:'advapi32'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'bcrypt'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'dinput8'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'gdi32'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'imm32'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'oleaut32'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'ole32'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'psapi'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'secur32'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'setupapi'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'shell32'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'shlwapi'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'strmiids'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'user32'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'uuid'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'version'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'vfw32'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'winmm'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'wsock32'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] REMOVING:'Ws2_32'
-- [DEBUG] FROM:'-lzlibd'
-- [DEBUG] AFTER REMOVAL:'-lzlibd'
-- [DEBUG] Library search paths:C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib
-- [DEBUG] Libraries to search:-lzlibd
-- [DEBUG] Library match: CMAKE_MATCH_1:zlibd
-- [DEBUG] CHECK_LIB_zlibd_DEBUG before: 
-- [DEBUG] CHECK_LIB_zlibd_DEBUG after: CHECK_LIB_zlibd_DEBUG-NOTFOUND
-- [DEBUG] Searching with additional suffixes: 'd;_d;_debug;-s;-sd;_s;_sd;-static;-staticd;_static;_staticd'
-- [DEBUG] Search name: 'zlibdd'
-- [DEBUG] CHECK_LIB_zlibdd_DEBUG before: 
-- [DEBUG] Search paths:'C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib' 'C:/tools/vcpkg/installed/x86-windows-port-debug/debug/lib'
-- [DEBUG] CHECK_LIB_zlibdd_DEBUG after: CHECK_LIB_zlibdd_DEBUG-NOTFOUND
-- [DEBUG] Search name: 'zlibd_d'
-- [DEBUG] CHECK_LIB_zlibd_d_DEBUG before: 
-- [DEBUG] Search paths:'C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib' 'C:/tools/vcpkg/installed/x86-windows-port-debug/debug/lib'
-- [DEBUG] CHECK_LIB_zlibd_d_DEBUG after: CHECK_LIB_zlibd_d_DEBUG-NOTFOUND
-- [DEBUG] Search name: 'zlibd_debug'
-- [DEBUG] CHECK_LIB_zlibd_debug_DEBUG before: 
-- [DEBUG] Search paths:'C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib' 'C:/tools/vcpkg/installed/x86-windows-port-debug/debug/lib'
-- [DEBUG] CHECK_LIB_zlibd_debug_DEBUG after: CHECK_LIB_zlibd_debug_DEBUG-NOTFOUND
-- [DEBUG] Search name: 'zlibd-s'
-- [DEBUG] CHECK_LIB_zlibd-s_DEBUG before: 
-- [DEBUG] Search paths:'C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib' 'C:/tools/vcpkg/installed/x86-windows-port-debug/debug/lib'
-- [DEBUG] CHECK_LIB_zlibd-s_DEBUG after: CHECK_LIB_zlibd-s_DEBUG-NOTFOUND
-- [DEBUG] Search name: 'zlibd-sd'
-- [DEBUG] CHECK_LIB_zlibd-sd_DEBUG before: 
-- [DEBUG] Search paths:'C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib' 'C:/tools/vcpkg/installed/x86-windows-port-debug/debug/lib'
-- [DEBUG] CHECK_LIB_zlibd-sd_DEBUG after: CHECK_LIB_zlibd-sd_DEBUG-NOTFOUND
-- [DEBUG] Search name: 'zlibd_s'
-- [DEBUG] CHECK_LIB_zlibd_s_DEBUG before: 
-- [DEBUG] Search paths:'C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib' 'C:/tools/vcpkg/installed/x86-windows-port-debug/debug/lib'
-- [DEBUG] CHECK_LIB_zlibd_s_DEBUG after: CHECK_LIB_zlibd_s_DEBUG-NOTFOUND
-- [DEBUG] Search name: 'zlibd_sd'
-- [DEBUG] CHECK_LIB_zlibd_sd_DEBUG before: 
-- [DEBUG] Search paths:'C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib' 'C:/tools/vcpkg/installed/x86-windows-port-debug/debug/lib'
-- [DEBUG] CHECK_LIB_zlibd_sd_DEBUG after: CHECK_LIB_zlibd_sd_DEBUG-NOTFOUND
-- [DEBUG] Search name: 'zlibd-static'
-- [DEBUG] CHECK_LIB_zlibd-static_DEBUG before: 
-- [DEBUG] Search paths:'C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib' 'C:/tools/vcpkg/installed/x86-windows-port-debug/debug/lib'
-- [DEBUG] CHECK_LIB_zlibd-static_DEBUG after: CHECK_LIB_zlibd-static_DEBUG-NOTFOUND
-- [DEBUG] Search name: 'zlibd-staticd'
-- [DEBUG] CHECK_LIB_zlibd-staticd_DEBUG before: 
-- [DEBUG] Search paths:'C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib' 'C:/tools/vcpkg/installed/x86-windows-port-debug/debug/lib'
-- [DEBUG] CHECK_LIB_zlibd-staticd_DEBUG after: CHECK_LIB_zlibd-staticd_DEBUG-NOTFOUND
-- [DEBUG] Search name: 'zlibd_static'
-- [DEBUG] CHECK_LIB_zlibd_static_DEBUG before: 
-- [DEBUG] Search paths:'C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib' 'C:/tools/vcpkg/installed/x86-windows-port-debug/debug/lib'
-- [DEBUG] CHECK_LIB_zlibd_static_DEBUG after: CHECK_LIB_zlibd_static_DEBUG-NOTFOUND
-- [DEBUG] Search name: 'zlibd_staticd'
-- [DEBUG] CHECK_LIB_zlibd_staticd_DEBUG before: 
-- [DEBUG] Search paths:'C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib' 'C:/tools/vcpkg/installed/x86-windows-port-debug/debug/lib'
-- [DEBUG] CHECK_LIB_zlibd_staticd_DEBUG after: CHECK_LIB_zlibd_staticd_DEBUG-NOTFOUND
-- CHECK_LIB_zlibd_DEBUG:CHECK_LIB_zlibd_DEBUG-NOTFOUND
CMake Error at scripts/cmake/vcpkg_fixup_pkgconfig.cmake:232 (message):
  Library "zlibd" was not found! If it is a system library use the
  SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise,
  correct the *.pc file
Call Stack (most recent call first):
  scripts/cmake/vcpkg_fixup_pkgconfig.cmake:329 (vcpkg_fixup_pkgconfig_check_files)
  ports/zlib/portfile.cmake:48 (vcpkg_fixup_pkgconfig)
  scripts/ports.cmake:79 (include)
Error: Building package zlib:x86-windows-port-debug failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: zlib:x86-windows-port-debug
  Vcpkg version: 2020.06.15-nohash
Additionally, attach any relevant sections from the log files above.

@JackBoosY JackBoosY removed the requires:more-information This Issue requires more information to solve label Aug 24, 2020
@fingerecho
Copy link

PS C:\Program Files (x86)\vcpkg> .\vcpkg.exe install drogon
Computing installation plan...
The following packages will be built and installed:

  • brotli[core]:x86-windows
    drogon[core]:x86-windows
  • libmariadb[core,openssl,zlib]:x86-windows
  • libpq[core,openssl,zlib]:x86-windows
  • sqlite3[core]:x86-windows
  • zlib[core]:x86-windows
    Additional packages (*) will be modified to complete this operation.
    Detecting compiler hash for triplet x86-windows...
    Starting package 1/6: brotli:x86-windows
    Building package brotli[core]:x86-windows...
    Could not locate cached archive: C:\Users\86175\AppData\Local\vcpkg/archives\33\33df6148e0d3a06f9b1a6b5bd754e8ad765ae0c9.zip
    -- Using cached C:/Program Files (x86)/vcpkg/downloads/google-brotli-v1.0.7.tar.gz
    -- Cleaning sources at C:/Program Files (x86)/vcpkg/buildtrees/brotli/src/v1.0.7-c2af986dcd.clean. Use --editable to skip cleaning for the packages you specify.
    -- Extracting source C:/Program Files (x86)/vcpkg/downloads/google-brotli-v1.0.7.tar.gz
    -- Applying patch install.patch
    -- Applying patch fix-arm-uwp.patch
    -- Applying patch pkgconfig.patch
    -- Using source at C:/Program Files (x86)/vcpkg/buildtrees/brotli/src/v1.0.7-c2af986dcd.clean
    -- Configuring x86-windows
    -- Building x86-windows-dbg
    -- Building x86-windows-rel
    -- Fixing pkgconfig file: C:/Program Files (x86)/vcpkg/packages/brotli_x86-windows/lib/pkgconfig/libbrotlicommon.pc
    -- Fixing pkgconfig file: C:/Program Files (x86)/vcpkg/packages/brotli_x86-windows/lib/pkgconfig/libbrotlidec.pc
    -- Fixing pkgconfig file: C:/Program Files (x86)/vcpkg/packages/brotli_x86-windows/lib/pkgconfig/libbrotlienc.pc
    -- CHECK_LIB_brotlicommon_RELEASE:CHECK_LIB_brotlicommon_RELEASE-NOTFOUND
    CMake Error at scripts/cmake/vcpkg_fixup_pkgconfig.cmake:232 (message):
    Library "brotlicommon" was not found! If it is a system library use the
    SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise,
    correct the *.pc file
    Call Stack (most recent call first):
    scripts/cmake/vcpkg_fixup_pkgconfig.cmake:298 (vcpkg_fixup_pkgconfig_check_files)
    ports/brotli/portfile.cmake:25 (vcpkg_fixup_pkgconfig)
    scripts/ports.cmake:79 (include)

Error: Building package brotli:x86-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with .\vcpkg update, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
Package: brotli:x86-windows
Vcpkg version: 2020.06.15-nohash

Additionally, attach any relevant sections from the log files above.

@JackBoosY
Copy link
Contributor

@Neumann-A Any ideas?

@Hoikas
Copy link
Contributor Author

Hoikas commented Aug 25, 2020

@fingerecho The brotli package builds correctly on the AppVeyor Visual Studio 2017 image. Please open a new issue as this one is specifically about the build failure of zlib on AppVeyor's Visual Studio 2017 image.

@fingerecho
Copy link

Thank you!

@Neumann-A
Copy link
Contributor

The library search path for zlibd is missing /debug for some reason.

@Neumann-A
Copy link
Contributor

to be clear the following is wrong:
-- [DEBUG] Search paths:'C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib' 'C:/tools/vcpkg/installed/x86-windows-port-debug/debug/lib'

it should be:
-- [DEBUG] Search paths:'C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/debug/lib' 'C:/tools/vcpkg/installed/x86-windows-port-debug/debug/lib'

could you please post the contents of
-- Fixing pkgconfig file: C:/tools/vcpkg/packages/zlib_x86-windows-port-debug/debug/lib/pkgconfig/zlib.pc

@JackBoosY JackBoosY added the category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly label Aug 25, 2020
@Hoikas
Copy link
Contributor Author

Hoikas commented Aug 25, 2020

C:/tools/vcpkg/packages/zlib_x86-windows-port-debug/debug/lib/pkgconfig/zlib.pc:

prefix=C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/debug
exec_prefix=C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/debug
libdir=C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib
sharedlibdir=C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/lib
includedir=C:/Tools/vcpkg/packages/zlib_x86-windows-port-debug/../include

Name: zlib
Description: zlib compression library
Version: 1.2.11

Requires:
Libs: -L${libdir} -L${sharedlibdir} -lzlibd
Cflags: -I${includedir}

I think this has something to do with the environment used by the AppVeyor build agent. When I RDP into the build machine, I can install zlib correctly from either cmd.exe or PowerShell Core 6; it fails from appveyor.yml however. This level of manual intervention is unacceptable in CI, IMO.

@Neumann-A
Copy link
Contributor

@Hoikas:

That clearly indicates that the string replacement failed or wasn't written to the file for some reason.
The relevant code is here:

debug_message("Debug Files: ${_vfpkg_DEBUG_FILES}")
foreach(_file ${_vfpkg_DEBUG_FILES})
message(STATUS "Fixing pkgconfig file: ${_file}")
get_filename_component(PKG_LIB_SEARCH_PATH "${_file}" DIRECTORY)
file(RELATIVE_PATH RELATIVE_PC_PATH "${PKG_LIB_SEARCH_PATH}" "${CURRENT_PACKAGES_DIR}/debug/")
string(REGEX REPLACE "/$" "" RELATIVE_PC_PATH "${RELATIVE_PC_PATH}")
string(REGEX REPLACE "/pkgconfig/?" "" PKG_LIB_SEARCH_PATH "${PKG_LIB_SEARCH_PATH}")
#Correct *.pc file
file(READ "${_file}" _contents)
string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}")
string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}")
string(REPLACE "${_VCPKG_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}")
string(REPLACE "${_VCPKG_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}")
string(REPLACE "debug/include" "../include" _contents "${_contents}")
string(REPLACE "\${prefix}/include" "\${prefix}/../include" _contents "${_contents}")
string(REPLACE "debug/share" "../share" _contents "${_contents}")
string(REPLACE "\${prefix}/share" "\${prefix}/../share" _contents "${_contents}")
string(REPLACE "debug/lib" "lib" _contents "${_contents}") # the prefix will contain the debug keyword
string(REGEX REPLACE "^prefix=(\")?(\\\\)?\\\${prefix}(/debug)?(\")?" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable
string(REGEX REPLACE "[\n]prefix=(\")?(\\\\)?\\\${prefix}(/debug)?(\")?" "\nprefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable
string(REPLACE "\${prefix}/debug" "\${prefix}" _contents "${_contents}") # replace remaining debug paths if they exist.
file(WRITE "${_file}" "${_contents}")
unset(PKG_LIB_SEARCH_PATH)
endforeach()

The only way to currently debug that is to add some message() into that (until #12877 is merged and --trace can be passed to the script call)

@Hoikas
Copy link
Contributor Author

Hoikas commented Aug 25, 2020

I just ran that PR with --trace-expand. Here is the log.

@Neumann-A
Copy link
Contributor

Neumann-A commented Aug 25, 2020

Issue is:
string(REPLACE C:/tools/vcpkg/packages/zlib_x86-windows ${prefix} _contents prefix=C:/Tools/vcpkg/packages/zlib_x86-windows
the substitution fails for both release and debug due to the uppercase T.

@JackBoosY JackBoosY added the category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) label Aug 26, 2020
This was referenced Aug 26, 2020
@PhoebeHui
Copy link
Contributor

Duplicated to #12709

BillyONeal added a commit to BillyONeal/vcpkg that referenced this issue Sep 15, 2020
This is a better solution than that I tried in microsoft#13144 -- rather than trying to cannoicalize the path completely, which would destroy symlinks etc; this form  calls FindFirstFile on each path element to get the real case from the filesystem.

Fixes microsoft#13105.

(Note the wrong case in the CWD in the prompt, but the correct case in all the output:)

PS C:\DeV\vcPKG> .\vcpkg.exe install curl
Computing installation plan...
The following packages will be built and installed:
    curl[core,non-http,schannel,ssl,sspi,winssl]:x86-windows
  * zlib[core]:x86-windows
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x86-windows...
Starting package 1/2: zlib:x86-windows
Building package zlib[core]:x86-windows...
Using cached binary package: C:\Users\billy\AppData\Local\vcpkg/archives\c6\c61dd1bcc23348934c55f4ced77f1e4b0f353394.zipBuilding package zlib[core]:x86-windows... done
Installing package zlib[core]:x86-windows...
Installing package zlib[core]:x86-windows... done
Elapsed time for package zlib:x86-windows: 62.26 ms
Starting package 2/2: curl:x86-windows
Building package curl[core,non-http,schannel,ssl,sspi,winssl]:x86-windows...
Could not locate cached archive: C:\Users\billy\AppData\Local\vcpkg/archives\9f\9fa16d473c9539e9ea7ab3922eff46618f3a4c4b.zip
-- Downloading https://github.com/curl/curl/archive/9d954e49bce3706a9a2efb119ecd05767f0f2a9e.tar.gz...
-- Extracting source C:/Dev/vcpkg/downloads/curl-curl-9d954e49bce3706a9a2efb119ecd05767f0f2a9e.tar.gz
-- Applying patch 0002_fix_uwp.patch
-- Applying patch 0004_nghttp2_staticlib.patch
-- Applying patch 0005_remove_imp_suffix.patch
-- Applying patch 0006_fix_tool_depends.patch
-- Applying patch 0007_disable_tool_export_curl_target.patch
-- Applying patch 0009_fix_openssl_config.patch
-- Applying patch 0010_fix_othertests_cmake.patch
-- Applying patch 0011_fix_static_build.patch
-- Using source at C:/Dev/vcpkg/buildtrees/curl/src/767f0f2a9e-91d24adee1.clean
-- Configuring x86-windows
-- Building x86-windows-dbg
-- Building x86-windows-rel
-- Installing: C:/Dev/vcpkg/packages/curl_x86-windows/share/curl/curl-config
-- Installing: C:/Dev/vcpkg/packages/curl_x86-windows/share/curl/vcpkg-cmake-wrapper.cmake
-- Installing: C:/Dev/vcpkg/packages/curl_x86-windows/share/curl/copyright
-- Performing post-build validation
-- Performing post-build validation done
Stored binary cache: C:\Users\billy\AppData\Local\vcpkg/archives\9f\9fa16d473c9539e9ea7ab3922eff46618f3a4c4b.zip
Building package curl[core,non-http,schannel,ssl,sspi,winssl]:x86-windows... done
Installing package curl[core,non-http,schannel,ssl,sspi,winssl]:x86-windows...
Installing package curl[core,non-http,schannel,ssl,sspi,winssl]:x86-windows... done
Elapsed time for package curl:x86-windows: 1.299 min

Total elapsed time: 1.33 min

The package curl:x86-windows provides CMake targets:

    find_package(CURL CONFIG REQUIRED)
    target_link_libraries(main PRIVATE CURL::libcurl)

PS C:\DeV\vcPKG>
BillyONeal added a commit that referenced this issue Sep 23, 2020
* Fix the case of current_path() before use on Windows.

This is a better solution than that I tried in #13144 -- rather than trying to cannoicalize the path completely, which would destroy symlinks etc; this form  calls FindFirstFile on each path element to get the real case from the filesystem.

Fixes #13105.

(Note the wrong case in the CWD in the prompt, but the correct case in all the output:)

PS C:\DeV\vcPKG> .\vcpkg.exe install curl
Computing installation plan...
The following packages will be built and installed:
    curl[core,non-http,schannel,ssl,sspi,winssl]:x86-windows
  * zlib[core]:x86-windows
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x86-windows...
Starting package 1/2: zlib:x86-windows
Building package zlib[core]:x86-windows...
Using cached binary package: C:\Users\billy\AppData\Local\vcpkg/archives\c6\c61dd1bcc23348934c55f4ced77f1e4b0f353394.zipBuilding package zlib[core]:x86-windows... done
Installing package zlib[core]:x86-windows...
Installing package zlib[core]:x86-windows... done
Elapsed time for package zlib:x86-windows: 62.26 ms
Starting package 2/2: curl:x86-windows
Building package curl[core,non-http,schannel,ssl,sspi,winssl]:x86-windows...
Could not locate cached archive: C:\Users\billy\AppData\Local\vcpkg/archives\9f\9fa16d473c9539e9ea7ab3922eff46618f3a4c4b.zip
-- Downloading https://github.com/curl/curl/archive/9d954e49bce3706a9a2efb119ecd05767f0f2a9e.tar.gz...
-- Extracting source C:/Dev/vcpkg/downloads/curl-curl-9d954e49bce3706a9a2efb119ecd05767f0f2a9e.tar.gz
-- Applying patch 0002_fix_uwp.patch
-- Applying patch 0004_nghttp2_staticlib.patch
-- Applying patch 0005_remove_imp_suffix.patch
-- Applying patch 0006_fix_tool_depends.patch
-- Applying patch 0007_disable_tool_export_curl_target.patch
-- Applying patch 0009_fix_openssl_config.patch
-- Applying patch 0010_fix_othertests_cmake.patch
-- Applying patch 0011_fix_static_build.patch
-- Using source at C:/Dev/vcpkg/buildtrees/curl/src/767f0f2a9e-91d24adee1.clean
-- Configuring x86-windows
-- Building x86-windows-dbg
-- Building x86-windows-rel
-- Installing: C:/Dev/vcpkg/packages/curl_x86-windows/share/curl/curl-config
-- Installing: C:/Dev/vcpkg/packages/curl_x86-windows/share/curl/vcpkg-cmake-wrapper.cmake
-- Installing: C:/Dev/vcpkg/packages/curl_x86-windows/share/curl/copyright
-- Performing post-build validation
-- Performing post-build validation done
Stored binary cache: C:\Users\billy\AppData\Local\vcpkg/archives\9f\9fa16d473c9539e9ea7ab3922eff46618f3a4c4b.zip
Building package curl[core,non-http,schannel,ssl,sspi,winssl]:x86-windows... done
Installing package curl[core,non-http,schannel,ssl,sspi,winssl]:x86-windows...
Installing package curl[core,non-http,schannel,ssl,sspi,winssl]:x86-windows... done
Elapsed time for package curl:x86-windows: 1.299 min

Total elapsed time: 1.33 min

The package curl:x86-windows provides CMake targets:

    find_package(CURL CONFIG REQUIRED)
    target_link_libraries(main PRIVATE CURL::libcurl)

PS C:\DeV\vcPKG>

* Fix *nix builds.

* PR feedback.

* Update toolsrc/src/vcpkg/base/files.cpp

Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com>
strega-nil pushed a commit to strega-nil/vcpkg that referenced this issue May 5, 2021
…oft#13537)

* Fix the case of current_path() before use on Windows.

This is a better solution than that I tried in microsoft#13144 -- rather than trying to cannoicalize the path completely, which would destroy symlinks etc; this form  calls FindFirstFile on each path element to get the real case from the filesystem.

Fixes microsoft#13105.

(Note the wrong case in the CWD in the prompt, but the correct case in all the output:)

PS C:\DeV\vcPKG> .\vcpkg.exe install curl
Computing installation plan...
The following packages will be built and installed:
    curl[core,non-http,schannel,ssl,sspi,winssl]:x86-windows
  * zlib[core]:x86-windows
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x86-windows...
Starting package 1/2: zlib:x86-windows
Building package zlib[core]:x86-windows...
Using cached binary package: C:\Users\billy\AppData\Local\vcpkg/archives\c6\c61dd1bcc23348934c55f4ced77f1e4b0f353394.zipBuilding package zlib[core]:x86-windows... done
Installing package zlib[core]:x86-windows...
Installing package zlib[core]:x86-windows... done
Elapsed time for package zlib:x86-windows: 62.26 ms
Starting package 2/2: curl:x86-windows
Building package curl[core,non-http,schannel,ssl,sspi,winssl]:x86-windows...
Could not locate cached archive: C:\Users\billy\AppData\Local\vcpkg/archives\9f\9fa16d473c9539e9ea7ab3922eff46618f3a4c4b.zip
-- Downloading https://github.com/curl/curl/archive/9d954e49bce3706a9a2efb119ecd05767f0f2a9e.tar.gz...
-- Extracting source C:/Dev/vcpkg/downloads/curl-curl-9d954e49bce3706a9a2efb119ecd05767f0f2a9e.tar.gz
-- Applying patch 0002_fix_uwp.patch
-- Applying patch 0004_nghttp2_staticlib.patch
-- Applying patch 0005_remove_imp_suffix.patch
-- Applying patch 0006_fix_tool_depends.patch
-- Applying patch 0007_disable_tool_export_curl_target.patch
-- Applying patch 0009_fix_openssl_config.patch
-- Applying patch 0010_fix_othertests_cmake.patch
-- Applying patch 0011_fix_static_build.patch
-- Using source at C:/Dev/vcpkg/buildtrees/curl/src/767f0f2a9e-91d24adee1.clean
-- Configuring x86-windows
-- Building x86-windows-dbg
-- Building x86-windows-rel
-- Installing: C:/Dev/vcpkg/packages/curl_x86-windows/share/curl/curl-config
-- Installing: C:/Dev/vcpkg/packages/curl_x86-windows/share/curl/vcpkg-cmake-wrapper.cmake
-- Installing: C:/Dev/vcpkg/packages/curl_x86-windows/share/curl/copyright
-- Performing post-build validation
-- Performing post-build validation done
Stored binary cache: C:\Users\billy\AppData\Local\vcpkg/archives\9f\9fa16d473c9539e9ea7ab3922eff46618f3a4c4b.zip
Building package curl[core,non-http,schannel,ssl,sspi,winssl]:x86-windows... done
Installing package curl[core,non-http,schannel,ssl,sspi,winssl]:x86-windows...
Installing package curl[core,non-http,schannel,ssl,sspi,winssl]:x86-windows... done
Elapsed time for package curl:x86-windows: 1.299 min

Total elapsed time: 1.33 min

The package curl:x86-windows provides CMake targets:

    find_package(CURL CONFIG REQUIRED)
    target_link_libraries(main PRIVATE CURL::libcurl)

PS C:\DeV\vcPKG>

* Fix *nix builds.

* PR feedback.

* Update toolsrc/src/vcpkg/base/files.cpp

Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) requires:repro The issue is not currently repro-able
Projects
None yet
5 participants