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

Include version number in AppImage #4645

Closed
TheAssassin opened this issue Apr 22, 2020 · 12 comments
Closed

Include version number in AppImage #4645

TheAssassin opened this issue Apr 22, 2020 · 12 comments
Assignees
Milestone

Comments

@TheAssassin
Copy link
Contributor

Please embed version numbers in your AppImages. Right now, every time I upgrade, a number is appended to avoid having 2+ exactly same looking entries in my app launcher:

keepassxc

Cura for instance embeds version numbers, which makes it easy to maintain multiple versions:

screenshot_2020-04-22_19-19-32

Before generating an AppImage, just export VERSION=.... That will then be picked up by appimagetool, which both embeds it in the desktop file (which is picked up by AppImageLauncher etc.) and the filename, too.
linuxdeploy-plugin-appimage internally uses appimagetool, too, so it should "just work" in your release-tool.

@phoerious
Copy link
Member

I am pretty sure we are doing that already, but I'll check. 😕

@TheAssassin
Copy link
Contributor Author

> cat /tmp/.mount_KeePasm3kVWk/org.keepassxc.KeePassXC.desktop 
[Desktop Entry]
Name=KeePassXC
GenericName=Password Manager
GenericName[da]=Adgangskodehåndtering
GenericName[de]=Passwortverwaltung
GenericName[es]=Gestor de contraseñas
GenericName[fr]=Gestionnaire de mot de passe
GenericName[ru]=менеджер паролей
Comment=Community-driven port of the Windows application “KeePass Password Safe”
Comment[da]=Fællesskabsdrevet port af Windows-programmet “KeePass Password Safe”
Exec=keepassxc %f
TryExec=keepassxc
Icon=keepassxc
StartupWMClass=keepassxc
StartupNotify=true
Terminal=false
Type=Application
Version=1.0
Categories=Utility;Security;Qt;
MimeType=application/x-keepass2;

I don't spot X-AppImage-Version in there...

@phoerious
Copy link
Member

phoerious commented Jun 10, 2020

I checked how I can solve this issue and it turns out we are indeed already exporting VERSION before building the AppImage, but AppImageTool isn't picking it up for reasons that are beyond me. Here's the relevant code: https://github.com/keepassxreboot/keepassxc/blob/develop/release-tool#L743

@TheAssassin
Copy link
Contributor Author

Maybe because it isn't set correctly? But looking in the code, there should be some value... Mind to share the log output of appimagetool?

appimage_name="KeePassXC-${RELEASE_NAME}-x86_64.AppImage"

That bit is unnecessary, if you set $VERSION, appimagetool automatically generates that name.

@phoerious
Copy link
Member

phoerious commented Jun 10, 2020

There is a value, I checked (otherwise the file name would come out wrong as well). I know that appimagetool used to embed the version into the path, but at some point it also started embedding the Glibc version, so we decided to generate the file name ourselves. I believe that's why the lack of version information has gone unnoticed.

I tried setting VERSION at various points in the pipeline, but it doesn't make a difference. The only fix I could come up with is adding X-AppImage-Version to the desktop file myself (see referenced commit).

I cannot find anything interesting in appimagetool's output except

Deploying file /xxx/keepassxc/release/KeePassXC-AppRun to /xxx/keepassxc/release/KeePassXC.AppDir/AppRun 
Copying file /xxx/keepassxc/release/KeePassXC-AppRun to /xxx/keepassxc/release/KeePassXC.AppDir/AppRun 
Deploying files to AppDir root using desktop file: /xxx/keepassxc/release/KeePassXC.AppDir/usr/share/applications/org.keepassxc.KeePassXC.desktop 
Deploying desktop file to AppDir root: /xxx/keepassxc/release/KeePassXC.AppDir/usr/share/applications/org.keepassxc.KeePassXC.desktop

and later

/xxx/keepassxc/release/KeePassXC.AppDir should be packaged as /xxx/keepassxc/release/KeePassXC-2.6.0-beta1-x86_64.AppImage

@TheAssassin
Copy link
Contributor Author

Please paste a full log, those excerpts are exactly the stuff I was not looking for. Then I'll happily have a look. (The first part is also linuxdeploy, not appimagetool.)

@phoerious
Copy link
Member

phoerious commented Jun 10, 2020

Yeah, I know. The AppImageTool invocation is marked with a log message. But there isn't much else following it except the mksquashfs output. There is one more (non-error) message about the desktop file, so it is doing something, but that's it.

appimagetool, continuous build (commit df8b13c), build 2121 built on 2020-05-08 09:52:11 UTC
Using architecture x86_64
/xxx/keepassxc/release/KeePassXC.AppDir should be packaged as /xxx/keepassxc/release/KeePassXC-2.6.0-beta1-x86_64.AppImage
Deleting pre-existing .DirIcon
Creating .DirIcon symlink based on information from desktop file
Generating squashfs...
Parallel mksquashfs: Using 24 processors
Creating 4.0 filesystem on /xxx/keepassxc/release/KeePassXC-2.6.0-beta1-x86_64.AppImage, block size 131072.
[======================================================================================================================\] 1140/1140 100%

Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072
        compressed data, compressed metadata, compressed fragments,
        compressed xattrs, compressed ids
        duplicates are removed
Filesystem size 44433.06 Kbytes (43.39 Mbytes)
        37.67% of uncompressed filesystem size (117952.47 Kbytes)
Inode table size 7007 bytes (6.84 Kbytes)
        40.21% of uncompressed inode table size (17428 bytes)
Directory table size 4129 bytes (4.03 Kbytes)
        41.24% of uncompressed directory table size (10013 bytes)
Number of duplicate files found 44
Number of inodes 423
Number of files 311
Number of fragments 49
Number of symbolic links  3
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 109
Number of ids (unique uids + gids) 1
Number of uids 1
        root (0)
Number of gids 1
        root (0)
Embedding ELF...
Marking the AppImage as executable...
Embedding MD5 digest
zsyncmake is available and updateinformation is provided, hence generating zsync file
Success

Please consider submitting your AppImage to AppImageHub, the crowd-sourced
central directory of available AppImages, by opening a pull request
at https://github.com/AppImage/appimage.github.io

@TheAssassin
Copy link
Contributor Author

Found it. See https://github.com/AppImage/AppImageKit/blob/master/src/appimagetool.c#L716-L738. appimagetool only includes a version number in the desktop file if you don't specify a custom output filename.

This is clearly a bug. Mind to open an issue?

@TheAssassin
Copy link
Contributor Author

Issue opened: AppImage/AppImageKit#1054

@phoerious
Copy link
Member

Cool, thanks!

@TheAssassin
Copy link
Contributor Author

TheAssassin commented Jun 11, 2020

Fixed. New build is triggered, should be available in a few minutes.

@phoerious
Copy link
Member

Okay. We have merged the other fix where I just set the property manually and removed the VERSION envvar. It's probably not worth adding another patch just now that reverts it, but I'll keep it in mind for later.

lerignoux pushed a commit to lerignoux/keepassxc that referenced this issue Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants