microsoft / vcpkg

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

[libpq] Build error on x64-windows #39360

Closed CreateDesktop closed 3 months ago

CreateDesktop commented 3 months ago

Copy issue body from D:/dev/vcpkg/installed/vcpkg/issue_body.md

Package: libpq[core,lz4,openssl,zlib]:x64-windows@16.2#1

Host Environment

To Reproduce

vcpkg install libpq Failure logs

-- Using cached postgresql-16.2.tar.bz2.
-- Cleaning sources at D:/dev/vcpkg/buildtrees/libpq/src/tgresql-16-b00fbb6ff2.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source D:/dev/vcpkg/downloads/postgresql-16.2.tar.bz2
-- Applying patch unix/installdirs.patch
-- Applying patch unix/fix-configure.patch
-- Applying patch unix/single-linkage.patch
-- Applying patch unix/no-server-tools.patch
-- Applying patch unix/mingw-install.patch
-- Applying patch unix/python.patch
-- Applying patch windows/macro-def.patch
-- Applying patch windows/win_bison_flex.patch
-- Applying patch windows/msbuild.patch
-- Applying patch windows/spin_delay.patch
-- Applying patch android/unversioned_so.patch
-- Using source at D:/dev/vcpkg/buildtrees/libpq/src/tgresql-16-b00fbb6ff2.clean
-- Getting CMake variables for x64-windows
-- Building x64-windows-dbg
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:112 (message):
    Command failed: D:/dev/vcpkg/downloads/tools/perl/5.38.0.1/perl/bin/perl.exe build.pl DEBUG libpq
    Working Directory: D:/dev/vcpkg/buildtrees/libpq/x64-windows-dbg/src/tools/msvc
    Error code: 1
    See logs for more information:
      D:\dev\vcpkg\buildtrees\libpq\build-libpq-x64-windows-dbg-out.log
      D:\dev\vcpkg\buildtrees\libpq\build-libpq-x64-windows-dbg-err.log

Call Stack (most recent call first):
  ports/libpq/build-msvc.cmake:67 (vcpkg_execute_required_process)
  ports/libpq/portfile.cmake:74 (build_msvc)
  scripts/ports.cmake:191 (include)
D:\dev\vcpkg\buildtrees\libpq\build-libpq-x64-windows-dbg-err.log ``` Locale 'Chinese (Simplified)_China.936' is unsupported, and may crash the interpreter. Locale 'Chinese (Simplified)_China.936' is unsupported, and may crash the interpreter. Locale 'Chinese (Simplified)_China.936' is unsupported, and may crash the interpreter. Locale 'Chinese (Simplified)_China.936' is unsupported, and may crash the interpreter. Locale 'Chinese (Simplified)_China.936' is unsupported, and may crash the interpreter. Locale 'Chinese (Simplified)_China.936' is unsupported, and may crash the interpreter. Locale 'Chinese (Simplified)_China.936' is unsupported, and may crash the interpreter. Locale 'Chinese (Simplified)_China.936' is unsupported, and may crash the interpreter. Locale 'Chinese (Simplified)_China.936' is unsupported, and may crash the interpreter. Locale 'Chinese (Simplified)_China.936' is unsupported, and may crash the interpreter. Locale 'Chinese (Simplified)_China.936' is unsupported, and may crash the interpreter. Locale 'Chinese (Simplified)_China.936' is unsupported, and may crash the interpreter. Locale 'Chinese (Simplified)_China.936' is unsupported, and may crash the interpreter. Locale 'Chinese (Simplified)_China.936' is unsupported, and may crash the interpreter. Locale 'Chinese (Simplified)_China.936' is unsupported, and may crash the interpreter. ```
D:\dev\vcpkg\buildtrees\libpq\build-libpq-x64-windows-dbg-out.log ``` Detected hardware platform: X64 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/interfaces/libpq/test 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/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/basebackup_to_shell Generating win32ver.rc for contrib/basic_archive 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 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/pgcrypto 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/pg_walinspect Generating win32ver.rc for contrib/postgres_fdw Generating win32ver.rc for contrib/seg 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/ldap_password_func 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_copy_callbacks Generating win32ver.rc for src/test/modules/test_custom_rmgrs 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_lfind Generating win32ver.rc for src/test/modules/test_oat_hooks 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/test_slru 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 daitch_mokotoff.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... Microsoft (R) 生成引擎版本 14.0.25420.1 版权所有(C) Microsoft Corporation。保留所有权利。 生成启动时间为 2024/6/18 20:04:34。 1>节点 1 上的项目“D:\dev\vcpkg\buildtrees\libpq\x64-windows-dbg\libpq.vcxproj”(默认目标)。 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Current.targets(14,11): error MSB4115: 函数“exists”只接受标量值,但其参数“$(ForceImportBeforeCppTargets)”的计算结果为“D:/dev/vcpkg/scripts/buildsystems/msbuild/vcpkg.targets;D:/dev/vcpkg/buildtrees/libpq/x64-windows-dbg/vcpkg-libs.props”,不是标量值。 [D:\dev\vcpkg\buildtrees\libpq\x64-windows-dbg\libpq.vcxproj] 1>已完成生成项目“D:\dev\vcpkg\buildtrees\libpq\x64-windows-dbg\libpq.vcxproj”(默认目标)的操作 - 失败。 生成失败。 “D:\dev\vcpkg\buildtrees\libpq\x64-windows-dbg\libpq.vcxproj”(默认目标) (1) -> C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Current.targets(14,11): error MSB4115: 函数“exists”只接受标量值,但其参数“$(ForceImportBeforeCppTargets)”的计算结果为“D:/dev/vcpkg/scripts/buildsystems/msbuild/vcpkg.targets;D:/dev/vcpkg/buildtrees/libpq/x64-windows-dbg/vcpkg-libs.props”,不是标量值。 [D:\dev\vcpkg\buildtrees\libpq\x64-windows-dbg\libpq.vcxproj] 0 个警告 1 个错误 已用时间 00:00:00.02 ```
MonicaLiu0311 commented 3 months ago

I didn't repro your issue. Have you installed the VS English language pack? image

CreateDesktop commented 3 months ago

@MonicaLiu0311 I think I haven't installed the English language pack. I'll try to install it right away. Thank you.

CreateDesktop commented 3 months ago

I tried to install the English version of visual studio, but the problem was not solved. Referring to this link, the problem lies in the visual studio 2015 version. I happen to be using the 2015 version. https://github.com/conan-io/conan/issues/7806

CreateDesktop commented 3 months ago

What version of visual studio is yours?

CreateDesktop commented 3 months ago

https://github.com/conan-io/conan/issues/7805

MonicaLiu0311 commented 3 months ago

What version of visual studio is yours?

I am using VS2022. VS 2015 is too old and will no longer be maintained starting in 2025. Can you upgrade VS?

CreateDesktop commented 3 months ago

I am upgrading to vs2022, and the compiler still hopes to use vc14.0. But our program needs to run on the win7 operating system, and we need to do some compatibility tests in the future.