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

[bzip2:x64-windows] build failure #12649

Closed
ASleepyCat opened this issue Jul 30, 2020 · 8 comments
Closed

[bzip2:x64-windows] build failure #12649

ASleepyCat opened this issue Jul 30, 2020 · 8 comments
Assignees
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly

Comments

@ASleepyCat
Copy link

Host Environment

  • OS: Windows 10
  • Compiler: Microsoft Visual Studio Community 2019 Version 16.6.5

To Reproduce
Steps to reproduce the behavior:
./vcpkg install libarchive[bzip2]:x64-windows

Failure logs

PS D:\Git\unnamed-sdvx-clone> vcpkg install libarchive[bzip2]:x64-windows
Your feedback is important to improve Vcpkg! Please take 3 minutes to complete our survey by running: vcpkg contact --survey
Computing installation plan...
The following packages will be built and installed:
  * bzip2[core]:x64-windows
    libarchive[bzip2,core,libxml2,lz4,lzma,lzo,openssl,zstd]:x64-windows
  * liblzma[core]:x64-windows
  * libxml2[core]:x64-windows
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-windows...
Starting package 1/4: bzip2:x64-windows
Building package bzip2[core]:x64-windows...
Could not locate cached archive: C:\Users\dyeom\AppData\Local\vcpkg\archives\5e\5e6ac1aaa01b56516e190c568eccc654d1dfbed8.zip
-- Using cached C:/vcpkg/downloads/bzip2-1.0.6.tar.gz
-- Cleaning sources at C:/vcpkg/buildtrees/bzip2/src/1.0.6-8838f21f8e.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/vcpkg/downloads/bzip2-1.0.6.tar.gz
-- Applying patch fix-import-export-macros.patch
-- Applying patch fix-windows-include.patch
-- Using source at C:/vcpkg/buildtrees/bzip2/src/1.0.6-8838f21f8e.clean
-- Configuring x64-windows
-- Building x64-windows-dbg
-- Building x64-windows-rel
-- Fixing pkgconfig
CMake Error at scripts/cmake/vcpkg_fixup_pkgconfig.cmake:279 (find_program):
  Could not find PKGCONFIG using the following names: pkg-config
Call Stack (most recent call first):
  ports/bzip2/portfile.cmake:51 (vcpkg_fixup_pkgconfig)
  scripts/ports.cmake:79 (include)


Error: Building package bzip2:x64-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: bzip2:x64-windows
  Vcpkg version: 2020.06.15-nohash

Additionally, attach any relevant sections from the log files above.
PS D:\Git\unnamed-sdvx-clone>

Additional context
Was trying to fix GitHub Actions failing to finish a windows release build workflow and ended up locally reproducing the same error. Did git pull, vcpkg update, and vcpkg upgrade --no-dry-run.

Vcpkg version: 2020.06.15-nohash

@computerquip-work
Copy link

computerquip-work commented Jul 30, 2020

I have this same issue with cpprestsdk which tries to build zlib.

EDIT: For info about my environment, I have VS2019, Git, and that's about it. This was run with vcpkg bootstrapped in a submodule.

$ .\vcpkg\vcpkg.exe install zlib
Computing installation plan...
The following packages will be built and installed:
    zlib[core]:x86-windows
Detecting compiler hash for triplet x86-windows...
Starting package 1/1: zlib:x86-windows
Building package zlib[core]:x86-windows...
Could not locate cached archive: C:\Users\zlund\AppData\Local\vcpkg\archives\f2\f2539dd53d8d74c79f7295dc7fd3e2424b15bdbc.zip
-- Using cached C:/Users/zlund/Projects/fx-wcce-connector/vcpkg/downloads/zlib1211.tar.gz
-- Cleaning sources at C:/Users/zlund/Projects/fx-wcce-connector/vcpkg/buildtrees/zlib/src/1.2.11-deec42f53b.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/Users/zlund/Projects/fx-wcce-connector/vcpkg/downloads/zlib1211.tar.gz
-- Applying patch cmake_dont_build_more_than_needed.patch
-- Using source at C:/Users/zlund/Projects/fx-wcce-connector/vcpkg/buildtrees/zlib/src/1.2.11-deec42f53b.clean
-- Configuring x86-windows
-- Building x86-windows-dbg
-- Building x86-windows-rel
-- Fixing pkgconfig
CMake Error at scripts/cmake/vcpkg_fixup_pkgconfig.cmake:279 (find_program):
  Could not find PKGCONFIG using the following names: pkg-config
Call Stack (most recent call first):
  ports/zlib/portfile.cmake:46 (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

@grebeplusplus
Copy link

It seems that the find_program() call at scripts/cmake/vcpkg_fixup_pkgconfig.cmake:279 is "hard failing" rather than "soft failing" and allowing the fallback behaviour to take over.

As a workaround you can adjust the file as follows:

from:

    if(NOT PKGCONFIG)
        find_program(PKGCONFIG pkg-config PATHS "bin" "/usr/bin" "/usr/local/Cellar/pkg-config/0.29.2_3" REQUIRED)
        if(NOT PKGCONFIG AND CMAKE_HOST_WIN32)
            vcpkg_acquire_msys(MSYS_ROOT PACKAGES pkg-config)
            find_program(PKGCONFIG pkg-config PATHS "${MSYS_ROOT}/usr/bin" REQUIRED)

to:

    if(NOT PKGCONFIG)
        find_program(PKGCONFIG pkg-config PATHS "bin" "/usr/bin" "/usr/local/Cellar/pkg-config/0.29.2_3")
        if(NOT PKGCONFIG AND CMAKE_HOST_WIN32)
            vcpkg_acquire_msys(MSYS_ROOT PACKAGES pkg-config)
            find_program(PKGCONFIG pkg-config PATHS "${MSYS_ROOT}/usr/bin")

@grebeplusplus
Copy link

grebeplusplus commented Jul 30, 2020

As a side note, my system, (despite being windows based) has pkg-config installed to the path. Is the intention here to not trust the user's system on windows?

@StarGate-One
Copy link
Contributor

@grebeplusplus

  • The intention is to provide vcpkg with stable versions of tools/utilities that have been test/verified to work with vcpkg and the ports/features it installs, as some older outdated, alpha or beta builds of the tools/utilities may no longer or not yet be supported.
  • Setting the VCPKG_FORCE_SYSTEM_BINARIES (reference https://vcpkg.readthedocs.io/en/latest/users/config-environment/) will instruct vcpkg to use the locally installed tools/utilities, provided they are installed and can be found by vcpkg.

@StarGate-One
Copy link
Contributor

@ASleepyCat you can also use these temporary fixes listed on issue #12565 (comment), just download the files, rename them without the .txt extension and place them in the <vcpkg-root>\scripts\cmake folder.

@computerquip-work
Copy link

@ASleepyCat you can also use these temporary fixes listed on issue #12565 (comment), just download the files, rename them without the .txt extension and place them in the <vcpkg-root>\scripts\cmake folder.

This appears to work for me for now. Hope a perma fix gets put in soon.

@grebeplusplus
Copy link

grebeplusplus commented Jul 30, 2020

@grebeplusplus

  • The intention is to provide vcpkg with stable versions of tools/utilities that have been test/verified to work with vcpkg and the ports/features it installs, as some older outdated, alpha or beta builds of the tools/utilities may no longer or not yet be supported.
  • Setting the VCPKG_FORCE_SYSTEM_BINARIES (reference https://vcpkg.readthedocs.io/en/latest/users/config-environment/) will instruct vcpkg to use the locally installed tools/utilities, provided they are installed and can be found by vcpkg.

Interesting seeing as the behaviour doesn't quite seem to follow this logic for *nix platforms as the first find puts /usr/bin on the search path. Thank you for the flag though I'll experiment with it sometime :)

@PhoebeHui PhoebeHui self-assigned this Jul 31, 2020
@PhoebeHui PhoebeHui added the category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly label Jul 31, 2020
@PhoebeHui
Copy link
Contributor

This issue would be fixed by PR #12569.

Close this issue as duplicate to #12565.

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
Projects
None yet
Development

No branches or pull requests

5 participants