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

AppImage useability verification #421

Closed
DevilXD opened this issue Jan 19, 2024 · 5 comments · Fixed by #423
Closed

AppImage useability verification #421

DevilXD opened this issue Jan 19, 2024 · 5 comments · Fixed by #423
Labels
Question Further information is requested

Comments

@DevilXD
Copy link
Owner

DevilXD commented Jan 19, 2024

@guihkx Hey. I've made some changes to the AppImage builder recently, to facilitate building the development version on Python 3.10. The CI seems to pass now, but I'm not entirely sure if the resulting AppImage application will even work.

Since I don't really have a Linux environment to check that, I'd like to kindly ask you to take a look at the changes, and check if the compiled version still works. If you can and in some spare time, of course. Otherwise, well, I guess someone will file a new issue if it turns out not to be working as expected.

Here's a diff: f125bf0...master

@DevilXD DevilXD added the Question Further information is requested label Jan 19, 2024
@guihkx
Copy link
Contributor

guihkx commented Jan 19, 2024

Unfortunately, the AppImage broke with those changes:

$ ./Twitch.Drops.Miner-x86_64.AppImage
Traceback (most recent call last):
  File "/tmp/.mount_TwitchY8a1jo/usr/src/main.py", line 25, in <module>
    from translate import _
  File "/tmp/.mount_TwitchY8a1jo/usr/src/translate.py", line 7, in <module>
    from utils import json_load, json_save
  File "/tmp/.mount_TwitchY8a1jo/usr/src/utils.py", line 26, in <module>
    import yarl
ModuleNotFoundError: No module named 'yarl'

If I had to guess, that error occurs because we're still including Python 3.8 within the AppImage, but the PyPA dependencies were installed with Python 3.10 and are located in a different directory than expected.

You've upgraded the Ubuntu runners from 20.04 (codename focal) to 22.04 (codename jammy), but forgot to update the repositories and GPG key on the AppImageBuilder recipe here:

- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal main universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates main universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-backports main universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-security main universe
key_url: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32

In any case, I wouldn't recommend upgrading to 22.04 anyway (unless absolutely necessary), because the AppImage package (and I think the PyInstaller package as well) will stop working for 20.04 users.

And Ubuntu 20.04 will still be officially supported until April of 2025, so there will definitely be users of this version for quite a while...

@DevilXD
Copy link
Owner Author

DevilXD commented Jan 20, 2024

Okay, so it looks like I fucked it up real bad 😓 I probably shouldn't be touching this without your guidance, but the development builds have to use Python 3.10 from now on.

I guess I'm reversing the runner back to ubuntu-20.04, on both PyInstaller and AppImage builders.

we're still including Python 3.8 within the AppImage

To resolve issues with SSL certificates (#386), 91f2dac includes truststore on both, Windows and Linux versions. For it to work though, Python has to be upgraded from 3.8 to 3.10, which I tried to accomplish with the discussed series of commits.

Truststore seems to be installed, indicating the Python upgrade worked, at least partially:
picture

Unfortunately, I am unable to make the appimage-builder use python3.10 instead of whatever else it uses. Nothing in the documentation indicates how the interpreter is chosen, or how it can be changed. Any ideas?

@guihkx
Copy link
Contributor

guihkx commented Jan 20, 2024

Alright, so if we use Ubuntu 20.04, I think we must use actions/setup-python to install Python 3.10, or maybe use some non-official PPA.

The problem with the first approach is: We have to figure out a way to also include that version of Python within the final AppImage.

You see, the way AppImageBuilder works, is by including packages from the official Ubuntu repositories. For instance, here:

include:
- gir1.2-appindicator3-0.1
- python3-tk

AppImageBuilder will look at these two packages (gir1.2-appindicator3-0.1, python3-tk), look up every single dependency, and include them in the final AppImage.

But because we're still using packages from Ubuntu 20.04 (focal) here:

- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal main universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates main universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-backports main universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-security main universe
key_url: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32

That means version 3.8 of Python gets included in the final AppImage, and not version 3.10.

Anyway, I'll investigate how actions/setup-python works internally, and then I can probably include in the AppImage the Python binaries they're using.

If that doesn't work, then we'll have to try plan B (less desirable): We stick to ubuntu-latest (Ubuntu 22.04), get rid of actions/setup-python altogether (Ubuntu 22.04 already offers Python 3.10 by default), and then do some small adjustments to the AppImageBuilder script.

The drawback to plan B, like I mentioned earlier, is that the app won't run on Ubuntu 20.04 (and derivative distros), but oh well.

@DevilXD
Copy link
Owner Author

DevilXD commented Jan 20, 2024

If it means greater compatibility, i'm good with plan A. Focal version of python3-tk indicates that only Python 3.8 is supported though, and I'm assuming that's why only that version gets included. The Jammy version of python3-tk seems to be for Python 3.10, but that's available only on Ubuntu 22.04 =/

Whatever actions/setup-python does, it seems to put python3.10 somewhere on the PATH. That should be enough to make everything work, assuming the python3-tk package somehow derives from the python3.10 installation, but it doesn't due to the above. Wouldn't including python3.10 instead solve this? I don't know what happens with tkinter support with that though.

For now, I'm reverting the AppImage section specifically, back to using the default Python 3.8.

@guihkx
Copy link
Contributor

guihkx commented Jan 22, 2024

Okay, so unfortunately plan B seems to be path of least resistance.

Internally, actions/setup-python downloads a custom Python 3.10 build from here and prepends it to PATH.

And while I could technically include that Python build in the AppImage, it's not really an ideal build to ship to users, because all binaries include debug symbols, a bunch of test cases, and other unnecessary files that just makes the whole thing really annoying to clean up before we can include it in the AppImage.

So, since Python 3.10 is pretty much needed to resolve these certificate issues, my proposal is to simply generate the AppImage on Ubuntu 22.04, and then document it that users should have least glibc 2.35 to run the AppImage with no issues.

By the way, this version increase in glibc does not affect the PyInstaller package, which should still work just fine with glibc 2.31.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants