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

openssl build failure on mingw #12919

Closed
ashishvarman opened this issue Aug 15, 2020 · 25 comments · Fixed by #12986
Closed

openssl build failure on mingw #12919

ashishvarman opened this issue Aug 15, 2020 · 25 comments · Fixed by #12986
Assignees

Comments

@ashishvarman
Copy link

Host Environment

  • OS: Windows 10
  • Compiler: gcc 7.3.0 (from mingw-w64 bundled with Qt 5.12.6)

To Reproduce
Steps to reproduce the behavior:
./vcpkg install openssl:x64-mingw-dynamic

Failure logs
E:\vcpkg-orig>vcpkg install openssl:x64-mingw-dynamic
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:
openssl[core]:x64-mingw-dynamic

  • openssl-unix[core]:x64-mingw-dynamic
    Additional packages (*) will be modified to complete this operation.
    Detecting compiler hash for triplet x64-mingw-dynamic...
    Starting package 1/2: openssl-unix:x64-mingw-dynamic
    Building package openssl-unix[core]:x64-mingw-dynamic...
    Could not locate cached archive: C:\Users\ashish.varman\AppData\Local\vcpkg\archives\2f\2fa3d0eddad98e88cdd65d1a83b585b2af0e2696.zip
    -- Using community triplet x64-mingw-dynamic. This triplet configuration is not guaranteed to succeed.
    -- [COMMUNITY] Loading triplet configuration from: E:\vcpkg-orig\triplets\community\x64-mingw-dynamic.cmake
    -- Using cached E:/vcpkg-orig/downloads/openssl-1.1.1g.tar.gz
    -- Cleaning sources at E:/vcpkg-orig/buildtrees/openssl-unix/src/1.1.1g-bb2a9a5801.clean. Use --editable to skip cleaning for the packages you specify.
    -- Extracting source E:/vcpkg-orig/downloads/openssl-1.1.1g.tar.gz
    -- Using source at E:/vcpkg-orig/buildtrees/openssl-unix/src/1.1.1g-bb2a9a5801.clean
    -- Acquiring MSYS Packages...
    -- Acquiring MSYS Packages... OK
    -- Configuring x64-mingw-dynamic
    -- Building x64-mingw-dynamic-dbg
    CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:139 (message):
    Command failed: E:/vcpkg-orig/downloads/tools/cmake-3.17.2-windows/cmake-3.17.2-win32-x86/bin/cmake.exe --build . --config Debug --target install -- -v
    Working Directory: E:/vcpkg-orig/buildtrees/openssl-unix/x64-mingw-dynamic-dbg
    See logs for more information:
    E:\vcpkg-orig\buildtrees\openssl-unix\install-x64-mingw-dynamic-dbg-out.log

Call Stack (most recent call first):
scripts/cmake/vcpkg_build_cmake.cmake:91 (vcpkg_execute_build_process)
scripts/cmake/vcpkg_install_cmake.cmake:24 (vcpkg_build_cmake)
ports/openssl-unix/portfile.cmake:51 (vcpkg_install_cmake)
scripts/ports.cmake:79 (include)

Error: Building package openssl-unix:x64-mingw-dynamic 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: openssl-unix:x64-mingw-dynamic
Vcpkg version: 2020.06.15-nohash

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

install-x64-mingw-dynamic-dbg-out.log

Additional context
Trying to use cpr for http retrieval in a private library for use in a qt project. Private library doesn't use qt. I suppose this issue (dependency on openssl) will be there regardless of which http library is used. Cannot use MSVC because an ActiveX GUI component (TeeChart) being used in the final project doesn't generate usable interface for Qt-MSVC.

@ashishvarman ashishvarman changed the title openssl mingw build failure openssl build failure on mingw Aug 15, 2020
@sfhacker
Copy link

We have found no issues at all building it from source on MinGW!

image

Perhaps your environment is 'polluted' somehow! Have you tried some other alternatives?

@ashishvarman
Copy link
Author

It is heartening to know that the problem is most probably isolated to my environment as well and not the package or build system.
Unfortunately, the error messages or the debug log attached above offer no clues as to what exactly is wrong - to me at least. I am not well versed with build tools and have depended on IDEs till now.
As for alternatives, I tried different version of Qt (5.15.0) as well but the same error came. What other alternatives can I try?

@ashishvarman
Copy link
Author

just tried on an msys2 mingw installation - same error

@sfhacker
Copy link

I build large projects from source on a regular basis without issues!
Have you tried MinGW environment? It works very well. There is no need to use third party tools.

Have fun.

@ashishvarman
Copy link
Author

ashishvarman commented Aug 16, 2020

I am using MinGW - that bundled with Qt. I have also tried MSYS2. Should I use any other?

My prime need for using vcpkg is the richer set of libraries that are much easier to use - e.g. sqlite-modern-cpp or sqlitecpp instead of using sqlite3 directly and cpr instead of curl and openssl directly.

If nothing works out, most probably I will make a separate python exe that will take a url and save to file and read from that. Though it still seems odd that a simple task such as https retrieval is so difficult for me on C++ - on which I have been working for more than 10 years and a simple 2 liner in python - on which I have started since 2 years 😐 Perhaps leaving MSVC for MinGW was not such a great idea after all.

@sfhacker
Copy link

If you lack the skills to build simple projects from source, you can download binaries from different sources.
We have had no need for third party tools (a.k.a. vcpkg) so far. We build quite large projects from source with MinGW on Windows. No other tools or projects are required. No VS, no SDK, etc.
If you point me to the libraries/projects you need to use, I can build them for you and make them available.

@sfhacker
Copy link

You mentioned MinGW (Qt) and MSYS2. Can you post here the errors you are getting while using MinGW and MSYS2?

@ashishvarman
Copy link
Author

The errors are identical to the first I posted. Only the path of the tools being used differs in the log file according to the toolchain being used. I am attaching the MSYS2 log file.

install-x64-mingw-dynamic-dbg-out.msys64.log

Just saw that according to log message by @cristianadam , STL's mingw distro is being used to test x64-mingw makefiles. Will try that as well and report the result.

@sfhacker
Copy link

Perhaps I wasn't clear (enough)!
Can you follow these simple steps and report back you findings?

a) Configure .......
b) make all
c) make install

Example:

image

Cheers.

@ashishvarman
Copy link
Author

ashishvarman commented Aug 17, 2020

Sorry for not understanding what you required and thanks once again for helping me. Unfortunately, MinGW bundled with Qt doesn't have perl which is required for Configure above and there doesn't seem to be a way to install arbitrary packages. My MSYS2 install also seems corrupted - keeps giving error about PGP keys when I try to search for perl pacman -Ss perl. Will try with a fresh reinstall of MSYS2 tomorrow.

image

Thanks for bearing with me once again.

@sfhacker
Copy link

I am getting frustated with your current situation since nothing seems to work properly on your end!
Who told you to use MinGW from Qt? Who asked you to use MSYS2?
As far as we can see, neither of them are useful!
May I ask if you are junior employee? or perhaps a sophomore?

I took me 2 mins to build OpenSSL 1.1.1g from source without installing a single app or tool.
I am a bit lost now!!! Do you want me to email you the OpenSSL just built library?
Do you want me to build some projects for you and then I make them available for you to download?

Please, advise how to proceed.

Cheers.

@ashishvarman
Copy link
Author

I am getting frustated with your current situation since nothing seems to work properly on your end!

Believe me - I am frustrated as well.

Who told you to use MinGW from Qt? Who asked you to use MSYS2?

My employer makes engineering GUI software on windows using Visual C++. I have fought for years for migrating from Microsoft / MFC and finally Qt with MinGW gave us the results we wanted as well as satisfying all the legal and corporate requirements. Also, we had to select a toolchain and design a workflow that is easy for developers since attracting talent is next to impossible in a tier 2 town in India and we have to make do with what we get.

As far as we can see, neither of them are useful!

You are correct. However, Qt + MinGW has served our purpose till now of making C++ GUI applications on Windows.

May I ask if you are junior employee? or perhaps a sophomore?

I wish - then I would have just gone to my seniors with my problem. As of now, it is up to me to find a solution to easily retrieve http content in C++ which should be simple enough that our developers can use it without messing it up. I have explored curl, boost::asio and boost::beast and cpr seems to be much much easier than any of them. In any case, openssl is a requirement for all of them for HTTPS. We were using vcpkg for using libraries in visual studio and it carried over when we moved to Qt. Some libs that were either not available (talib) or not buildable (boost) in vcpkg with the Qt + MinGW toolchain, we manged to build ourselves.

I took me 2 mins to build OpenSSL 1.1.1g from source without installing a single app or tool.
I am a bit lost now!!! Do you want me to email you the OpenSSL just built library?
Do you want me to build some projects for you and then I make them available for you to download?

Please, advise how to proceed.

I think that currently the best course for me to get the work moving again is to just make a python exe and call it from C++. Later, when I can get openssl to build or integrate its binaries, I will try to come back to using cpr again.

If I get the time, I will also try with STL's MinGW distro. If the vcpkg maintainers have tested x64 builds with it then I have high hopes of it working.
In the meantime, if anybody from the community corrects the openssl vcpkg build on Qt + MinGW toolchain, it would be much beneficial to all of us who use it.

Cheers.

Thanks and Regards

@cristianadam
Copy link
Contributor

cristianadam commented Aug 18, 2020

Qt Installer comes with MinGW and Perl (Strawberry Perl), as perl is required to build Qt itself.

The MinGW shipped with Qt Installer (GCC 7.3, or the latest 8.1) should be sufficient to build OpenSSL using vcpkg. It is not sufficient to build vcpkg itself.

@cristianadam
Copy link
Contributor

I decided to give it a try.

  1. I've build vcpkg with MSVC 2019 since MinGW 8.1 shipped with Qt doesn't have the necessary bits to build vcpkg itself
  2. In a shell with MinGW 8.1 and perl I ran:
    $ vcpkg install openssl:x64-mingw-dynamic

I would expect the recipe that vcpkg has to see that it has perl and then it should simply compile OpenSSL with its perl build system.

But instead it downloaded msys2 and what not, and in the end if failed miserably:

$ vcpkg install openssl:x64-mingw-dynamic
Computing installation plan...
The following packages will be built and installed:
    openssl[core]:x64-mingw-dynamic
  * openssl-unix[core]:x64-mingw-dynamic
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-mingw-dynamic...
Starting package 1/2: openssl-unix:x64-mingw-dynamic
Building package openssl-unix[core]:x64-mingw-dynamic...
Could not locate cached archive: C:\Users\Cristian\AppData\Local\vcpkg/archives\c6\c6a7b98dd6cb2770d2a7149efe71172b0dd94356.zip
-- Using community triplet x64-mingw-dynamic. This triplet configuration is not guaranteed to succeed.
-- [COMMUNITY] Loading triplet configuration from: C:\Projects\github\vcpkg\triplets\community\x64-mingw-dynamic.cmake
-- Downloading https://www.openssl.org/source/openssl-1.1.1g.tar.gz...
-- Extracting source C:/Projects/github/vcpkg/downloads/openssl-1.1.1g.tar.gz
-- Using source at C:/Projects/github/vcpkg/buildtrees/openssl-unix/src/1.1.1g-bb2a9a5801.clean
-- Acquiring MSYS2...
-- Downloading https://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-base-x86_64-20190524.tar.xz/download...
-- Downloading http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz...
-- Downloading http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig...
gpg: /etc/pacman.d/gnupg/trustdb.gpg: trustdb created
gpg: no ultimately trusted keys found
gpg: starting migration from earlier GnuPG versions
gpg: porting secret keys from '/etc/pacman.d/gnupg/secring.gpg' to gpg-agent
gpg: migration succeeded
gpg: Generating pacman keyring master key...
gpg: key 94F7EDF429443652 marked as ultimately trusted
gpg: directory '/etc/pacman.d/gnupg/openpgp-revocs.d' created
gpg: revocation certificate stored as '/etc/pacman.d/gnupg/openpgp-revocs.d/A450182F282D4D06F3BC14B794F7EDF429443652.rev'
gpg: Done
==> Updating trust database...
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
==> Appending keys from msys2.gpg...
==> Locally signing trusted keys in keyring...
  -> Locally signing key D55E7A6D7CE9BA1587C0ACACF40D263ECA25678A...
  -> Locally signing key 123D4D51A1793859C2BE916BBBE514E53E0D0813...
  -> Locally signing key B91BCF3303284BF90CC043CA9F418C233E652008...
  -> Locally signing key 9DD0D4217D75A33B896159E6DA7EF2ABAEEA755C...
==> Importing owner trust values...
gpg: setting ownertrust to 4
gpg: setting ownertrust to 4
gpg: setting ownertrust to 4
gpg: inserting ownertrust of 4
==> Updating trust database...
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
gpg: depth: 0  valid:   1  signed:   4  trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: depth: 1  valid:   4  signed:   3  trust: 0-, 0q, 0n, 4m, 0f, 0u
gpg: depth: 2  valid:   3  signed:   0  trust: 3-, 0q, 0n, 0m, 0f, 0u
==> Checking C:/Projects/github/vcpkg/downloads/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig...
gpg: assuming signed data in 'C:/Projects/github/vcpkg/downloads/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz'
gpg: Signature made Mon Jun 29 07:36:14 2020 WEST
gpg:                using DSA key AD351C50AE085775EB59333B5F92EFC1A47D45A1
gpg: Good signature from "Alexey Pavlov (Alexpux) <alexpux@gmail.com>" [full]
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) msys2-keyring-r21.b39fb11-1

Total Installed Size:  0.05 MiB
Net Upgrade Size:      0.03 MiB

:: Proceed with installation? [Y/n]
checking keyring...
checking package integrity...
loading package files...
checking for file conflicts...
checking available disk space...
:: Processing package changes...
upgrading msys2-keyring...
==> Appending keys from msys2.gpg...
==> Locally signing trusted keys in keyring...
  -> Locally signing key 6E8FEAFF9644F54EED90EEA0790AE56A1D3CFDDC...
  -> Locally signing key D55E7A6D7CE9BA1587C0ACACF40D263ECA25678A...
  -> Locally signing key 123D4D51A1793859C2BE916BBBE514E53E0D0813...
  -> Locally signing key B91BCF3303284BF90CC043CA9F418C233E652008...
  -> Locally signing key 9DD0D4217D75A33B896159E6DA7EF2ABAEEA755C...
  -> Locally signing key 69985C5EB351011C78DF7F6D755B8182ACD22879...
==> Importing owner trust values...
gpg: setting ownertrust to 4
gpg: setting ownertrust to 4
==> Disabling revoked keys in keyring...
  -> Disabling key B19514FB53EB3668471B296E794DCF97F93FC717...
==> Updating trust database...
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
gpg: depth: 0  valid:   1  signed:   6  trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: depth: 1  valid:   6  signed:   6  trust: 0-, 0q, 0n, 6m, 0f, 0u
gpg: depth: 2  valid:   6  signed:   0  trust: 6-, 0q, 0n, 0m, 0f, 0u
gpg: next trustdb check due at 2021-06-19
:: Synchronizing package databases...
downloading mingw32.db...
downloading mingw32.db.sig...
downloading mingw64.db...
downloading mingw64.db.sig...
downloading msys.db...
downloading msys.db.sig...
resolving dependencies...
looking for conflicting packages...

Packages (3) libzstd-1.4.5-2  zstd-1.4.5-2  pacman-5.2.2-1

Total Download Size:    11.31 MiB
Total Installed Size:   34.03 MiB
Net Upgrade Size:      -12.57 MiB

:: Proceed with installation? [Y/n]
:: Retrieving packages...
downloading libzstd-1.4.5-2-x86_64.pkg.tar.xz...
downloading zstd-1.4.5-2-x86_64.pkg.tar.xz...
downloading pacman-5.2.2-1-x86_64.pkg.tar.xz...
checking keyring...
checking package integrity...
loading package files...
checking for file conflicts...
checking available disk space...
:: Processing package changes...
installing libzstd...
installing zstd...
upgrading pacman...
checking dependencies...

Packages (2) rebase-4.4.4-1  dash-0.5.10.2-1

Total Removed Size:  1.12 MiB

:: Do you want to remove these packages? [Y/n]
:: Processing package changes...
removing rebase...
removing dash...
:: Synchronizing package databases...
 mingw32 is up to date
 mingw64 is up to date
 msys is up to date
:: Starting core system upgrade...
resolving dependencies...
warning: terminate other MSYS2 programs before proceeding
looking for conflicting packages...

Packages (5) bash-4.4.023-2  filesystem-2020.02-7  mintty-1~3.3.0-1  msys2-runtime-3.1.6-3  pacman-mirrors-20200329-1

Total Download Size:    5.27 MiB
Total Installed Size:  24.38 MiB
Net Upgrade Size:       1.26 MiB

:: Proceed with installation? [Y/n]
:: Retrieving packages...
downloading msys2-runtime-3.1.6-3-x86_64.pkg.tar.xz...
downloading bash-4.4.023-2-x86_64.pkg.tar.xz...
downloading filesystem-2020.02-7-x86_64.pkg.tar.xz...
downloading mintty-1.3.3.0-1-x86_64.pkg.tar.xz...
downloading pacman-mirrors-20200329-1-any.pkg.tar.xz...
checking keyring...
checking package integrity...
loading package files...
checking for file conflicts...
checking available disk space...
:: Processing package changes...
upgrading msys2-runtime...
upgrading bash...
upgrading filesystem...
upgrading mintty...
upgrading pacman-mirrors...
:: To complete this update all MSYS2 processes including this terminal will be closed. Confirm to proceed [Y/n] warning: terminating MSYS2 processes failed

-- Acquiring MSYS2... OK
-- Acquiring MSYS Packages from C:/Projects/github/vcpkg/downloads/tools/msys2-20200812...
-- Acquiring MSYS Packages... OK
-- Found external ninja('1.10.0').
-- Configuring x64-mingw-dynamic
-- Building x64-mingw-dynamic-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:139 (message):
    Command failed: C:/Tools/cmake/bin/cmake.exe --build . --config Debug --target install -- -v
    Working Directory: C:/Projects/github/vcpkg/buildtrees/openssl-unix/x64-mingw-dynamic-dbg
    See logs for more information:
      C:\Projects\github\vcpkg\buildtrees\openssl-unix\install-x64-mingw-dynamic-dbg-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_build_cmake.cmake:91 (vcpkg_execute_build_process)
  scripts/cmake/vcpkg_install_cmake.cmake:24 (vcpkg_build_cmake)
  ports/openssl-unix/portfile.cmake:51 (vcpkg_install_cmake)
  scripts/ports.cmake:79 (include)


Error: Building package openssl-unix:x64-mingw-dynamic 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: openssl-unix:x64-mingw-dynamic
  Vcpkg version: 2020.06.15-unknownhash

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

Then for the fun of it I tried building zlib, which worked a few weeks ago:

$ vcpkg install zlib:x64-mingw-dynamic
Computing installation plan...
The following packages will be built and installed:
    zlib[core]:x64-mingw-dynamic
Detecting compiler hash for triplet x64-mingw-dynamic...
Starting package 1/1: zlib:x64-mingw-dynamic
Building package zlib[core]:x64-mingw-dynamic...
Could not locate cached archive: C:\Users\Cristian\AppData\Local\vcpkg/archives\bd\bd352daeca664425b6833557e217e7989326e934.zip
-- Using community triplet x64-mingw-dynamic. This triplet configuration is not guaranteed to succeed.
-- [COMMUNITY] Loading triplet configuration from: C:\Projects\github\vcpkg\triplets\community\x64-mingw-dynamic.cmake
-- Using cached C:/Projects/github/vcpkg/downloads/zlib1211.tar.gz
-- Extracting source C:/Projects/github/vcpkg/downloads/zlib1211.tar.gz
-- Applying patch cmake_dont_build_more_than_needed.patch
-- Applying patch add_debug_postfix_on_mingw.patch
-- Using source at C:/Projects/github/vcpkg/buildtrees/zlib/src/1.2.11-1d48fa5a18.clean
-- Found external ninja('1.10.0').
-- Configuring x64-mingw-dynamic
-- Building x64-mingw-dynamic-dbg
-- Building x64-mingw-dynamic-rel
-- Fixing pkgconfig
-- Fixing pkgconfig - release
-- Checking file: C:/Projects/github/vcpkg/packages/zlib_x64-mingw-dynamic/lib/pkgconfig/zlib.pc
-- pkg_cfg_cmd call with:C:/Strawberry/perl/bin/pkg-config --exists zlib failed
-- ENV{PKG_CONFIG_PATH}:/C/Projects/github/vcpkg/installed/x64-mingw-dynamic/lib/pkgconfig:/C/Projects/github/vcpkg/installed/x64-mingw-dynamic/share/pkgconfig:/C/Projects/github/vcpkg/packages/zlib_x64-mingw-dynamic/lib/pkgconfig:/C/Projects/github/vcpkg/packages/zlib_x64-mingw-dynamic/share/pkgconfig
-- pkg-config call failed with error code:%1 is not a valid Win32 application
-- pkg-config output:
CMake Error at scripts/cmake/vcpkg_fixup_pkgconfig.cmake:84 (message):
  pkg-config error output:
Call Stack (most recent call first):
  scripts/cmake/vcpkg_fixup_pkgconfig.cmake:316 (vcpkg_fixup_pkgconfig_check_files)
  ports/zlib/portfile.cmake:47 (vcpkg_fixup_pkgconfig)
  scripts/ports.cmake:79 (include)


Error: Building package zlib:x64-mingw-dynamic 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:x64-mingw-dynamic
  Vcpkg version: 2020.06.15-unknownhash

No idea why vcpkg zlib recipe is trying to use pkg-config. As far as I know zlib had a CMake build system.

vcpkg support with MinGW (not MSYS2) is experimental and its recipe quality is getting worse.

@cristianadam
Copy link
Contributor

Actually it's OpenSSL which is wrong here. It assumes MinGW is always MSYS2.

$ perl configure mingw64
Configuring OpenSSL version 1.1.1g (0x1010107fL) for mingw64
Using os-specific seed configuration

******************************************************************************
This perl implementation doesn't produce Unix like paths (with forward slash
directory separators).  Please use an implementation that matches your
building platform.

This Perl version: 5.30.2 for MSWin32-x64-multi-thread
******************************************************************************

This explains why vcpkg is trying to use msys2.

I tried changing vcpkg\buildtrees\openssl-unix\src\1.1.1g-bb2a9a5801.clean\Configurations\10-main.conf from BASE_unix to BASE_windows, but the makefile it produced is not compatible with mingw32-make.

I'll add a comment at openssl/openssl#10902

@ashishvarman
Copy link
Author

I see that @longnguyen2004 made a fix #12089 to issue #9749 but later deleted his branch because of some mess up. Hopefully, when #9749 is fixed then this will be too.

@ashishvarman
Copy link
Author

Qt Installer comes with MinGW and Perl (Strawberry Perl), as perl is required to build Qt itself.

Unfortunately, it seems that the online installer does not install perl and installs the pre-built Qt binaries directly. I couldn't find anything named perl in my C:\Qt directory nor anywhere else in my system. I also didn't find any mention of perl in the Qt Maintenance Tool
image

Also, I see an openssl entry at the bottom of the list. Let me install that and see if I am able to build CPR using it.

The MinGW shipped with Qt Installer (GCC 7.3, or the latest 8.1) should be sufficient to build OpenSSL using vcpkg. It is not sufficient to build vcpkg itself.

Right. I have VS2019 installed and that is used to build vcpkg by the bootstrap-vcpkg.bat script.

@longnguyen2004
Copy link
Contributor

I've made another PR #12544 and it has passed long ago. Maybe this is another problem, since I regularly tests with x64-mingw-dynamic. I'll try pulling latest master tomorrow and see if anything breaks

@longnguyen2004
Copy link
Contributor

And yes I'm also very frustrated with openssl's build system being completely dependent on MSYS2 perl, which is the main show stopper in my effort moving away from MSYS2. I've tried patching the build system but then it writes unescaped backslashes into the Makefiles and sources...

@longnguyen2004
Copy link
Contributor

longnguyen2004 commented Aug 18, 2020

For other maintainers:
I've read through the logs and found x86_64-windows-gnu, which comes from this piece of code. If CMAKE_C_COMPILE_OPTIONS_TARGET is empty, this will cause problems.
Going deeper, this variable is only set for clang and clang-cl, for other compilers like gcc, this will be empty.
I'll make a quick fix tomorrow. This is NOT a triplet bug, it's a portfile bug that went unnoticed, due to me doing my testing mainly with llvm-mingw.

longnguyen2004 added a commit to longnguyen2004/vcpkg that referenced this issue Aug 19, 2020
@longnguyen2004
Copy link
Contributor

Please test #12986

@cristianadam
Copy link
Contributor

https://github.com/janbar/openssl-cmake/ is a thing. I don't know if it's being packaged by vcpkg.

@ashishvarman
Copy link
Author

Using the PR #12986 by @longnguyen2004 I was able to successfully build openssl as well as curl and cpr. It does still pull in msys2 which was perhaps expected.

I suppose I have to wait till this PR is merged before marking this as closed?

P.S. I suppose now all of boost should also build. I have built boost separately from vcpkg till now.

@longnguyen2004
Copy link
Contributor

I guess we'll have to wait for the update to boost 1.74, which fixes a few problems with mingw compilers in boost-build.
Also, openssl strictly requires Unix perl (which MSYS2 provides), and we can't use native Perl for that.

BillyONeal pushed a commit that referenced this issue Aug 20, 2020
@ashishvarman
Copy link
Author

ashishvarman commented Aug 21, 2020

Thanks everybody for the great help. Thanks @cristianadam for confirming that the problem is not with just me. And thanks @longnguyen2004 for the quick fix.

remz1337 pushed a commit to remz1337/vcpkg that referenced this issue Aug 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants