Skip to main content

the avatar of Klaas Freitag

Learnings from Building an AppImage

For some time I am offering an AppImage of Kraft to make installations for users as easy as possible. Unfortunately real linux packages are big effort for the variety of distributions, and having one way to rule them all seems very appealing.

My first AppImage versions were pretty faulty when looking into details. So I spent some time to improve it recently, with the great help of the friendly people from AppImage community.

Here is my little report about what I have learned. If there is something I can do better, please let me know (unless it is use $OTHERTOOL).

How to build an AppImage?

At first, it makes sense to build the AppImage automatically via Github Actions. GH Actions are powerful, and well integrated. I also looked into using the openSUSE Buildserver for that, which works, but Github Actions seemed easier.

I got convinced by @TheAssasin to use AppImageCraft to build the image. That simplifies the process significantly by hiding a lot of auto generating things under the hood. While that leads to very clean and short config files for the AppImage build, it is harder to deal with issues that might come up because things are covered.

If I would not have had help from the dev that I know personally, I probably would not have survived the process. Yet, AppImageCraft is an awesome utility, yet a bit better documentation would help a lot.

Python Components

Kraft has a few Python components that are called from Kraft to do specialized tasks that I did not want to reimplement in C++. For example, it uses the awesome tool weasyprint to generate PDF from html.

While the AppImage can call a weasyprint installation that is installed on the host system that is not a good solution as there is no way to control if the required tool is really installed. So bundled Python is needed with all the dependencies for the external deps.

To achieve that, there is a very useful linuxdeploy-plugin called conda that uses conda to install Python. It installs the required python libs via pip and make them available in the bundle. Very convenient.

Pathes

To be a good citizen in the AppImage world, the app needs to be careful with pathes. When running in the AppImage, it is advisable to not use for example classes like QStandardPath directly or even worse hardcode paths that do any loading of files the app needs. Since the file tree of the AppImage is just mounted somewhere in the host system, the app needs to consider that it is not installed in standard locations.

A good rule of thumb when locating a file to load is to always check relative to the binary path first (ie. ../share/kraft/data/), and if that does not exist, continue to check the standard paths of the host system.

In Kraft there were already utility methods to adjust paths which I could simply extend to work fine in the AppImage. Still, that is kind of fiddly as there are more places to consider than one expects.

Locate translation files

Also a result of the challenge described before is that the app did not find the translation files to load in the filesystem of the AppImage. The translation system (KLocalizedString in Kraft) does obviously not check the correct path inside the AppImage mount.

Setting an additional relative path to look up translations at runtime fixes that problem.

Icons

Another issue that required quite some work were icons. Kraft used icons from the system theme quite a lot. As long these are installed, because the user has the same fitting desktop environment, that is not an issue, and icons are found.

However, if the icon theme is not installed, the app just lacks icons which make it bad looking or even hard to use.

That can be solved by using own icons as fallback in the app. For simplicity and consistency I switched to a complete set of own icons that are now coming with Kraft. They are bundled to the app with the Qt resource system now.

Dependencies to the Outside

Last but not least: When preparing an app for AppImage it needs to be checked if the app has binary dependencies that can (or should) not be packaged into the AppImage for efficiency reasons. Kraft for example uses Akonadi for contacts. With that users can use KAddressbook to manage addresses and Kraft uses the address lists via Akonadi. Life is too short for reinvention of an Addressbook.

Of course one could think of bundling the entire Akonadi and KAddressbook into the AppImage of Kraft. But that seems overkill, as that would mean bundling a lot of stuff, and would bring KDE users two instances of KAddressbook (the one from their desktop installation and the one from the AppImage). Seems not a good idea.

So this seems to be the only downside of the new Kraft AppImage now: It can not use the Akonadi based address management. To fix that, there needs to be a non binary dependant way. There could for example be a way to sync contacts to a local file system and let Kraft pick them up from there. That way, users could use the address management they want (also for example google) and Kraft could still pick addresses from there. That needs more thoughts.

The good news on this that Kraft is still fully functional as the Akonadi integration is great, but optional.

Summary

An AppImage seems to be a great way of distributing desktop applications, because there is only one build to run on all distributions. Well, fingers crossed…

However, building an AppImage that really works flawlessly is not a simple task, as this blog hopefully illustrates a bit.

One thing would have helped me: A simple option to understand when the app loads things from the host system, rather than from within the AppImage, for example as commnd line switch when running the AppImage. That would have eased the path adjustment development described above.

What is next in that area: User friendly updating of the AppImage and a solution to the address management problem.

All changes were merged in Kraft master today, the resulting AppImages can be found here.

a silhouette of a person's head and shoulders, used as a default avatar

Pixel Inktober

Just like last year, October was filled with quick pixel dailies. I decided to only post on mastodon, but due to the twitter exodus couldn't quite post the 30kB images for the two remaining days. Good old blog post it is!

x 1. Gargoyle 2. Scurry 3. Bat 4. Scallop 5. Flame 6. Bouquet 7. Trip 8. Match 9. Nest 10. Crabby 11. Eagle 12. Forget 13. Kind 14. Empty 15. Armadillo 16. Fowl 17. Salty 18. Scrape 19. Ponytail 20. Bluff 21. Bad Dog 22. Heist 23. Booger 24. Fairy 25. Tempting 26. Ego 27. Snack 28. Camping 29. Uh-oh 30. Gear 31. Farm

a silhouette of a person's head and shoulders, used as a default avatar

Pixel Inktober

Just like last year, October was filled with quick pixel dailies. I decided to only post on mastodon, but due to the twitter exodus couldn’t quite post the 30kB images for the two remaining days. Good old blog post it is!

x 1. Gargoyle 2. Scurry 3. Bat 4. Scallop 5. Flame 6. Bouquet 7. Trip 8. Match 9. Nest 10. Crabby 11. Eagle 12. Forget 13. Kind 14. Empty 15. Armadillo 16. Fowl 17. Salty 18. Scrape 19. Ponytail 20. Bluff 21. Bad Dog 22. Heist 23. Booger 24. Fairy 25. Tempting 26. Ego 27. Snack 28. Camping 29. Uh-oh 30. Gear 31. Farm

Previously, Previously, Previously.

a silhouette of a person's head and shoulders, used as a default avatar

V2BlankBrowser get new feature!!

V2BlankBrowser is Linux Web Browser, created to playing games or use with web apps in mind. But it is still normal browser, with tabs, etc. To made UI flexible to fulfill both playing games, use web apps and web browsing, I use many techniques. Last is tab displaying/hiding by a gesture! See the link.

a silhouette of a person's head and shoulders, used as a default avatar

openSUSE Tumbleweed – Review of the week 2022/43

Dear Tumbleweed users and hackers,

Tumbleweed snapshots are being released stably and reliably. Whenever a snapshot comes out, you know it has gone through extensive testing using openQA. Of course, this is no guarantee that all snapshots are error-free. openQA works on virtual machines based on scripts, so it tests what it is instructed to try (not seldom do we see issues that were not intentionally tested for, but they are ‘happy accidents’). This week, a less fortunate update reached our users that caused some pain for some: The Linux Kernel 6.0.3 managed to break audio for a couple of users (See https://bugzilla.opensuse.org/show_bug.cgi?id=1204679). Kernel 6.0.5 is in the queue and should be published in the next 48 hours and fix those issues.

Of course, not all was broken, and the last 7 days have seen 7 snapshots being published (1021…1027) including these changes:

  • Linux kernel 6.0.3 (Snapshot 1023)
  • GStreamer 1.20.4
  • Switch to NodeJS 19 by default
  • XWayland 22.1.4
  • Mesa 22.2.2
  • Mozilla Firefox 106.0 & 106.0.1
  • Samba 4.17.1 & 4.17.2
  • Systemd 251.6 & 251.7
  • fwupd 1.8.6 (updated from 1.7.10)
  • dbus 1.14.4
  • LibreOffice 7.4.2.3

Stagings look a bit sad and empty at the moment, but that is mostly due to them passing so quickly. most stagings have a short lifetime these days and are ready to be accepted within 24 hours. Still, there are a few things currently being tested:

  • Linux kernel 6.0.5 (expected latest in snapshot 1029, possibly even in 1028)
  • KDE Plasma 5.26.2
  • Mozilla Thunderbird 102.4.1
  • Mozilla Firefox 106.0.2
  • gpgme 1.18
  • Python 3.10.8 & 3.9.15
  • Python Sphinx 5.3.0
  • Staging:L, the ‘show-me-errors-staging’, currently contains: swig 4.1.0 (breaks llvm and nodejs), git 2.38.1 (breaks python-GitPython), ICU 72.1 (breaks the world, as usual), suse-module-tools 16.0.24 (breaks VirtualBox and vmdk)
the avatar of openSUSE News

GStreamer, GNOME, systemd update in Tumbleweed

The new streak of openSUSE Tumbleweed snapshots continued this week as the continuous streak stands at 15.

The consistency brought rolling release users updates this week for fetchmail, GNOME, GStreamer, rsync, systemd and more.

The 20221026 snapshot updates a few packages. Text editor vim 9.0.0814 fixed the Kitty terminal and Clang format configuration files that were not recognized. The package also fixed a memory leak with an empty shell command and OpenVPN files are not recognized either. The Linux driver package pcsc-towitoko 2.0.8, which is for smartcard readers, corrected a time out value that was set too low for certain cards like that of the Spanish national identity card. The portable foreign-function interface package libffi 3.4.4 had important AArch64 fixes that included support for Linux builds with Link Time Optimization. The wrapper library libp11 0.4.12 fixed several memory leaks and some storing certificates on tokens.

An update of gstreamer 1.20.4 arrived in snapshot 20221025, and it fixed a crash when updating an unchanged ping source, updated translations and now always clears MIME type tables when updating a clients clipboard. Several gstreamer plugins were also updated to version 1.20.4. An update of xwayland 22.1.4 bumped wayland build requirements and fixed some overzealous caching. An update of gnome-maps 43.1 fixed various issues related to the GTK4 port and fixed a couple drag-and-drop issues. File compressing package zchunk 1.2.3 added availability of a license scan report and status. Several other packages were updated in the snapshot including yast2-trans, which updated Czech, Dutch, Slovak, Japanese and Catalan languages.

Just two packages were updated in snapshot 20221024. An update of autoyast2 4.5.6 fixed profile location parsing and the add repo URL scheme. The module also added packages for the selected network backend in order to prevent it from being declared in the software section. The other packages to update was a reversion of selinux-policy from 20221019 to 20220714.

An update of gnome-software 43.1 arrived in snapshot 20221023. The minor release from the GNOME community fixed searches not completing when installing and uninstalling an app at the same time. The desktop package fixes distribution upgrades when package conflicts are present, and it fixes a crash when showing offline update errors during the startup. Browser Mozilla Firefox updated to version 106.0.1 and it addresses a crash experienced by users with AMD Zen 1 CPUs. An updated version of GNU Compiler Collection 12 added a patch related to RISC-V, and it updated embedded library newlib to version 4.2.0. The Linux kernel-source 6.0.3 updates had some changes related to the handling effects of the non-volatile memory after freeing a request. Domain name query package whois 5.5.14 added the hiding string for whois.auda.org.au. The super-thin layer package on the DBus interface fwupd 1.8.6 fixed a regression when getting the I²C bus number. The rendering extension library libXrender also fixed a regression in the version 0.9.11 update.

Mesa 22.2.2 was updated in snapshot 20221022. The 3D graphics library added a patch to fix LLVM optimization to avoid failures on ARMv7. The 251.6 systemd update avoids the expanding macros in comments that leads to an error on installations. The package also makes sure that the same seed is not replicated on systems when installing from a golden image. A major version update to cpupower 6.0.2 removed powercap capabilities to patch against the latest kernel-sources. The rsync package fixes client-side validation of the remote sender’s filtering behavior in version 3.2.7 and the --fuzzy option was optimized to cut down on the amount of computations when considering a big pool of files, which resulted in about a 2x speedup. Six Common Vulnerabilities and Exposures were fixed in the Firefox 106.0 update major version like CVE-2022-42929, which could cause a denial of service of the browser if a website called window.print() in a particular way. Harfbuzz 5.3.1 and several other packages were updated in the snapshot.

Just one package changed with the 20221021 snapshot; it was related to fetchmail and it removed a subpackage that required python-rpm-macros.

An update of fetchmail also arrived in snapshot 20221020. Fetchmail 6.4.34 updated Serbian translations and fixed a bug that would delete a message from the mail store despite a soft bounce option being enabled when an SMTP receiver refuses a delivery. An update of NetworkManager 1.40.2 fixed a couple race condition behaviors and it now declines the DHCPv6 lease if all addresses fail IPv6 duplicate address detection. Bug fixes arrived with Plasma 5.26.1 updates. The software center Discover improved Flatpak test reliability, but also disabled the test on the Continuous Integration. Plasma Audio Volume Control should not crash now when the server doesn’t respond, and Plasma Desktop makes the drag and drop of the pager widget more reliable. The update of gnome-control-center 43.1 fixes crashing when editing networks. Fixes for a crash when a device had detached while the controller is resetting the port were made with the virtualbox 6.1.40 update, and python-setuptools 65.5.0 improved information in its documentation about conflicting entries in a current working directory and editable install. The package also fixed backward compatibility of editable installs and custom build_ext commands inheriting directly from distutils. Several other packages were updated in this first snapshot of the week.

a silhouette of a person's head and shoulders, used as a default avatar

Lake Naplás: giving time-lapse photography another try

Once upon a time I made some time-lapse videos, but I gave up quickly. Recently I have watched yet another Attenborough nature series: The Green Planet. It was full of beautiful time-lapse recordings, and suddenly I felt the urge again to give this genre another try :-)

I visited my favorite recreational area in the Pest side of Budapest: Lake Naplás. It’s an artificial lake close to the border of Budapest, which quickly turned into an important bird nesting place and a protected nature area. The clouds just arrived with an extreme speed. I put down my camera, set the interval timer to 5 seconds, and started taking photos.

Making the time-lapse

This time I was storing photos in JPEG format (instead of RAW), and I did no post-processing. I turned the photos into a movie using OpenShot on Linux. Before I could import the photo sequence into OpenShot, I had to rename the files to have the numbering started at 001. Here is the result:

Next time I should try to do some post-processing and be more careful with setting the distance on the lens. However, as a first attempt after three years, I’m already quite happy with this video :-)

a silhouette of a person's head and shoulders, used as a default avatar

Running sudo without updating cached credentials

One of the recurring questions at conferences was whether there is a way to check cached sudo credentials without updating them. Version 1.9.12 of sudo introduces the -N option which makes this possible, and also allows running any commands without updating the cached credentials.

You can learn more about the new -N option in my latest sudo blog at https://www.sudo.ws/posts/2022/10/running-sudo-without-updating-cached-credentials/

Sudo logo

the avatar of openSUSE News

Call for Testing Next Generation Installer

Members of the openSUSE Project’s release team are asking community to help the YaST team with early testing of the installer images.

The installer is progressing its way to openSUSE Factory and will arrive in an Adaptable Linux Platform prototype at a later date.

The installer, which is reffered to as the D-Installer by the YaST team, has installer images for testing and is seeking input/feedback through a feedback guide.

There are several sets of instructions in the guide that is meant to elicit feedback on the next generation installer.

The team is also looking to rename the D-Installer to another name and an openSUSE Tweet asks people to suggest a new name. The D-Installer visually checks the installation settings at a glance and is one of the key areas that the release team would like the community to focus on during the next weeks.

An installer workshop is scheduled during a community meeting on Nov. 8. People can use this feedback guide to test items for the next installer and provide feedback in the document or during the workshop.

The github page for the installer has a few listed issues and people can also contribute and provide feedback there.

The current ALP prototype only has x86-64.

the avatar of Open Build Service

Request Page Redesign - Build results and superseded conversations

We don’t stop improving the requests workflow and we are actively working on the feedback. This time we worked on including conversations from superseded requests and presenting build results. The request redesign is part of the beta program. We started the redesign of the request workflow in August 2022. Then, in September 2022, we focused on the support of multi-action submit requests. We continued in October 2022 with improvements regarding the Build Results tab and...