-
-
Notifications
You must be signed in to change notification settings - Fork 36
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 self-updating #95
Comments
Do you just need an update check, or do you want full self-updating? In the latter case, it might make sense to ship the AppImageUpdate UI, to provide users with a real user interface. |
There is already an update check for stable releases. Full self-updating would be a much better user experience though. |
Okay, then let's build a full self-update system. |
I decided to write a Python wrapper for libappimageupdate. I always wanted to write some Python bindings, and this seems like the perfect chance for this. |
Sounds like a good idea. Please tell me when it's done. Pext would be happy to be an early adopter :) |
Almost done. Fixing the last remaining bugs. I will post a link once I'm done. I would like you to implement the update checks and actual updating process, if you don't mind, to have an external person review the library. |
Sounds good to me, I'd be happy to :) |
Check out https://github.com/TheAssassin/python-appimageupdate. It's a little buggy, but most of it seems to be libappimageupdate related. We need some unit tests in that library. It's funny that the Python unit tests are bringing up all the errors in libappimageupdate at the moment... |
The library is mostly ready, I'm still struggling with the Travis build configuration (and the Check out https://github.com/AppImage/AppImageUpdate/wiki/Guide-to-libappimageupdate for a guide how to use it. Please make use of the docstrings I wrote in the Python wrapper class, they explain the API in detail. |
I'll probably take a look at it this weekend, thank you :) |
https://github.com/Pext/Pext/tree/feature/appimageupdate seems to work...ish. There's just a few weird things.
@TheAssassin Any clue on this? Especially 1 and 3 are rather huge issues here. |
We can hack around 1 easily by calling About 2: Please open an issue in the repo, this is certainly a bug. Regarding 3, why do you need appimageupdatetool at all? Actually, the Python API should expose all the functionality. |
Regarding 1: I'm not sure if such a hack is a good idea, this seems like something that needs to be looked at in AppImageUpdate itself. Regarding 2: I'm not sure where and how? AppImageUpdate is simply 20MB according to https://github.com/AppImage/AppImageUpdate/releases. I'm not sure how it is a bug? It just is rather big. Regarding 3: We discussed this before, we needed appimageupdatetool to copy libraries that the Python bindings need to function. I'll open an issue about the naming. |
Re. 1: I did actually mean to fix it there, @TheLastProject. Re. 2: AppImageUpdate is the UI application, and it ships with a Qt stack. python-appimageupdate should in our case be linked to the Qt shipped by PyQt, though. Therefore, it shouldn't increase Pext's AppImage file size that much. Please open an issue in python-appimageupdate's repository. I won't get to debugging this very soon, this way I won't forget it. Re. 3: I see. Well, you could work around this by using the GitHub API, and using some Python JSON magic. |
I was trying to build the AppImage for testing, but appimagetool continuously crashes (wants to allocate a crazy amount of memory). Can you upload one for me to have a look please? |
The AppImage created by the Travis build of this branch is still online: https://transfer.sh/gCBAw/Pext-x86_64.AppImage. |
Thanks. It seems like, apart from the Python packages, boost is what bloats the package most. I don't use boost any more in favor of cffi. You should remove it, and check the AppImage's size again. |
I got stuck in a update loop, so I figured I should call the path_to_new_file function. However, that seems to cause a segfault: https://transfer.sh/U8hkG/Pext-x86_64.AppImage (commit: ef18d03)
|
Going to have a look. By the way, I just tried the "Check for updates" button, and got a:
|
I have no clue what's up with the SSL error, it works for me on both Fedora and Ubuntu. |
I'm on Ubuntu xenial. But I extracted the AppImage, and ran the python binary in it directly with gdb. Might that cause this issue? |
Maybe, the Ubuntu I tried on is also Xenial. |
Well, it's quite obvious why this doesn't work. The AppRun script contains SSL related fixes that aren't applied when bypassing the script. I'll perform them in my shell by hand. |
How can I call the updater from the UI? Is there a parameter I can use to force a manual update? |
This is what happens if Pext isn't running inside the appimage. Just setting the variable APPIMAGE should work (but please make sure to set it correctly: https://github.com/Pext/Pext/compare/feature/appimageupdate#diff-f92d0e21ecdc5919116ff63380b7dbceR1357) |
Seems to work. Could it be that you are starting a thread for every progress update? This slows down the process quite much when running in gdb. |
Seems like debugging the Python process with GDB isn't quite possible. Maybe we can try to add a unit test to python-appimageupdate? |
I am indeed using a thread for each progress update check, I'll try to remember to simplify that in the future, I forgot I can safely sleep in a second thread: https://github.com/Pext/Pext/compare/feature/appimageupdate#diff-f92d0e21ecdc5919116ff63380b7dbceR2630 |
Unit testing python-appimageupdate sounds good too. Whatever gets this fixed :) |
The idea is to add a unit test that triggers this bug. It's already unit tested. In fact, its unit tests have been used to discover bugs in AppImageUpdate (which lacks unit tests at the moment). |
In that case, my best bet is that it relates to running an AppImage named like Pext-x86_64(1).AppImage while Pext-x86_64.AppImage exists and then updating. I haven't been able to test more to really see if that's related (it's just where I first saw the bug), but it seems a good place to start. |
How sure are you that the segfault occurs when calling |
Not completely, but ef18d03 is definitely the commit where it starts breaking. I'm not sure how else I'm supposed to possibly switch to the new AppImage after updating? |
The workflow seems alright, that's why I'm asking. |
I can't reproduce the bug in my unit tests. I'll build an AppImage in a VM now, and will see whether it'll work. |
Bump, just to make sure you're still aware of this issue (no rush!) :) |
I am, @TheLastProject, but unfortunately I am busy with AppImageLauncher and linuxdeploy at the moment. I will increase the prio of this on my TODO list, though. |
Been working a bit on python-appimageupdate recently. See also TheAssassin/python-appimageupdate#2 (comment). Regarding:
AppImageUpdate would rename such an existing file to I'm going to look into this again now. |
Cannot build an AppImage at the moment due to:
@TheLastProject did you ever encounter this issue? At first I thought this was an issue in appimagetool, but apparently appstreamcli is crashing. |
Well, I do all my builds on Travis for AppImage, and those work just fine for me. |
I seem to be unable to get this to work at all with linuxdeploy: https://travis-ci.org/Pext/Pext/jobs/451022936
|
As AppImageUpdate isn't something that's installed commonly, Pext will have to check for updates in the AppImage itself. Probably calling appimageupdatecli from subprocess.
This probably involves modifying _menu_check_updates and _menu_check_updates_actually_check and reverting 1b4b963 and 4120ec7.
I am labelling this a bug because the non-AppImage version does currently check for updates, so it is a regression.
The text was updated successfully, but these errors were encountered: