Automatic updates on Linux
Reported version
3.x-dev
Type
Functional
Frequency
Few
Severity
S5 - Suggestion
Status
closed
Regression
No
Workaround
No
Project
MuseScore provides an AppImage as the official download format on Linux. The current AppImage is type 1. If this was upgraded to a type 2 AppImage then it could benefit from many of the new AppImage features, including automatic updates (e.g. via AppImageLauncher).
Creating the original AppImage was a herculean effort, but thankfully tools now exist to do the job automaticially. This means all the custom shell scripts in build/Linux+BSD/portable can be removed and replaced with a single command to run linuxdeploy
on MuseScore's compiled binary, making use of linuxdeploy's official plugins for AppImages and Qt.
Fix version
3.6.0
Comments
See also
https://musescore.org/en/node/280926
and updated info in a comment here:
https://musescore.org/en/node/281324
By the way, linuxdeploy also works, when using its qt-plugin, but for some reasons I can't understand it does not include printsupport plugin and I couldn't find a way to stop it inserting (additional) Qt translations and copied library copyright info.
With linuxdeployqt and a successive call to appimagetool to create the AppImage and include the updating info I was able to create an AppImage, which should however still be tested under different environments.
EDIT:
The build finished and here is the resulting AppImage:
https://bintray.com/antoniobl/musescore-custom-nightlies/MuseScore_3_Po…
In reply to See also https://musescore… by ABL
Thanks for pointing out your post. I have replied there to avoid polluting the tracker.
The folks at AppImage have created a handy packaging guide including how to make AppImages updateable (external update tool required) and self-updating (no external tool required).
PR: https://github.com/musescore/MuseScore/pull/4757
The PR implements the minimum changes required to get updates working. The old scripts are still used to bundle the libraries, and then
linuxdeploy
is only used at the last minute to build the AppImage archive. The scripts can be replaced later once updates are in place.Fixed in branch master, commit 684f641b80
_AppImage: Improve build scripts
changes on the Nightly server (see PR #4757)
linuxdeploy detects library dependencies and automatically puts
them in the AppImage. This makes the copy-libs scripts redundant._
Automatic updates would require some server-side changes as well, wouldn't they?
@dmitrio95, that's true for nightly builds but not for stable releases.
Basically, the updater software needs to know where to look for the latest version. GitHub Releases has an API to get the latest version, but OSU OSL is just a dumb webserver so some extra effort is required.
For stable releases, simply upload the zsync files to the GitHub Releases page alongside the main AppImage file. See this example.
For nightlies, you need to provide a stable URL that always points to the latest version. For example:
These links could be 302 temporary redirects to the most recent build on the nightlies page. However, you don't own the OSU OSL server so you probably can't create 302 redirects.
Instead of using redirects, you could simply make a second copy (or symlink) of the latest nightly files at the above locations. This is what PR 4757 attempts to do, but I can't test it because I don't have SSH credentials for the OSU OSL server.
3.3.1 and 3.3.2 have been released but automatic updates didn't work for some reason. Looking in the build log for 3.3.2, it appears that the zsync delta update file was created but not uploaded to OSUOSL.
It might have something to do with this regex in osuosl.sh. Notice how it tries to read the architecture from the filename, and it assumes the filename ends in
.AppImage
. This is not true for the zysync file (it ends.AppImage.zsync
). However, I would have expected to see "Error: unrecognised architecture" but we don't see this for some reason.Maybe its not possible to call the osuosl.sh script twice? If that's the case then PR #4757 should fix it, but it needs somebody with OSUOSL credentials to test it.
It looks like the condition
evaluates to false (or rather to exit code 1) since the asterisk sign seems to be not expanded inside the double brackets condition, and
-f
condition checks for the presence of literallybuild.release/MuseScore*.AppImage.zsync
file which clearly does not exist. If single brackets syntax is used ([ -f build.release/MuseScore*.AppImage.zsync ]
) then this asterisk gets expanded and-f
operand has a correct filename to check for a presence ofzsync
file (but will fail if more than one file has a name corresponding to that pattern).Still fixing the condition will likely result in the "unrecognized architecture" issue so that would probably need fixing too.
@dmitrio95, good catch! Note that PR #4757 removes the brackets condition and uploads both the AppImage and zysync in a single run of osuosl.sh, hence fixing the issue in question.
@dmitrio95, are you able to test this PR or do we need to ask @lasconic for SSH creditials?
https://github.com/musescore/MuseScore/pull/4757
Can we have this finally for 3.5?
Fixed in branch 3.x, commit e452b3ac6a
_Partial fix #279707: First steps towards automatic updates on Linux
Creates a zsync delta update file for AppImages but doesn't yet upload
it to a server._
Still active until files are uploaded to the server
This is working now in the nightlies. It hopefully also works in stable releases, but since 3.6 is the first version with the update metadata, we won't know if it actually works until there is something to update to (i.e. 3.6.1 or higher is released).
Next challenge is to bundle the updater software inside the AppImage itself, firstly to update via command line, and then via the GUI like Sparkle on macOS or WinSparkle on Windows.
Fixed in branch 3.x, commit 851a3fdbfd
_Fix #279707: Command line option to update AppImage
Usage: ./MuseScore*.AppImage update_
Automatically closed -- issue fixed for 2 weeks with no activity.