Gentoo Archives: gentoo-soc

From: cat@××××××××.org
To: Gentoo Soc <gentoo-soc@l.g.o>
Subject: [gentoo-soc] Weekly report #1 from Catcream. musl support expansion related to Qt/KDE desktops
Date: Sun, 19 Jun 2022 18:22:02
Message-Id: N4xBnd2--3-2@catcream.org
1 Hello!
2
3 In the first week of Summer of Code I've spent my time fixing some dependencies of the Plasma desktop, as well as having learnt a lot regarding tooling and workflow.
4
5 What I've accomplished this week is getting the Plasma desktop running, both with X11 and Wayland. For now it's just a bare bones desktop with Konsole (terminal) and Dolphin (file manager) running. To get most of my glibc applications running under musl I've fixed flatpak-builder so that they can be run inside a Flatpak. I do consider Flatpak a workaround and I'll definitely focus on getting applications ported to run natively on musl later during this project.
6
7 This far all of my patches has been patching build-time errors because they are easier to spot and fix, and I've been putting off the run-time bugs for later.
8
9 I started off with patching dev-util/flatpak-builder (https://github.com/gentoo/gentoo/commit/43e759c25a8e2960d3dff78c6696cb257ebaa39). This was done before the project started but I'll still mention it here. The problem with this package was that it used the GNU macro TEMP_FAILURE_RETRY, and error() from error.h. Fixing this was just checking via the preprocessor if they were defined and if not, just define an identical replacement.
10
11 The second package was sys-fs/lvm2. The fix here was similar to flatpak-builder. It had to do with the standard streams being const in musl and I added that to Sam's musl porting guide. This has not been upstreamed yet.
12
13 A more interesting patch was sys-apps/accountsservice. It uses fgetspent_r to enumerate the shadow file to find users. The problem here is not that fgetspent_r isn't defined in musl, it's that enumerating shadow to get a list of users is a wrong thing to do in the first place. To properly fix accountsservice a larger rewrite is needed. After a chat in #musl I got suggestions on how to do that and I'll do it in the following weeks. For now a simple conditional define for fgetspent_r was added.
14
15 I also patched fakeroot-ng (upstream) and freeimage. Freeimage was, similarly to accountsservice, a package where musl found badly written code (relying on NULL implicitly converting to integer 0).
16
17 Konsole also broke for me but there was already a patch supplied in master. I got that backported for 22.04 by asking upstream because 22.04.3 is comming up.
18
19 Things that I spotted from my first week that I'll continue working on are lvm2 (_allocate_memory needs rewrite, removing is fine for now), Baloo (runtime bug), librsvg (weird cargo error, not same as listout:s bug), accountsservice.
20
21 For me librsvg segfaults when built by an unprivileged user and then installed by root. This error is probably related to ld library path according to Sam.
22
23 For the "learning part":
24 * I've learnt to submit patches both with pull requests and mailing lists.
25 * With listout getting stuck on librsvg I also learned how to compile Rust programs with debuginfo and how to use gdbserver, rust-gdb and GEF (sam: indeed, it is comfy).
26 * How to format and what info to include in patches, for example GLEP 66.
27 * Using Emacs magit for working with git, ex. squashing commits.
28
29 I've been working with sam, listout and leio this week. Thanks for all the help, nitpicking, and tips!
30
31 --
32 Sent with Tutanota, enjoy secure & ad-free emails.