Sofirem

Some brief history

I have been contributing my time to an Open Source project called ArcoLinux.

ArcoLinux provides a customized Linux distribution built on top of Arch Linux.

You can find more information over on the Arch Linux Wiki

The journey started by answering technical support questions over on the Forum. These issues ranged from users experiencing unique hardware related problems to software problems. Not all were specific to Arch Linux, but I was happy to use my skills to help out. I recall a user failing to launch a Python application under a Wayland session. This led me to explore the source-code of the Python application, and identifying then implementing a fix. An existing shell script wrapper script, which called this Python application was updated to resolve the startup issue. This script can be found at https://github.com/arcolinux/archlinux-tweak-tool/blob/master/usr/bin/archlinux-tweak-tool

The lead developer of ArcoLinux then contacted me over Discord and if I was willing to join the team, and help develop a Python application. I agreed…

Overview

Arch Linux can be configured to connect to different software repositories, where one can install 1000s of different applications.

In Arch Linux applications are also called “packages”. Packages are identified as official / un-official.

Official packages are ones which are officially provided by the ArchLinux distribution. An example is Firefox.

On the other hand un-official packages which can be obtained from the Arch Linux User Repository (AUR) are community provided packages.

The following links are provided for reference:

There are multiple CLI tools in Arch Linux which can be used to manage the install/removal of these packages. I have named a few of the main ones here.

  • yay (written in Go)
  • paru (written in Rust)
  • pacman (the official Arch Linux tool written in C)

Sofirem: GTK application

A team-member over at ArcoLinux had already made good progress on developing an initial GUI application. The GTK library had been chosen for developing the UI alongside Python. The application was called “Sofirem” - Software Installer Remover.

  • User selects a package to install or uninstall
  • Sofirem spawns a Pacman process to install/uninstall a package
  • Pacman connects to a repository (defined inside /etc/pacman.conf)
  • Pacman carries out the necessary package downloads, checks for package conflicts and starts the install/uninstall process

Early challenges

Crashes

The application would crash randomly when loading, and generate a segmentation core dump. It was difficult to identify where it was failing, firstly due to looking at someone elses code, and secondly the random nature of the crashes.

After exploring the code, adding several print statements and adding faulthandler support. A bug was identified during the GUI setup part of the code. This code would detect the number of cores available on the system, and use a for loop to utilize a multi-threaded approach to speed up the application start up. As this was causing the crash rather randomly, it was removed from the code. Stability is better than performance. Start up times were not impacted.

Adding support for installing/uninstalling a package / multi-threading

Whenever, a package was selected to be installed/uninstalled the entire application would freeze. The GUI was running on the main thread, and so were the package install/uninstall processes. This was later changed and split up into different threads.

Code development

A fork of sofirem-dev was made.

2 branches were used.

  • main
  • development

Any code was first tested and merged into the development branch. Later a pull request was used to merge up into the main branch. From there a subsequent pull request was used to merge code into the ArcoLinux dev repository (https://github.com/arcolinux/sofirem-dev) From there, the application was tested by the ArcoLinux team. Eventually the application was merged up into the main repository (https://github.com/arcolinux/sofirem) where it was ready to be packaged up and then deployed onto a users system.

Features added

  • Search for a package to install/uninstall
  • Show installed packages
  • Show progress dialog window when installing/uninstalling a package
  • Show ArcoLinux ISOs
  • Show Package metadata information for a specific package
  • Display/monitor Pacman Log file

Main view

Each package has a corresponding switch widget, which can be toggled on (install) or toggled off (uninstall)

Progress dialog window

Whenever, the switch widget is toggled on/off a progress dialog is displayed. However, this dialog window can be turned off under the hamburger menu.

Last updated on 4 Jul 2023
Published on 4 Jul 2023