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

[libpq] build failure #26921

Closed
gamesyule opened this issue Sep 22, 2022 · 12 comments · Fixed by #27851
Closed

[libpq] build failure #26921

gamesyule opened this issue Sep 22, 2022 · 12 comments · Fixed by #27851
Assignees
Labels
requires:repro The issue is not currently repro-able

Comments

@gamesyule
Copy link

Package: libpq[core,lz4,openssl,zlib]:x64-windows -> 14.4

Host Environment

  • Host: x64-windows
  • Compiler: MSVC 19.29.30142.1
  • vcpkg-tool version: 2022-09-20-522aa94e9d261c7d7b2f079bf2591ca62df5c714
    vcpkg-scripts version: d52632d 2022-09-21 (12 hours ago)

To Reproduce

vcpkg install libpq:x64-windows

Failure logs

-- Using cached postgresql-14.4.tar.bz2.
-- Extracting source F:/develope/vcpkg/downloads/postgresql-14.4.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/windows/macro-def.patch
-- Applying patch patches/fix-configure.patch
-- Applying patch patches/windows/minimize_install.patch
-- Using source at F:/develope/vcpkg/buildtrees/libpq/src/tgresql-14-0b040e732f.clean
-- Found external ninja('1.10.2').
-- Getting CMake variables for x64-windows
-- Copying libpq source files to F:/develope/vcpkg/buildtrees/libpq/x64-windows-rel...
-- Copying libpq source files... done
CMake Deprecation Warning at scripts/ports.cmake:77 (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:2 (z_vcpkg_deprecation_message)
  ports/libpq/portfile.cmake:100 (vcpkg_apply_patches)
  scripts/ports.cmake:147 (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:96 (message):
    Command failed: F:/develope/vcpkg/downloads/tools/perl/5.32.1.1/perl/bin/perl.exe build.pl RELEASE libpq
    Working Directory: F:/develope/vcpkg/buildtrees/libpq/x64-windows-rel/src/tools/msvc
    Error code: 255
    See logs for more information:
      F:\develope\vcpkg\buildtrees\libpq\build-libpq-x64-windows-RELEASE-out.log
      F:\develope\vcpkg\buildtrees\libpq\build-libpq-x64-windows-RELEASE-err.log

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



F:\develope\vcpkg\buildtrees\libpq\build-libpq-x64-windows-RELEASE-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/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...
F:\develope\vcpkg\buildtrees\libpq\build-libpq-x64-windows-RELEASE-err.log
Can't spawn "msbuild libpq.vcxproj /verbosity:normal /p:PlatformToolset=v142
            /p:VCPkgLocalAppDataDisabled=true
            /p:UseIntelMKL=No
            /p:WindowsTargetPlatformVersion=10.0.19041.0
            /m
            /p:ForceImportBeforeCppTargets="F:/develope/vcpkg/scripts/buildsystems/msbuild/vcpkg.targets"
            /p:ForceImportAfterCppTargets="F:/develope/vcpkg/buildtrees/libpq/x64-windows/libpq.props"
            /p:VcpkgTriplet=x64-windows
            /p:VcpkgCurrentInstalledDir="F:/develope/vcpkg/installed/x64-windows" /p:Configuration=Release": Inappropriate I/O control operation at build.pl line 77.
**Additional context**
@gamesyule gamesyule added the category:port-bug The issue is with a library, which is something the port should already support label Sep 22, 2022
@FrankXie05 FrankXie05 added requires:more-information This Issue requires more information to solve and removed category:port-bug The issue is with a library, which is something the port should already support labels Sep 23, 2022
@FrankXie05
Copy link
Contributor

FrankXie05 commented Sep 23, 2022

Can you provide the complete log?
F:\develope\vcpkg\buildtrees\libpq\build-libpq-x64-windows-RELEASE-err.log

@gamesyule
Copy link
Author

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

@FrankXie05
Copy link
Contributor

@gamesyule Do you have the latest version of build tools installed on your VS?
image

@gamesyule
Copy link
Author

@gamesyule Do you have the latest version of build tools installed on your VS? image

I already installed the latest build tools.
image

@FrankXie05
Copy link
Contributor

FrankXie05 commented Sep 23, 2022

Please switch to English language pack to try it.
The log shows that VS cannot load the vcxproj file in the project, please check if your environment is installed correctly. :)

@FrankXie05 FrankXie05 added requires:repro The issue is not currently repro-able and removed requires:more-information This Issue requires more information to solve labels Sep 23, 2022
@ArcticLampyrid
Copy link
Contributor

Same problem.

@JasonkayZK
Copy link

I've got the same problem here. It seems that libpq does not support Release|x64

@ArcticLampyrid
Copy link
Contributor

Looking into vc project, there are only Debug|Unknown and Release|Unknown available

@dg0yt
Copy link
Contributor

dg0yt commented Sep 29, 2022

I've got the same problem here. It seems that libpq does not support Release|x64

Looking into vc project, there are only Debug|Unknown and Release|Unknown available

AFAIU the configuration of libpq runs cl to determine the platform, cf. tools/msvc/Solution.pm:

		# Examine CL help output to determine if we are in 32 or 64-bit mode.
		my $output = `cl /help 2>&1`;
		$? >> 8 == 0 or die "cl command not found";
		if ($output =~ m/x64\n/) { $self->{platform} = 'x64';
		} elsif ($output =~ m/x86\n/) { $self->{platform} = 'Win32';
		} elsif ($output =~ m/ARM64\n/) { $self->{platform} = 'ARM64';
		} elsif ($output =~ m/ARM\n/) { $self->{platform} = 'ARM';
		} else { $self->{platform} = 'Unknown'
		}

So Unknown is selected if cl doesn't give a hint about the platform. Anyways, the platform should just follow the triplet settings in vcpkg. No need to run cl.

@lijingjian001
Copy link

Does anyone know how to deal with the same problem?

@paladin1893
Copy link

Does anyone know how to deal with the same problem?
Get the English language package installed, try again...

@lidar-nevermore
Copy link

Does anyone know how to deal with the same problem?

Solved by switching to English language pack

BillyONeal pushed a commit that referenced this issue Nov 18, 2022
* [libpq] fix build with non-English MSVC (#26921)

* [libpq] bump port version

* Update version database
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires:repro The issue is not currently repro-able
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants