Gentoo musl Support Expansion for Qt/KDE Week 10

This week I’ve finished testing the KDE applications, cleaned up the Mauikit ebuild commits, and various fixes on Portage and Crossdev. I have also started writing a little bit on the PinePhone Pro wiki, and also gotten Gentoo musl installed on riscv64 (VisionFive).

I’ll start with mentioning the KDE app tests. I made a simple application called gdepend that takes any number of package atoms as its command line arguments, and prints out a space separated list of all their dependencies combined. This was useful because kde-apps-meta is a “meta-meta” package, meaning it depends on other meta packages, so this allowed me to do “FEATURES=test emerge $(gdepend $(gdepend kde-apps-meta))” to test every KDE application. It is basically equery depend, but prints the output in an emerge-friendly way.

As for the packages I’ve had issues with the following this week: FreeRDP, Poxml (gettext), Postgresql, Exiv2, and Okular. Exiv2 is fixed in both the Gentoo tree and upstream. Poxml is still not fixed and there’s been a bug on gnu.org for over a month now, I’ll take another look at it next week. Postgresql only affects an ancient slot, :10, so we can skip this. Okular only fails because it needs to be installed before testing. I spent quite a lot of time looking at it, but after talking to upstream it’s apparently the intended behaviour https://invent.kde.org/graphics/okular/-/issues/75#note_508616. I worked around this using a has_version check in the ebuild. Because there were some older disabled tests in the ebuild I made an array with disabled tests and at the end formatted it onto the -E “(test1|test2|test3)” form using shell scripting. I think we’ll add this into cmake.eclass so that you don’t need to manually do this all the time you want to append tests.

I fixed the git history for the Mauikit applications so that each commit is one added package. Instead of simply checking out a fresh ::kde and copying the packages over one by one I used git rebase. Commits that spanned over multiple packages, like the LICENSE fix, I broke up using “git reset, git commit, git commit, …”. After that I squashed related commits togheter with git rebase –interactive. I didn’t know you could just reorder commits using the text editor with –interactive, and that was very useful. I learnt a lot regarding efficiently rewriting git history here. I also got a libmpv patch upstreamed here because they used an outdated API.

I also used crossdev and ran into issues where the configure-stage would fail. An example of this in Vim was “configure: error: cross-compiling: please set ‘vim_cv_toupper_broken'”. This is because src_configure usually runs tests on the system to figure out details about it, like sizes, if functions exists, etc. This is not possible when cross compiling because you cannot run the compiled tests. Therefore you need to provide details about the system manually. In Vim’s case I just added some environment variables before configuring (https://github.com/gentoo/gentoo/pull/26900/commits/3bbb488c57f6a1d87d545e830c7b599bd928cf57). I also learned that Gentoo provides predefined tests like this in /usr/share/crossdev/include/site. Another solution, that meson uses, is by using actually running the tests using something like qemu-user. This would be great to have in Portage but it would have to be integrated with the build systems, so not a trivial fix for sure

Another issue I noticed with crossdev was that ${CHOST}-ebuild did not work. This was because emerge-wrapper installs a symlink to it but it does not actually exist! So I created this file, heavily based on cross-emerge, and got it into crossdev. Sam also told me about self-dependencies with  cross compiling. Like the llvm build process using tools from llvm, and how you could go about stuff like this. All in all I feel like there’s still a lot to do regarding cross compiling with crossdev and I’d like to continue working on it after GSoC.

Finally I’ve had some issues reproducing the test environments that is used for testing ebuilds, like setting all the correct env vars and setting up Xvfb. So I’ve started to work on ebuildshell. I’ve gotten it rebased to latest version of Portage but still not working. I’ll work on that next week as well.

To summarize, I’ve gotten all the kde-apps-meta tests to run now except those I mentioned above that won’t be fixed for various reasons. I have also fixed up the Mauikit ebuilds and started with the PinePhone Pro wiki. I’ve also done some cross compilation and learnt a lot regarding it. When starting I didn’t even know what CBUILD and CTARGET meant.

Things left for me to do is fix the gettext bug and rewrite AccountService. I also want to get libexecinfo-unw into Gentoo for backtrace functionality without hacks, ehide integrated Portage for isolated builds and testing, and ebuildshell into Portage for debugging ebuilds. I’ll also work on the PinePhone Pro wiki, and probably create a VisionFive wiki. I will add a lot of documentation to the musl porting guide in the last week.

This entry was posted in musl KDE. Bookmark the permalink.

Leave a Reply

Your email address will not be published.