darkmattercoder / qt-build

a (nearly) full qt build environment as a docker image, small footprint, lots of versions
GNU General Public License v3.0
75 stars 17 forks source link

openssl support is not enabled #3

Closed windymindy closed 5 years ago

windymindy commented 5 years ago

Looks like libssl-dev is missing https://github.com/darkmattercoder/qt-build/blob/master/Dockerfile#L17

darkmattercoder commented 5 years ago

Thanks for your contribution. Will add it today or tomorrow

darkmattercoder commented 5 years ago

As of today, all images available at dockerhub starting at and newer than 5.9.7 have libssl-dev installed. However, I need a bit more time to adjust the older ones as I have to provide a different Openssl version to stay compatible. That also means that the current master branch in github does not yet contain the needed modifications. As long as the deploy branch does not pass the build pipeline for every version, the modifications live only there.

windymindy commented 5 years ago

I have pulled the latest image and now my code builds just fine. Thanks for the effort. Close this whenever comfortable.

darkmattercoder commented 5 years ago

Great!

Do you mind providing a snipped of the code you tested with? I could then add it as a test for the ssl compatibility.

I undestand that this might not be possible depending on the nature of your code, but nevertheless, I wanted to ask.

windymindy commented 5 years ago

This is nothing special. At build time there is a QT_NO_OPENSSL macro https://github.com/qt/qtbase/blob/5.12/src/network/ssl/qsslconfiguration.h#L65 . So if your code uses classes defined inside that macro it won't compile.

` //main.cpp

include <QtNetwork/QSslConfiguration>

int main(int argc, char* argv[]) { QSslConfiguration configuration; return 0; } `

The other thing to consider is that by default openssl is loaded dynamically without linking. And QSslSocket may fail to connect at runtime saying that openssl could not be loaded. But the last is definitely out of scope of build container image.

windymindy commented 5 years ago

libicu-dev is also missing. rabits/qt:5.xx image doesn't build qt from source, but rather uses official installer in a non-interactive way.

user@build-qt:/build$ ldd /opt/Qt/5.12.0/gcc_64/lib/libQt5Core.so linux-vdso.so.1 (0x00007ffd36d3d000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f6617639000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f661741c000) libicui18n.so.56 => /opt/Qt/5.12.0/gcc_64/lib/libicui18n.so.56 (0x00007f6616f83000) libicuuc.so.56 => /opt/Qt/5.12.0/gcc_64/lib/libicuuc.so.56 (0x00007f6616bcb000) libicudata.so.56 => /opt/Qt/5.12.0/gcc_64/lib/libicudata.so.56 (0x00007f66151e8000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6614fe4000) libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f6614de2000) libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f6614acc000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f6614743000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f66143a5000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f661418d000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6613d9c000) /lib64/ld-linux-x86-64.so.2 (0x00007f6617fe5000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f6613b2a000)

windymindy commented 5 years ago

And I can't find sources inside image. /tmp/qt_build/qt-everywhere-src-5.xx.x/build/ is empty. Therefore, I can't build sql drivers https://doc.qt.io/qt-5/sql-driver.html .

darkmattercoder commented 5 years ago

The sources are not in there by intent, to keep the image as small as possible. However, you can get the image with the sources. Simply docker pull darkmattercoder/qt-build:builder-$QT_VERSION_MAJOR.$QT_VERSION_MINOR.$QT_VERSION_PATCH. The only thing you won't get in there will be the automatic building provided by the entrypoint.sh. libicu-dev will be included in one or two days.

As for the sql stuff, I did not fully get it. Could you explain your use case further? Maybe open a new issue for it?

darkmattercoder commented 5 years ago

Openssl is now included in every image. Closing this.