Vcpkg: libpq:x64-windows build failure

Created on 16 Jul 2020  Â·  57Comments  Â·  Source: microsoft/vcpkg

PS F:\jinankanchayuan\github\vcpkg-master\vcpkg-master> .\vcpkg install libpq:x64-windows
Computing installation plan...
The following packages will be built and installed:
    libpq[core,openssl,zlib]:x64-windows
Detecting compiler hash for triplet x64-windows...
Starting package 1/1: libpq:x64-windows
Building package libpq[core,openssl,zlib]:x64-windows...
Could not locate cached archive: C:\Users\Administrator\AppData\Local\vcpkg\archives\3b\3bba018cd44289734ceb2771de3c161f7635ab09.zip
-- Using cached F:/jinankanchayuan/github/vcpkg-master/vcpkg-master/downloads/postgresql-12.2.tar.bz2
-- Cleaning sources at F:/jinankanchayuan/github/vcpkg-master/vcpkg-master/buildtrees/libpq/src/tgresql-12-3dcd887135.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source F:/jinankanchayuan/github/vcpkg-master/vcpkg-master/downloads/postgresql-12.2.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/linux/configure.patch
-- Applying patch patches/windows/minimize_install.patch
-- Using source at F:/jinankanchayuan/github/vcpkg-master/vcpkg-master/buildtrees/libpq/src/tgresql-12-3dcd887135.clean
-- Copying libpq source files to F:/jinankanchayuan/github/vcpkg-master/vcpkg-master/buildtrees/libpq/x64-windows-rel...
-- Copying libpq source files... done
-- 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:72 (message):
    Command failed: F:/jinankanchayuan/github/vcpkg-master/vcpkg-master/downloads/tools/perl/perl/bin/perl.exe build.pl RELEASE libpq
    Working Directory: F:/jinankanchayuan/github/vcpkg-master/vcpkg-master/buildtrees/libpq/x64-windows-rel/src/tools/msvc
    Error code: 53
    See logs for more information:
      F:\jinankanchayuan\github\vcpkg-master\vcpkg-master\buildtrees\libpq\build-libpq-x64-windows-RELEASE-out.log
      F:\jinankanchayuan\github\vcpkg-master\vcpkg-master\buildtrees\libpq\build-libpq-x64-windows-RELEASE-err.log

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


Error: Building package libpq:x64-windows failed with: BUILD_FAILED

err.log

Unable to determine OpenSSL version: The openssl.exe command wasn't found.

vcpkg-bug

All 57 comments

Hi @shunshizhechang
Thanks for posting this issue.
I can build this successfully on my machine:

PS F:\tools\vcpkg> .\vcpkg.exe install libpq:x64-windows
Computing installation plan...
The following packages will be built and installed:
    libpq[core,openssl,zlib]:x64-windows
Detecting compiler hash for triplet x64-windows...
Starting package 1/1: libpq:x64-windows
Building package libpq[core,openssl,zlib]:x64-windows...
Could not locate cached archive: C:\Users\v-ruil\AppData\Local\vcpkg\archives\c3\c3340ea34a229acb8666f11c45974273a58c4469.zip
-- Using cached F:/tools/vcpkg/downloads/postgresql-12.2.tar.bz2
-- Extracting source F:/tools/vcpkg/downloads/postgresql-12.2.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/linux/configure.patch
-- Applying patch patches/windows/minimize_install.patch
-- Using source at F:/tools/vcpkg/buildtrees/libpq/src/tgresql-12-3dcd887135.clean
-- Trying auto-select mirror...
-- Downloading https://sourceforge.net/projects/winflexbison//files/winflexbison-2.5.16.zip/download...
-- Extracting source F:/tools/vcpkg/downloads/winflexbison-2.5.16.zip
-- Using source at F:/tools/vcpkg/downloads/tools/winflexbison/0a14154bff-a8cf65db07
-- Copying libpq source files to F:/tools/vcpkg/buildtrees/libpq/x64-windows-rel...
-- Copying libpq source files... done
-- Applying patch patches/windows/Solution_RELEASE.patch
-- Applying patch patches/windows/python3_build_RELEASE.patch
-- Patches applied!
-- Building libpq x64-windows-RELEASE...
-- Building libpq x64-windows-RELEASE... done
-- Building libecpg_compat x64-windows-RELEASE...
-- Building libecpg_compat x64-windows-RELEASE... done
-- Installing libpq x64-windows-RELEASE...
-- Installing libpq x64-windows-RELEASE... done
-- Copying libpq source files to F:/tools/vcpkg/buildtrees/libpq/x64-windows-dbg...
-- Copying libpq source files... done
-- Applying patch patches/windows/Solution_DEBUG.patch
-- Applying patch patches/windows/python3_build_DEBUG.patch
-- Patches applied!
-- Building libpq x64-windows-DEBUG...
-- Building libpq x64-windows-DEBUG... done
-- Building libecpg_compat x64-windows-DEBUG...
-- Building libecpg_compat x64-windows-DEBUG... done
-- Installing libpq x64-windows-DEBUG...
-- Installing libpq x64-windows-DEBUG... done
-- Cleanup libpq x64-windows...
-- Cleanup libpq x64-windows... - done
-- Installing: F:/tools/vcpkg/packages/libpq_x64-windows/share/postgresql/vcpkg-cmake-wrapper.cmake
-- Installing: F:/tools/vcpkg/packages/libpq_x64-windows/share/libpq/copyright
-- Performing post-build validation
-- Performing post-build validation done
Stored binary cache: C:\Users\v-ruil\AppData\Local\vcpkg\archives\c3\c3340ea34a229acb8666f11c45974273a58c4469.zip
Building package libpq[core,openssl,zlib]:x64-windows... done
Installing package libpq[core,openssl,zlib]:x64-windows...
Installing package libpq[core,openssl,zlib]:x64-windows... done
Elapsed time for package libpq:x64-windows: 9.79 min

Total elapsed time: 9.998 min

Could you please use git pull to update vcpkg to the latest version and rebuild this?

I downloaded vcpkg again and rebuild the package libpq:x64-windows,but the same error occurred。

PS F:\jinankanchayuan\github\vcpkg-master> .\vcpkg.exe install libpq:x64-windows
Computing installation plan...
The following packages will be built and installed:
    libpq[core,openssl,zlib]:x64-windows
Detecting compiler hash for triplet x64-windows...
Starting package 1/1: libpq:x64-windows
Building package libpq[core,openssl,zlib]:x64-windows...
Could not locate cached archive: C:\Users\Administrator\AppData\Local\vcpkg\archives\a0\a022ee11644039dd33a6fdcfead10d09404f9fc3.zip
-- Using cached F:/jinankanchayuan/github/vcpkg-master/downloads/postgresql-12.2.tar.bz2
-- Cleaning sources at F:/jinankanchayuan/github/vcpkg-master/buildtrees/libpq/src/tgresql-12-3dcd887135.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source F:/jinankanchayuan/github/vcpkg-master/downloads/postgresql-12.2.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/linux/configure.patch
-- Applying patch patches/windows/minimize_install.patch
-- Using source at F:/jinankanchayuan/github/vcpkg-master/buildtrees/libpq/src/tgresql-12-3dcd887135.clean
-- Using cached F:/jinankanchayuan/github/vcpkg-master/downloads/strawberry-perl-5.30.0.1-32bit.zip
-- Copying libpq source files to F:/jinankanchayuan/github/vcpkg-master/buildtrees/libpq/x64-windows-rel...
-- Copying libpq source files... done
-- 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:72 (message):
    Command failed: F:/jinankanchayuan/github/vcpkg-master/downloads/tools/perl/perl/bin/perl.exe build.pl RELEASE libpq
    Working Directory: F:/jinankanchayuan/github/vcpkg-master/buildtrees/libpq/x64-windows-rel/src/tools/msvc
    Error code: 53
    See logs for more information:
      F:\jinankanchayuan\github\vcpkg-master\buildtrees\libpq\build-libpq-x64-windows-RELEASE-out.log
      F:\jinankanchayuan\github\vcpkg-master\buildtrees\libpq\build-libpq-x64-windows-RELEASE-err.log

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


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

err.log :
Unable to determine OpenSSL version: The openssl.exe command wasn't found. at F:jinankanchayuangithubvcpkg-masterbuildtreeslibpqx64-windows-relsrctoolsmsvc/Mkvcbuild.pm line 147.

@shunshizhechang
Could you please remove perl from _F:/jinankanchayuan/github/vcpkg-master/downloads/tools/perl_and openssl via vcpkg remove openssl, and then rebuild this?

The error occurred again。

PS F:\jinankanchayuan\github\vcpkg-master> .\vcpkg.exe install libpq:x64-windows
Computing installation plan...
The following packages will be built and installed:
    libpq[core,openssl,zlib]:x64-windows
Detecting compiler hash for triplet x64-windows...
A suitable version of git was not found (required v2.26.2). Downloading portable git v2.26.2...
Downloading git...
  https://github.com/git-for-windows/git/releases/download/v2.26.2.windows.1/PortableGit-2.26.2-32-bit.7z.exe -> F:\jinankanchayuan\github\vcpkg-master\downloads\PortableGit-2.26.2-32-bit.7z.exe
Extracting git...
A suitable version of 7zip was not found (required v18.1.0). Downloading portable 7zip v18.1.0...
Downloading 7zip...
  https://www.nuget.org/api/v2/package/7-Zip.CommandLine/18.1.0 -> F:\jinankanchayuan\github\vcpkg-master\downloads\7-zip.commandline.18.1.0.nupkg
Extracting 7zip...
A suitable version of nuget was not found (required v5.5.1). Downloading portable nuget v5.5.1...
Downloading nuget...
  https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe -> F:\jinankanchayuan\github\vcpkg-master\downloads\22ea847d-nuget.exe
A suitable version of powershell-core was not found (required v6.2.1). Downloading portable powershell-core v6.2.1...
Downloading powershell-core...
  https://github.com/PowerShell/PowerShell/releases/download/v6.2.1/PowerShell-6.2.1-win-x86.zip -> F:\jinankanchayuan\github\vcpkg-master\downloads\PowerShell-6.2.1-win-x86.zip
Extracting powershell-core...
Starting package 1/1: libpq:x64-windows
Building package libpq[core,openssl,zlib]:x64-windows...
Could not locate cached archive: C:\Users\Administrator\AppData\Local\vcpkg\archives\e3\e38ce2d20726c22707e33559beec932adc3009c2.zip
-- Downloading https://ftp.postgresql.org/pub/source/v12.2/postgresql-12.2.tar.bz2...
-- Cleaning sources at F:/jinankanchayuan/github/vcpkg-master/buildtrees/libpq/src/tgresql-12-3dcd887135.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source F:/jinankanchayuan/github/vcpkg-master/downloads/postgresql-12.2.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/linux/configure.patch
-- Applying patch patches/windows/minimize_install.patch
-- Using source at F:/jinankanchayuan/github/vcpkg-master/buildtrees/libpq/src/tgresql-12-3dcd887135.clean
-- Trying auto-select mirror...
-- Downloading https://sourceforge.net/projects/winflexbison//files/winflexbison-2.5.16.zip/download...
-- Extracting source F:/jinankanchayuan/github/vcpkg-master/downloads/winflexbison-2.5.16.zip
-- Using source at F:/jinankanchayuan/github/vcpkg-master/downloads/tools/winflexbison/0a14154bff-a8cf65db07
-- Downloading https://strawberry.perl.bot/download/5.30.0.1/strawberry-perl-5.30.0.1-32bit.zip...
-- Copying libpq source files to F:/jinankanchayuan/github/vcpkg-master/buildtrees/libpq/x64-windows-rel...
-- Copying libpq source files... done
-- 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:72 (message):
    Command failed: F:/jinankanchayuan/github/vcpkg-master/downloads/tools/perl/perl/bin/perl.exe build.pl RELEASE libpq
    Working Directory: F:/jinankanchayuan/github/vcpkg-master/buildtrees/libpq/x64-windows-rel/src/tools/msvc
    Error code: 1
    See logs for more information:
      F:\jinankanchayuan\github\vcpkg-master\buildtrees\libpq\build-libpq-x64-windows-RELEASE-out.log
      F:\jinankanchayuan\github\vcpkg-master\buildtrees\libpq\build-libpq-x64-windows-RELEASE-err.log

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


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

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

err.log:
Unable to determine OpenSSL version: The openssl.exe command wasn't found. at F:jinankanchayuangithubvcpkg-masterbuildtreeslibpqx64-windows-relsrctoolsmsvc/Mkvcbuild.pm line 147.

Can you confirm whether openssl.exe exists in _VCPKG_PATH/installed/x64-windows/tools/openssl_?

Yes,the openssl.exe existed.
F:jinankanchayuangithubvcpkginstalledx64-windowstoolsopensslopenssl.exe

@shunshizhechang Have you manually installed openssl before? If it's true, please remove it first.

No,I have not manually installed it .Is the openssl.exe in D:Program FilesGitGitmingw64bin affect it?
image

oh, exactly the same error, Unable to determine OpenSSL version: The openssl.exe command wasn't found.

When i try to build gdal.the same error occur, i could install all dependence excapt libpq. Anyone have meet this problem and solved it?

I still can't repro this issue.
https://github.com/microsoft/vcpkg/blob/458c20e94b9f558b523f187ce403bd062e131cdb/ports/libpq/portfile.cmake#L159
The path of openssl.exe is set here, I don't know why can't find it.

Anyone can provide my the full logs?

Does it have relate to openssl_exe_path.patch?
The content:
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 51711c2bf..d33fdc3b0 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -133,7 +133,7 @@ sub GetOpenSSLVersion
# openssl.exe is in the specified directory.
# Quote the .exe name in case it has spaces
my $opensslcmd =
- qq("$self->{options}->{openssl}\bin\openssl.exe" version 2>&1);
+ qq("openssl.exe" version 2>&1);
my $sslout = $opensslcmd;

$? >> 8 == 0

How to get the the full logs?

@shunshizhechang
_F:jinankanchayuangithubvcpkg-mastervcpkg-masterbuildtreeslibpqbuild-libpq-x64-windows-RELEASE-out.log_
_F:jinankanchayuangithubvcpkg-mastervcpkg-masterbuildtreeslibpqbuild-libpq-x64-windows-RELEASE-err.log_

build-libpq-x64-windows-RELEASE-out.log:
cl output Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28806 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]
.Detected hardware platform: x64

build-libpq-x64-windows-RELEASE-err.log:
Unable to determine OpenSSL version: The openssl.exe command wasn't found. at F:jinankanchayuangithubvcpkgbuildtreeslibpqx64-windows-relsrctoolsmsvc/Mkvcbuild.pm line 147.

Ciao.
We have just built the latest version of PostgreSQL from source on Windows 10 x64 using MinGW/MSYS. It uses the latest version of OpenSSL.

image

Let us know if you require assistance.

Finally I catched this issue,
That's because other ports (such as boringssl) will cause openssl-windows to skip the build, resulting in openssl.exe not being generated, which leads to this issue.

Please remove libressl and boringssl and rerun again.

I may be wrong, but does PostgreSQL use BoringSSL?
Why vcpkg gets confused? There is no relationship between all three independent projects, as far as I can see!
I mean, if I have BoringSSL installed then I cannot install OpenSSL nor PostgreSQL?
Sorry, I have never had the need to use this project (vcpkg) to build different applications so I do not know how it works in detail.

Please remove libressl and boringssl and rerun again.

I did not install these two things, only openssl and openssl-windows. The same error still occurs.

@Huang88888888Fei @shunshizhechang Have you tried building libpq without using vcpkg?
Let us know if we can be of any assistance.

It seems to be caused by other reasons, I need to investigate more deeply.

@Huang88888888Fei @shunshizhechang Have you tried building libpq without using vcpkg?
Let us know if we can be of any assistance.

Oh, thanks. But I would rather wait for you to fix this bug.

@shunshizhechang @Huang88888888Fei can you check Optional Features in settings? You may need to install the OpenSSH Client optional feature in Windows.

@shunshizhechang @Huang88888888Fei can you check Optional Features in settings? You may need to install the OpenSSH Client optional feature in Windows.

Sadly, I had installed the OpenSSH Client. And the same error occur: Unable to determine OpenSSL version: The openssl.exe command wasn't found.

@strega-nil This issue seems particularly hard to troubleshoot and we seem to confuse people! Out of curiosity, can you elaborate on the relationship between libpq and OpenSSH?

@Huang88888888Fei @shunshizhechang Have you tried some other alternatives to sort out your issue?

@strega-nil The openssl.exe path is specified here:
https://github.com/microsoft/vcpkg/blob/8800ba999a2b17e5f169a44641c2b6fd0f908f4d/ports/libpq/portfile.cmake#L161-L165

But seems not working sometimes.

A couple of questions here:

a) Who should (normally) close issues?
b) This issue was resolved by the time it was closed?

Have fun.

@sfhacker It was closed automatically when the PR was merged because that PR had 'resolves XYZ' in a description somewhere, not due to direct action.

No, this issue is not resolved, so I re-opened it.

PS F:\jinankanchayuan\github\vcpkg-master\vcpkg-master> .\vcpkg install libpq:x64-windows
Computing installation plan...
The following packages will be built and installed:
    libpq[core,openssl,zlib]:x64-windows
Detecting compiler hash for triplet x64-windows...
Starting package 1/1: libpq:x64-windows
Building package libpq[core,openssl,zlib]:x64-windows...
Could not locate cached archive: C:\Users\Administrator\AppData\Local\vcpkg\archives\3b\3bba018cd44289734ceb2771de3c161f7635ab09.zip
-- Using cached F:/jinankanchayuan/github/vcpkg-master/vcpkg-master/downloads/postgresql-12.2.tar.bz2
-- Cleaning sources at F:/jinankanchayuan/github/vcpkg-master/vcpkg-master/buildtrees/libpq/src/tgresql-12-3dcd887135.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source F:/jinankanchayuan/github/vcpkg-master/vcpkg-master/downloads/postgresql-12.2.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/linux/configure.patch
-- Applying patch patches/windows/minimize_install.patch
-- Using source at F:/jinankanchayuan/github/vcpkg-master/vcpkg-master/buildtrees/libpq/src/tgresql-12-3dcd887135.clean
-- Copying libpq source files to F:/jinankanchayuan/github/vcpkg-master/vcpkg-master/buildtrees/libpq/x64-windows-rel...
-- Copying libpq source files... done
-- 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:72 (message):
    Command failed: F:/jinankanchayuan/github/vcpkg-master/vcpkg-master/downloads/tools/perl/perl/bin/perl.exe build.pl RELEASE libpq
    Working Directory: F:/jinankanchayuan/github/vcpkg-master/vcpkg-master/buildtrees/libpq/x64-windows-rel/src/tools/msvc
    Error code: 53
    See logs for more information:
      F:\jinankanchayuan\github\vcpkg-master\vcpkg-master\buildtrees\libpq\build-libpq-x64-windows-RELEASE-out.log
      F:\jinankanchayuan\github\vcpkg-master\vcpkg-master\buildtrees\libpq\build-libpq-x64-windows-RELEASE-err.log

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


Error: Building package libpq:x64-windows failed with: BUILD_FAILED

err.log

Unable to determine OpenSSL version: The openssl.exe command wasn't found.

the same error.

Are we STILL having issues building libpq?
This reopened issue is two months old!

@michealowen Have tried other alternatives?
We have OpenSSL 1.1.1g installed and had no issues building libpq.

@JackBoosY This issue seems hard to troubleshoot and fix. Let us know if you require assistance.

Are we STILL having issues building libpq?
This reopened issue is two months old!

We still don't have a consistent repro for the problem. I just tried to install it and it's fine:

Starting package 4/4: libpq:x64-windows
Building package libpq[core,openssl,zlib]:x64-windows...
Could not locate cached archive: C:\Users\billy\AppData\Local\vcpkg/archives\65\65e518fa0f22ca854f258b31a927b80b45ed9d17.zip
-- Using cached D:/vcpkg/downloads/postgresql-12.2.tar.bz2
-- Extracting source D:/vcpkg/downloads/postgresql-12.2.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/linux/configure.patch
-- Applying patch patches/windows/minimize_install.patch
-- Using source at D:/vcpkg/buildtrees/libpq/src/tgresql-12-3dcd887135.clean
-- Copying libpq source files to D:/vcpkg/buildtrees/libpq/x64-windows-rel...
-- Copying libpq source files... done
-- Applying patch patches/windows/Solution_RELEASE.patch
-- Applying patch patches/windows/python3_build_RELEASE.patch
-- Patches applied!
-- Building libpq x64-windows-RELEASE...
-- Building libpq x64-windows-RELEASE... done
-- Building libecpg_compat x64-windows-RELEASE...
-- Building libecpg_compat x64-windows-RELEASE... done
-- Installing libpq x64-windows-RELEASE...
-- Installing libpq x64-windows-RELEASE... done
-- Copying libpq source files to D:/vcpkg/buildtrees/libpq/x64-windows-dbg...
-- Copying libpq source files... done
-- Applying patch patches/windows/Solution_DEBUG.patch
-- Applying patch patches/windows/python3_build_DEBUG.patch
-- Patches applied!
-- Building libpq x64-windows-DEBUG...
-- Building libpq x64-windows-DEBUG... done
-- Building libecpg_compat x64-windows-DEBUG...
-- Building libecpg_compat x64-windows-DEBUG... done
-- Installing libpq x64-windows-DEBUG...
-- Installing libpq x64-windows-DEBUG... done
-- Cleanup libpq x64-windows...
-- Cleanup libpq x64-windows... - done
-- Installing: D:/vcpkg/packages/libpq_x64-windows/share/postgresql/vcpkg-cmake-wrapper.cmake
-- Installing: D:/vcpkg/packages/libpq_x64-windows/share/libpq/copyright
-- Performing post-build validation
-- Performing post-build validation done
Stored binary cache: C:\Users\billy\AppData\Local\vcpkg/archives\65\65e518fa0f22ca854f258b31a927b80b45ed9d17.zip
Building package libpq[core,openssl,zlib]:x64-windows... done
Installing package libpq[core,openssl,zlib]:x64-windows...
Installing package libpq[core,openssl,zlib]:x64-windows... done
Elapsed time for package libpq:x64-windows: 54.55 s

Total elapsed time: 1.832 min

PS D:\vcpkg>

I also tried from within a git bash shell to make sure their openssl wasn't "infecting" the process.

anyone solved it?

@michealowen This issue is two months old! Can you post here the error(s) you are getting?

I have tried to use libpq in C++/Winrt. Using the headers and .lib provided by postgresql and setting the include paths etc allows the project to compile but when it is run it fails and a message is sent to the event viewer stating that the Activation failed. It works fine on Win32 projects. The only option therefore for C++/WinRT or UWP projects is to use vcpkg. I have found that .vcpkg install libpq:x86-windows and .vcpkg libpqx64-windows both work and thus allow libpq to be used with win32 projects. .vcpkg install libpq: x86-uwp and .vcpkg install libpq:x64-uwp both fail and produce the error reported by other contributors i.e unable to determine openssl version etc. I have noted that the windows versions create Misc and Tools directories at ..vcpkginstalled[version] location but uwp versions do not. Not sure if this helps but a resolution of the problem is urgently required.

C:srcvcpkg>.vcpkg install libpq:x64-uwp
Computing installation plan...
The following packages will be built and installed:
libpq[core,openssl,zlib]:x64-uwp
Detecting compiler hash for triplet x64-uwp...
Starting package 1/1: libpq:x64-uwp
Building package libpq[core,openssl,zlib]:x64-uwp...
Could not locate cached archive: C:UsersPersonalAppDataLocalvcpkgarchivesf2f223f25d1c0e97dabe9cd5bd35e2fe9c673e969c.zip
-- Using cached C:/src/vcpkg/downloads/postgresql-12.2.tar.bz2
-- Cleaning sources at C:/src/vcpkg/buildtrees/libpq/src/tgresql-12-3dcd887135.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/src/vcpkg/downloads/postgresql-12.2.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/linux/configure.patch
-- Applying patch patches/windows/minimize_install.patch
-- Using source at C:/src/vcpkg/buildtrees/libpq/src/tgresql-12-3dcd887135.clean
-- Copying libpq source files to C:/src/vcpkg/buildtrees/libpq/x64-uwp-rel...
-- Copying libpq source files... done
-- Applying patch patches/windows/Solution_RELEASE.patch
-- Applying patch patches/windows/python3_build_RELEASE.patch
-- Patches applied!
-- Building libpq x64-uwp-RELEASE...
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:85 (message):
Command failed: C:/src/vcpkg/downloads/tools/perl/5.30.0.1/perl/bin/perl.exe build.pl RELEASE libpq
Working Directory: C:/src/vcpkg/buildtrees/libpq/x64-uwp-rel/src/tools/msvc
Error code: 1
See logs for more information:
C:srcvcpkgbuildtreeslibpqbuild-libpq-x64-uwp-RELEASE-out.log
C:srcvcpkgbuildtreeslibpqbuild-libpq-x64-uwp-RELEASE-err.log

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

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

Additionally, attach any relevant sections from the log files above.
build-libpq-x64-uwp-RELEASE-out.log
build-libpq-x86-uwp-RELEASE-err.log
build-libpq-x86-uwp-RELEASE-out.log
build-libpq-x64-uwp-RELEASE-err.log

Are we STILL having issues building libpq? This open issue is nearly three months old!
@skealy Someone here suggested installing OpenSSH. Have you tried that?

@skealy For uwp, you should change _VCPKG_ROOT/ports/libpq/portfile.cmake_ line 162 to:

set(buildenv_contents "${buildenv_contents}\n\$ENV{'PATH'}=\$ENV{'PATH'} . ';${CURRENT_INSTALLED_DIR}/../x86-windows/tools/openssl';")

Then install openssl:x86-windows first.

Anyone who has encountered this problem on the triples x86-windows/x64-windows/x64-windows-static can send me the full logs?

@michealowen This issue is two months old! Can you post here the error(s) you are getting?

I provided the error log in anothor issue which is now closed because the problem is the same.

@michealowen I need complete logs instead of a partial one to better locate this.

@michealowen I need complete logs instead of a partial one to better locate this.
Computing installation plan...
The following packages will be built and installed:
gdal[core]:x86-windows

  • libpq[core,openssl,zlib]:x86-windows
    Additional packages (*) will be modified to complete this operation.
    Starting package 1/2: libpq:x86-windows
    Building package libpq[core,openssl,zlib]:x86-windows...
    -- Using source at F:/owen/cpp_workspace/vcpkg/vcpkg-master/buildtrees/libpq/src/tgresql-12-3dcd887135
    -- Copying libpq source files to F:/owen/cpp_workspace/vcpkg/vcpkg-master/buildtrees/libpq/x86-windows-rel...
    -- Copying libpq source files... done
    -- Applying patch patches/windows/Solution_RELEASE.patch
    -- Applying patch patches/windows/python3_build_RELEASE.patch
    -- Patches applied!
    -- Building libpq x86-windows-RELEASE...
    CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):
    pq
    Working Directory: F:/owen/cpp_workspace/vcpkg/vcpkg-master/buildtrees/libpq/x86-windows-rel/src/tools/msvc
    Error code: 53
    See logs for more information:
    F:owencpp_workspacevcpkgvcpkg-masterbuildtreeslibpqbuild-libpq-x86-windows-RELEASE-out.log
    F:owencpp_workspacevcpkgvcpkg-masterbuildtreeslibpqbuild-libpq-x86-windows-RELEASE-err.log
    build-libpq-x86-windows-RELEASE-err.log
    build-libpq-x86-windows-RELEASE-out.log
    Call Stack (most recent call first):
    ports/libpq/portfile.cmake:214 (vcpkg_execute_required_process)
    scripts/ports.cmake:76 (include)

Error: Building package libpq: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: libpq:x86-windows
Vcpkg version: 2020.02.04-nohash
stdout-x86-windows.log
x86-windows.vcpkg_abi_info.txt

@michealowen Can you confirm these files are in _F:owencpp_workspacevcpkgvcpkg-masterinstalledx86-windowstoolsopenssl_?
image

@michealowen Can you confirm these files are in _F:owencpp_workspacevcpkgvcpkg-masterinstalledx86-windowstoolsopenssl_?
image

libcrypto-1_1.dll libssl-1_1.dll are not in this directory, but openssl.cnf and openssl.exe are there.

@michealowen Please copy libcrypto-1_1.dll and libssl-1_1.dll from _F:owencpp_workspacevcpkgvcpkg-masterinstalledx86-windowsbin_ to _F:owencpp_workspacevcpkgvcpkg-masterinstalledx86-windowstoolsopenssl_ manually then rebuild libpq:x86-windows.

If this workaround can resolve this issue, please ping me.

Thanks.

If this workaround can resolve this issue, please ping me.

Thanks.

successfully installed ! Thanks ! But i still dont know why libcrypto-1_1.dll and libssl-1_1.dll are not in that directory.

Okay, confirmed, this issue is the same as #12849. The reason is that vcpkg_copy_tool_dependencies cannot successfully copy dependent libraries.

Please track #12849.

Okay, confirmed, this issue is the same as #12849. The reason is that vcpkg_copy_tool_dependencies cannot successfully copy dependent libraries.

Please track #12849.

Okay , thanks.

@michealowen Glad to read is, at last, fixed! It took us a long time to resolve the issue.

There is still a problem with libpq when building for UWP. libcrypto-1_1.dll and libssl-1_1.dll files copied as advised and the following new error occurs. No output to error logs and out logs appear to have completed successfully.

PS C:\src\vcpkg> .\vcpkg install libpq:x64-uwp
Computing installation plan...
The following packages will be built and installed:
    libpq[core,openssl,zlib]:x64-uwp
Detecting compiler hash for triplet x64-uwp...
Starting package 1/1: libpq:x64-uwp
Building package libpq[core,openssl,zlib]:x64-uwp...
Could not locate cached archive: C:\Users\Personal\AppData\Local\vcpkg\archives\f2\f223f25d1c0e97dabe9cd5bd35e2fe9c673e969c.zip
-- Using cached C:/src/vcpkg/downloads/postgresql-12.2.tar.bz2
-- Cleaning sources at C:/src/vcpkg/buildtrees/libpq/src/tgresql-12-3dcd887135.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/src/vcpkg/downloads/postgresql-12.2.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/linux/configure.patch
-- Applying patch patches/windows/minimize_install.patch
-- Using source at C:/src/vcpkg/buildtrees/libpq/src/tgresql-12-3dcd887135.clean
-- Copying libpq source files to C:/src/vcpkg/buildtrees/libpq/x64-uwp-rel...
-- Copying libpq source files... done
-- Applying patch patches/windows/Solution_RELEASE.patch
-- Applying patch patches/windows/python3_build_RELEASE.patch
-- Patches applied!
-- Building libpq x64-uwp-RELEASE...
-- Building libpq x64-uwp-RELEASE... done
-- Building libecpg_compat x64-uwp-RELEASE...
-- Building libecpg_compat x64-uwp-RELEASE... done
-- Installing libpq x64-uwp-RELEASE...
-- Installing libpq x64-uwp-RELEASE... done
-- Copying libpq source files to C:/src/vcpkg/buildtrees/libpq/x64-uwp-dbg...
-- Copying libpq source files... done
-- Applying patch patches/windows/Solution_DEBUG.patch
-- Applying patch patches/windows/python3_build_DEBUG.patch
-- Patches applied!
-- Building libpq x64-uwp-DEBUG...
-- Building libpq x64-uwp-DEBUG... done
-- Building libecpg_compat x64-uwp-DEBUG...
-- Building libecpg_compat x64-uwp-DEBUG... done
-- Installing libpq x64-uwp-DEBUG...
-- Installing libpq x64-uwp-DEBUG... done
-- Cleanup libpq x64-uwp...
-- Cleanup libpq x64-uwp... - done
-- Installing: C:/src/vcpkg/packages/libpq_x64-uwp/share/postgresql/vcpkg-cmake-wrapper.cmake
-- Installing: C:/src/vcpkg/packages/libpq_x64-uwp/share/libpq/copyright
-- Performing post-build validation
The following DLLs do not have the App Container bit set:

    C:/src/vcpkg/packages/libpq_x64-uwp/debug/bin/libecpg.dll
    C:/src/vcpkg/packages/libpq_x64-uwp/debug/bin/libecpg_compat.dll
    C:/src/vcpkg/packages/libpq_x64-uwp/debug/bin/libpgtypes.dll
    C:/src/vcpkg/packages/libpq_x64-uwp/debug/bin/libpq.dll
    C:/src/vcpkg/packages/libpq_x64-uwp/bin/libecpg.dll
    C:/src/vcpkg/packages/libpq_x64-uwp/bin/libecpg_compat.dll
    C:/src/vcpkg/packages/libpq_x64-uwp/bin/libpgtypes.dll
    C:/src/vcpkg/packages/libpq_x64-uwp/bin/libpq.dll

This bit is required for Windows Store apps.
Found 1 error(s). Please correct the portfile:
    C:\src\vcpkg\ports\libpq\portfile.cmake
-- Performing post-build validation done
Error: Building package libpq:x64-uwp failed with: POST_BUILD_CHECKS_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: libpq:x64-uwp
  Vcpkg version: 2020.06.15-nohash

Additionally, attach any relevant sections from the log files above.
PS C:\src\vcpkg>

@skealy Did you follow my comments to modify portfile.cmake ?

Yes files were copied. I stated this in the first line of my message. When I did this the ssl error is resolved but the new message about App Container bit appeared.

@skealy It may be caused by libpq not exporting the required information in the Windows Store App (UWP is not supported).

I disabled Store Apps and still got the same error. There must be another issue causing the problem.

@skealy Is there any particular reason you require UWP?
I thought this issue was resolved though!

If libpq is installed in vcpkg as :x86-windows or :x64-windows a c++/WinRT project (say a Blank App C++/WinRT) cannot use the windows version (the header file libpq-fe.h cannot be found). I have tested by installing sqlite3 in vcpkg. The windows and uwp versions all sucessfully install. A Blank App C++/Winrt project can use the uwp version and can see the libpq-fe.h header.
As vcpkg is designed to manage c++ libraries it should be able to support C++/WinRT projects which are exclusively modern c++. For this to be possible a uwp version must be available and if it will not install libpq cannot be used with C++/WinRT. This may well apply to other libraries in the vcpkg project but I have not tested any others.

@skealy Could you please open a new issue to report that?

Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

angelmixu picture angelmixu  Â·  3Comments

cskrisz picture cskrisz  Â·  3Comments

invy picture invy  Â·  3Comments

pkeir picture pkeir  Â·  3Comments

oahzuw picture oahzuw  Â·  3Comments