microsoft / vcpkg

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

Building libpq:x64-windows failed #24495

Closed Chaojimengnan closed 2 years ago

Chaojimengnan commented 2 years ago

Host Environment

To Reproduce Steps to reproduce the behavior: vcpkg install qttools:x64-windows

Failure logs

Terminal output

PS C:\Users\22502\Desktop> vcpkg install qttools:x64-windows
Computing installation plan...
The following packages will be built and installed:
  * libpq[core,lz4,openssl,zlib]:x64-windows -> 14.1#1
  * pcre2[core]:x64-windows -> 10.39#2
  * qtbase[brotli,concurrent,core,dbus,default-features,doubleconversion,freetype,gui,harfbuzz,icu,jpeg,network,openssl,pcre2,png,sql,sql-psql,sql-sqlite,testlib,widgets,zstd]:x64-windows -> 6.3.0
    qttools[assistant,core,designer,linguist]:x64-windows -> 6.3.0
  * sqlite3[core]:x64-windows -> 3.37.2#1
  * zstd[core]:x64-windows -> 1.5.2#1
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-windows...
-- Using HTTP(S)_PROXY in environment variables.
Restored 0 packages from C:\Users\22502\AppData\Local\vcpkg\archives in 387.9 us. Use --debug to see more details.
Starting package 1/6: libpq:x64-windows
Building package libpq[core,lz4,openssl,zlib]:x64-windows...
-- Using cached postgresql-14.1.tar.bz2.
-- Cleaning sources at D:/base/vcpkg/buildtrees/libpq/src/tgresql-14-c37ae306a3.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source D:/base/vcpkg/downloads/postgresql-14.1.tar.bz2
-- Applying patch patches/windows/install.patch
-- Applying patch patches/windows/win_bison_flex.patch
-- Applying patch patches/windows/openssl_exe_path.patch
-- Applying patch patches/windows/Solution.patch
-- Applying patch patches/windows/MSBuildProject_fix_gendef_perl.patch
-- Applying patch patches/windows/msgfmt.patch
-- Applying patch patches/windows/python_lib.patch
-- Applying patch patches/windows/fix-compile-flag-Zi.patch
-- Applying patch patches/windows/tcl_version.patch
-- Applying patch patches/fix-configure.patch
-- Applying patch patches/windows/minimize_install.patch
-- Using source at D:/base/vcpkg/buildtrees/libpq/src/tgresql-14-c37ae306a3.clean
-- Copying libpq source files to D:/base/vcpkg/buildtrees/libpq/x64-windows-rel...
-- Copying libpq source files... done
CMake Deprecation Warning at scripts/ports.cmake:75 (message):
  vcpkg_apply_patches has been deprecated in favor of the `PATCHES` argument
  to `vcpkg_from_*`.
Call Stack (most recent call first):
  scripts/cmake/vcpkg_apply_patches.cmake:18 (z_vcpkg_deprecation_message)
  ports/libpq/portfile.cmake:132 (vcpkg_apply_patches)
  scripts/ports.cmake:145 (include)

-- Applying patch patches/windows/Solution_RELEASE.patch
-- Applying patch patches/windows/python3_build_RELEASE.patch
-- Patches applied!
-- Building libpq x64-windows-RELEASE...
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:128 (message):
    Command failed: D:/base/vcpkg/downloads/tools/perl/5.32.1.1/perl/bin/perl.exe build.pl RELEASE libpq
    Working Directory: D:/base/vcpkg/buildtrees/libpq/x64-windows-rel/src/tools/msvc
    Error code: 1
    See logs for more information:
      D:\base\vcpkg\buildtrees\libpq\build-libpq-x64-windows-RELEASE-out.log
      D:\base\vcpkg\buildtrees\libpq\build-libpq-x64-windows-RELEASE-err.log

Call Stack (most recent call first):
  ports/libpq/portfile.cmake:229 (vcpkg_execute_required_process)
  scripts/ports.cmake:145 (include)

error: building libpq:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles 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+libpq
You can submit a new issue at:
  https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[libpq]+Build+error
including:
  package: libpq[core,lz4,openssl,zlib]:x64-windows -> 14.1#1
    vcpkg-tool version: 2022-03-30-692785ac944e81417840c6de244fb3e18a4b35eb
    vcpkg-scripts version: c8a56fdc1 2022-04-29 (30 hours ago)

Additionally, attach any relevant sections from the log files above

build-libpq-x64-windows-RELEASE-out.log:

Detected hardware platform: Unknown
Generating win32ver.rc for src/backend
Generating win32ver.rc for src/timezone
Generating win32ver.rc for src/backend/snowball
Generating win32ver.rc for src/pl/plpgsql/src
Generating win32ver.rc for src/interfaces/libpq
Generating win32ver.rc for src/backend/replication/libpqwalreceiver
Generating win32ver.rc for src/backend/replication/pgoutput
Generating win32ver.rc for src/interfaces/ecpg/pgtypeslib
Generating win32ver.rc for src/interfaces/ecpg/ecpglib
Generating win32ver.rc for src/interfaces/ecpg/compatlib
Generating win32ver.rc for src/interfaces/ecpg/preproc
Generating win32ver.rc for src/interfaces/ecpg/test
Generating win32ver.rc for src/test/isolation
Generating win32ver.rc for src/bin/initdb
Generating win32ver.rc for src/bin/pgbench
Files src/bin/pgbench/exprscan.l
Files src/bin/pgbench/exprparse.y
Generating win32ver.rc for src/bin/pg_amcheck
Generating win32ver.rc for src/bin/pg_archivecleanup
Generating win32ver.rc for src/bin/pg_checksums
Generating win32ver.rc for src/bin/pg_config
Generating win32ver.rc for src/bin/pg_controldata
Generating win32ver.rc for src/bin/pg_ctl
Generating win32ver.rc for src/bin/pg_resetwal
Generating win32ver.rc for src/bin/pg_test_fsync
Generating win32ver.rc for src/bin/pg_test_timing
Generating win32ver.rc for src/bin/pg_upgrade
Generating win32ver.rc for src/bin/pg_verifybackup
Generating win32ver.rc for src/bin/psql
Files src/bin/psql/psqlscanslash.l
Generating win32ver.rc for src/bin/pg_basebackup
Generating win32ver.rc for src/bin/pg_rewind
Generating win32ver.rc for src/bin/pgevent
Generating win32ver.rc for src/bin/pg_dump
Generating win32ver.rc for contrib/pgcrypto
Generating win32ver.rc for contrib/adminpack
Generating win32ver.rc for contrib/amcheck
Generating win32ver.rc for contrib/auth_delay
Generating win32ver.rc for contrib/auto_explain
Generating win32ver.rc for contrib/bloom
Generating win32ver.rc for contrib/btree_gin
Generating win32ver.rc for contrib/btree_gist
Generating win32ver.rc for contrib/citext
Generating win32ver.rc for contrib/cube
Files contrib/cube/cubescan.l
Files contrib/cube/cubeparse.y
Generating win32ver.rc for contrib/dblink
Generating win32ver.rc for contrib/dict_int
Generating win32ver.rc for contrib/dict_xsyn
Generating win32ver.rc for contrib/earthdistance
Generating win32ver.rc for contrib/file_fdw
Generating win32ver.rc for contrib/fuzzystrmatch
Generating win32ver.rc for contrib/hstore
Generating win32ver.rc for contrib/intarray
Generating win32ver.rc for contrib/isn
Generating win32ver.rc for contrib/lo
Generating win32ver.rc for contrib/ltree
Generating win32ver.rc for contrib/oid2name
Generating win32ver.rc for contrib/old_snapshot
Generating win32ver.rc for contrib/pageinspect
Generating win32ver.rc for contrib/passwordcheck
Generating win32ver.rc for contrib/pgrowlocks
Generating win32ver.rc for contrib/pgstattuple
Generating win32ver.rc for contrib/pg_buffercache
Generating win32ver.rc for contrib/pg_freespacemap
Generating win32ver.rc for contrib/pg_prewarm
Generating win32ver.rc for contrib/pg_stat_statements
Generating win32ver.rc for contrib/pg_surgery
Generating win32ver.rc for contrib/pg_trgm
Generating win32ver.rc for contrib/pg_visibility
Generating win32ver.rc for contrib/postgres_fdw
Generating win32ver.rc for contrib/seg
Files contrib/seg/segscan.l
Files contrib/seg/segparse.y
Generating win32ver.rc for contrib/spi
Generating win32ver.rc for contrib/sslinfo
Generating win32ver.rc for contrib/tablefunc
Generating win32ver.rc for contrib/tcn
Generating win32ver.rc for contrib/test_decoding
Generating win32ver.rc for contrib/tsm_system_rows
Generating win32ver.rc for contrib/tsm_system_time
Generating win32ver.rc for contrib/unaccent
Generating win32ver.rc for contrib/vacuumlo
Generating win32ver.rc for src/test/modules/delay_execution
Generating win32ver.rc for src/test/modules/dummy_index_am
Generating win32ver.rc for src/test/modules/dummy_seclabel
Generating win32ver.rc for src/test/modules/libpq_pipeline
Generating win32ver.rc for src/test/modules/plsample
Generating win32ver.rc for src/test/modules/spgist_name_ops
Generating win32ver.rc for src/test/modules/ssl_passphrase_callback
Generating win32ver.rc for src/test/modules/test_bloomfilter
Generating win32ver.rc for src/test/modules/test_ddl_deparse
Generating win32ver.rc for src/test/modules/test_ginpostinglist
Generating win32ver.rc for src/test/modules/test_integerset
Generating win32ver.rc for src/test/modules/test_parser
Generating win32ver.rc for src/test/modules/test_predtest
Generating win32ver.rc for src/test/modules/test_rbtree
Generating win32ver.rc for src/test/modules/test_regex
Generating win32ver.rc for src/test/modules/test_rls_hooks
Generating win32ver.rc for src/test/modules/test_shm_mq
Generating win32ver.rc for src/test/modules/worker_spi
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/cyrillic_and_mic
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/euc_cn_and_mic
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/euc_jp_and_sjis
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/euc_kr_and_mic
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/euc_tw_and_big5
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/latin2_and_win1250
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/latin_and_mic
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/utf8_and_big5
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/utf8_and_cyrillic
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/utf8_and_euc_cn
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/utf8_and_euc_jp
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/utf8_and_euc_kr
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/utf8_and_euc_tw
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/utf8_and_gb18030
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/utf8_and_gbk
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/utf8_and_iso8859
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/utf8_and_johab
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/utf8_and_sjis
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/utf8_and_win
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/utf8_and_uhc
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/utf8_and_euc2004
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/utf8_and_sjis2004
Generating win32ver.rc for src/backend/utils/mb/conversion_procs/euc2004_sjis2004
Generating win32ver.rc for src/bin/scripts
Generating win32ver.rc for src/test/regress
Generating win32ver.rc for src/bin/pg_waldump
Copying pg_config_os.h...
Generating configuration headers...
Generating src/interfaces/libpq/libpqdll.def...
Generating src/interfaces/ecpg/ecpglib/ecpglib.def...
Generating src/interfaces/ecpg/compatlib/compatlib.def...
Generating src/interfaces/ecpg/pgtypeslib/pgtypeslib.def...
Generating lwlocknames.c and lwlocknames.h...
Generating probes.h...
Generating errcodes.h...
Generating plerrcodes.h...
Generating sql_help.h...
Generating kwlist_d.h...
Generating pl_reserved_kwlist_d.h and pl_unreserved_kwlist_d.h...
Generating c_kwlist_d.h and ecpg_kwlist_d.h...
Generating preproc.y...
Generating pg_config_paths.h...
用于 .NET Framework 的 Microsoft (R) 生成引擎版本 17.1.0+ae57d105c
版权所有(C) Microsoft Corporation。保留所有权利。

生成启动时间为 2022/5/1 18:05:44。
     1>节点 1 上的项目“D:\base\vcpkg\buildtrees\libpq\x64-windows-rel\libpq.vcxproj”(默认目标)。
     1>项目“D:\base\vcpkg\buildtrees\libpq\x64-windows-rel\libpq.vcxproj”(1)正在节点 1 上生成“D:\base\vcpkg\buildtrees\libpq\x64-windows-rel\libpgcommon.vcxproj”(2) (默认目标)。
     2>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(437,5): error MSB8013: 此项目不包含配置和平台组合 Release|x64。 [D:\base\vcpkg\buildtrees\libpq\x64-windows-rel\libpgcommon.vcxproj]
     2>已完成生成项目“D:\base\vcpkg\buildtrees\libpq\x64-windows-rel\libpgcommon.vcxproj”(默认目标)的操作 - 失败。
     1>项目“D:\base\vcpkg\buildtrees\libpq\x64-windows-rel\libpq.vcxproj”(1)正在节点 2 上生成“D:\base\vcpkg\buildtrees\libpq\x64-windows-rel\libpgport.vcxproj”(3) (默认目标)。
     3>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(437,5): error MSB8013: 此项目不包含配置和平台组合 Release|x64。 [D:\base\vcpkg\buildtrees\libpq\x64-windows-rel\libpgport.vcxproj]
     3>已完成生成项目“D:\base\vcpkg\buildtrees\libpq\x64-windows-rel\libpgport.vcxproj”(默认目标)的操作 - 失败。
     1>已完成生成项目“D:\base\vcpkg\buildtrees\libpq\x64-windows-rel\libpq.vcxproj”(默认目标)的操作 - 失败。

生成失败。

       “D:\base\vcpkg\buildtrees\libpq\x64-windows-rel\libpq.vcxproj”(默认目标) (1) ->
       “D:\base\vcpkg\buildtrees\libpq\x64-windows-rel\libpgcommon.vcxproj”(默认目标) (2) ->
       (PrepareForBuild 目标) -> 
         C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(437,5): error MSB8013: 此项目不包含配置和平台组合 Release|x64。 [D:\base\vcpkg\buildtrees\libpq\x64-windows-rel\libpgcommon.vcxproj]

       “D:\base\vcpkg\buildtrees\libpq\x64-windows-rel\libpq.vcxproj”(默认目标) (1) ->
       “D:\base\vcpkg\buildtrees\libpq\x64-windows-rel\libpgport.vcxproj”(默认目标) (3) ->
         C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(437,5): error MSB8013: 此项目不包含配置和平台组合 Release|x64。 [D:\base\vcpkg\buildtrees\libpq\x64-windows-rel\libpgport.vcxproj]

    0 个警告
    2 个错误

已用时间 00:00:00.36

build-libpq-x64-windows-RELEASE-err.log

The determined version of Visual Studio is newer than the latest supported version. Returning the latest supported version instead. at D:/base/vcpkg/buildtrees/libpq/x64-windows-rel/src/tools/msvc/Mkvcbuild.pm line 101.

Additional context

I have installed Qt6 before using vcpkg and did not have problems, also using vs2022. According to the error message, it seems that my VS version is too high? But I don't know what to do.

JackBoosY commented 2 years ago

Can you please confirm that you've installed the English Language package using Visual Studio Installer?

Thanks.

Chaojimengnan commented 2 years ago

Thanks for your reply, I didn't realize it was a language pack issue. The problem is finally solved, thanks!!!

995939901 commented 1 year ago

谢谢! (通过Visual Studio Installer下载 英语语言包解决了这个问题 ,好坑啊!) @JackBoosY Thanks! (The Visual Studio installer solves this problem by downloading the English language package, which is great

JackBoosY commented 1 year ago

谢谢! (通过Visual Studio Installer下载 英语语言包解决了这个问题 ,好坑啊!) @JackBoosY Thanks! (The Visual Studio installer solves this problem by downloading the English language package, which is great

没办法,目前有一部分代码需要解析cl的返回信息,cmake部分也有个需要英文信息的,所以不装英文包不行。