Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

No OpenSSL support built in to package #25

Open
vadixidav opened this issue Jun 29, 2017 · 9 comments
Open

No OpenSSL support built in to package #25

vadixidav opened this issue Jun 29, 2017 · 9 comments
Assignees

Comments

@vadixidav
Copy link

QT can be built with OpenSSL support. It uses -no-openssl, -openssl, and -openssl-linked from here. The most relevant fact is that it only adds OpenSSL support if it detects an OpenSSL library to link against and OpenSSL headers, so -no-openssl is the most important flag to control this. The package I got from Qt/5.7.1@osechet/stable in Conan gave me a copy of QT without OpenSSL support built in: error C2039: 'sslErrors': is not a member of 'QNetworkAccessManager'. Using OpenSSL with QT should be an option that brings OpenSSL in as a dependency. I also had OpenSSL added as a dependency, but without QT being built with the right settings it simply doesn't have the capability to use it.

Is there a workaround, or can we add this to the package settings somehow?

@osechet
Copy link
Owner

osechet commented Jun 29, 2017

There is no workaround for the moment. I agree about the fact it should be configurable in the package. I'll add it as an option as soon as possible.

@osechet osechet self-assigned this Jun 29, 2017
@osechet
Copy link
Owner

osechet commented Jul 3, 2017

@vadixidav Is it ok for you to test with Qt 5.8.0? I made the change in the testing/5.8.0 branch. It would take too long to update all the packages up to 5.7.1.
If it's ok for you, please setup my personal bintray repo (conan-transit is now read-only): https://bintray.com/osechet/Conan, and update your conanfile to depends on Qt/5.8.0@osechet/testing. The new options is openssl and has 3 possible values: yes, no, linked. You may have to update the package reference to point to my repo. The new package should be available in 8 or 9 hours from now. You can check the status of the build here: https://ci.appveyor.com/project/osechet/conan-qt/build/1.0.191

@osechet
Copy link
Owner

osechet commented Jul 3, 2017

@vadixidav Thinking about it, you don't have to wait for the build to be complete since you'll have to rebuild your own Qt with openssl support. The change is already available in my repo. Just set it up, update your conanfile and the remote reference.

@vadixidav
Copy link
Author

So, I have found that it is necessary to also specify self.options["OpenSSL"].no_zlib = True when using the openssl option, since zlib from openssl conflicts with QT's zlib. You might want to add that it before merging this to release.

@vadixidav
Copy link
Author

I can't build it with or without the configure flag (-no-zlib) and with or without openssl's zlib (self.options["OpenSSL"].no_zlib = True). Any combination of those leads to the above error. It builds fine so long as openssl isn't being linked, but as soon as I try to link openssl in any way (using the openssl=yes or openssl=linked option) it fails. I am on windows and building with VS 2015 (MSVC 14) for 64-bit. The same thing happens in powershell and a MinGW shell with MSVC's tools in the path. I get the following error that complains at the linker stage about compress2 and uncompress:

        link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='M
icrosoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture
='*'" /MANIFEST:embed /OUT:..\..\..\bin\moc.exe @C:\Users\worleyg\AppData\Local\Temp\nm12EE.tmp
Qt5Bootstrap.lib(qbytearray.obj) : error LNK2019: unresolved external symbol compress2 referenced in function "class QBy
teArray __cdecl qCompress(unsigned char const *,int,int)" (?qCompress@@YA?AVQByteArray@@PEBEHH@Z)
Qt5Bootstrap.lib(qbytearray.obj) : error LNK2019: unresolved external symbol uncompress referenced in function "class QB
yteArray __cdecl qUncompress(unsigned char const *,int)" (?qUncompress@@YA?AVQByteArray@@PEBEH@Z)
..\..\..\bin\moc.exe : fatal error LNK1120: 2 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\link.EXE"' : return code '
0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"' : return code
'0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.

Qt/5.8.0@vadix/stable: ERROR: Package '8d6d24cc7b3687214215b1b6db6283e2a14dccef' build failed
Qt/5.8.0@vadix/stable: WARN: Build folder C:/.conan\ib28fy\1
ERROR: Qt/5.8.0@vadix/stable: Error in build() method, while calling '_build_msvc', line 183
        % (self.source_dir, vcvars, build_command, " ".join(build_args)))
        ConanException: Error 2 while executing cd qt5 && call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Comm
on7\Tools\../../VC/vcvarsall.bat" amd64 && nmake.exe

@vadixidav
Copy link
Author

So, I tried using system-zlib, and it seems that QT isn't finding zlib at all even when I specifically add it as a dependency for this package in requirements. This is what I am seeing right now, and I am attempting to investigate:

ERROR: Feature 'system-zlib' was enabled, but the pre-condition 'libs.zlib' failed.

Check config.log for details.

Qmake failed, return code 3


Qt/5.8.0@vadix/stable: ERROR: Package 'd16dd14d87c7a91ddefa95e6fb3a73bb298414bf' build failed
Qt/5.8.0@vadix/stable: WARN: Build folder C:/.conan\cjpvgx\1
ERROR: Qt/5.8.0@vadix/stable: Error in build() method, while calling '_build_msvc', line 182
        % (self.source_dir, vcvars, " ".join(args)))
        ConanException: Error 3 while executing cd qt5 && call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Comm
on7\Tools\../../VC/vcvarsall.bat" amd64 && configure -opensource -confirm-license -nomake examples -nomake tests -prefix
 C:/.conan\tcogu8\1 -release -platform win32-msvc2015 -opengl desktop -openssl-linked -system-zlib

@vadixidav
Copy link
Author

vadixidav commented Aug 3, 2017

I resolved this issue by adding this to config_options:

        if self.options.openssl in ["yes", "linked"]:
             self.options["OpenSSL"].no_zlib = True
             self.options["OpenSSL"].shared = True

Edit: Nevermind, it only worked from the command line. Investigating more.

@vadixidav
Copy link
Author

Okay, I mistakenly added the above options to config_options, which is the wrong place for them. After adding them to configure it worked:

        if self.options.openssl in ["yes", "linked"]:
             self.options["OpenSSL"].no_zlib = True
             self.options["OpenSSL"].shared = True

Basically, the openssl dependency must be shared and without zlib when building with openssl support.

@tonka3000
Copy link

Could it be that this is the problem with the OpenSSL lib on windows?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants