SevenTV / chatterino7

Chat client for https://twitch.tv
MIT License
359 stars 70 forks source link

Fix AppImage build for Ubuntu 22.04 #241

Closed jszeluga closed 1 year ago

jszeluga commented 1 year ago

Description

Qt 5 needs to link against OpenSSL 1.1.1 but Ubuntu 22.04 only supplies OpenSSL 3.x. I added a step to build the latest OpenSSL 1.1.1 and link against that when building the AppImage

jszeluga commented 1 year ago

The Qt 5 AppImage works good. The Qt 6 AppImage throws this error

qt.tlsbackend.ossl: Incompatible version of OpenSSL (built with OpenSSL 1.x, runtime version is >= 3.x)

I looked inside the AppImage and the version 3.x libs are in there. So there might be a problem with a condition somewhere, where it's linking to OpenSSL 1.x for Qt 6. We could just disable building the AppImage for Qt 6 for the time being or try to fix it. I'm not really familiar with GitHub actions so I'm gonna need a little help

Nerixyz commented 1 year ago

We could just disable building the AppImage for Qt 6 for the time being or try to fix it.

I'd like to fix this here.

I'm not really familiar with GitHub actions so I'm gonna need a little help

Feel free to ask when you have questions.

where it's linking to OpenSSL 1.x for Qt 6

From my understanding, we're linking chatterino to libssl-dev (3.0.2), but chatterino is linked against 1.x. It feels like we can always build OpenSSL and merge the two Build (Ubuntu), Qt ${{ matrix.qt-version }} steps again.

jszeluga commented 1 year ago

From my understanding, we're linking chatterino to libssl-dev (3.0.2), but chatterino is linked against 1.x. It feels like we can always build OpenSSL and merge the two Build (Ubuntu), Qt ${{ matrix.qt-version }} steps again.

This is where I'm a little confused. We are building OpenSSL 1.x only when we are using Qt 5 and specifying the dir manually when we call CMake. We don't do that for the Qt 6 build but somehow the Qt 6 build is still linking against OpenSSL 1.x. I'm guessing that the state isn't cleared between those two steps even though they are completely conditional. Clearly the Qt 6 build is seeing the libs for OpenSSL 1.x which is causing a problem.

I guess we can either set the OPENSSL_ROOT_DIR on the Qt 6 build to the default system location or we could build OpenSSL 3.x and install it like we're doing for 1.x. Then we can update the AppImage script to have logic similar to how the Qt version is chosen.

I'm just speculating since I don't know for sure why chatterino is linking against 1.x when its Qt 6.

Nerixyz commented 1 year ago

but somehow the Qt 6 build is still linking against OpenSSL 1.x.

I'm just speculating since I don't know for sure why chatterino is linking against 1.x when its Qt 6.

No, it's the other way around, the chatterino build is linked against OpenSSL 3, but the Qt 6 libs (libqopensslbackend.so) from the distro are linked against OpenSSL 3.x. Afaik, only Qt 6 builds after 6.5 are linked against OpenSSL 3. So we need to link chatterino against OpenSSL 1.x as well.

jszeluga commented 1 year ago

Oh since the Qt 6 version we're using is 6.2.x on linux then we need to link against OpenSSL 1.x as well, so that means we can just combine the build step again and set the OPENSSL_1_1_1_DIR env variable for both Qt versions, correct?

Nerixyz commented 1 year ago

Oh since the Qt 6 version we're using is 6.2.x on linux then we need to link against OpenSSL 1.x as well, so that means we can just combine the build step again and set the OPENSSL_1_1_1_DIR env variable for both Qt versions, correct?

Yes.

jszeluga commented 1 year ago

Ok. I made the necessary change. OpenSSL 1.1.1 will build for both Qt 5 and Qt 6 Linux builds. We just have to remember to change it when we move to Qt 6.5+

Nerixyz commented 1 year ago

We just have to remember to change it when we move to Qt 6.5+

Yea, Qt 6.2.4 will probably stay for a bit longer, as that's the version Ubuntu ships, but we can update the AppImage to 6.5+ sooner.

jszeluga commented 1 year ago

Both AppImages for Qt 5 and Qt 6 work! I don't see any SSL errors and the emotes and chats load just fine. LGTM

Nerixyz commented 1 year ago

Both AppImages for Qt 5 and Qt 6 work! I don't see any SSL errors and the emotes and chats load just fine. LGTM

Thank you so much for fixing this!

jszeluga commented 1 year ago

Closes #161