Quickly post-FOSDEM

Four days of Brussels: eat, sleep and be nerdy. I learned many things at FOSDEM 2019, although not in areas that I expected. Koalas, silicon and testing strategies, yes.

I stayed with friends at a wonderful bed-and-breakfast near the university. A cat was provided for conversational purposes at breakfast — and breakfast was beautiful. A ten minute walk to the venue along a park makes the start of a FOSDEM day a very different experience from, say, a packed and smelly bus 71. Thank you, June, for making our stay a memorable one. Thanks to Rohan and Roman for being good roomies.

The FreeBSD mini-devsummit was a good one. It was kept on-topic by Benedict. Thank you to Deb for organizing in the shadows. It was a particularly valuable meeting for the “desktop stack” part of FreeBSD. We had KDE people there and the X11/mesa stack, and also met GNOME-FreeBSD outside of the devsummit. That means that we got to align everyone on “what needs testing and where should we go from here”. There will be more FreeBSD-desktop activity this year.

FOSS-North will be one such activity; both the KDE community and the FreeBSD community will be there. I’m looking forward to being torn in half so I can attend both community day events there.

Photo of booth with monitor and T-shirts

Ivana running the KDE booth

FOSDEM itself might be described as “same old, same old” but only if you abstract that to “unable to get anywhere because you keep meeting all these incredible people”. Alexios, Amanda, Bernard, Camille, Dan, Dave, Ed, Federico, .. good to see you all again. I had time — or the presence of mind — to take only one picture this weekend. The sun is shining, so this must have been on Sunday. Ivana, thank you for being one of the constants at the booth. David, good to meet you for the first time, and Jonathan, you too thanks for being the backstop to our demonstrations. In the photo you can also see our two taglines: Plasma everywhere (from Pine64 to RISC-V to x86, from mobile to large-screen desktop) and Come home to KDE (your data and your computing should be like your home: customizable, secure, private).

We had a constant stream of people stopping by for stickers and information and T-shirts (next time, also bring some baby sizes). The live demo’s are a favorite — also for me, because then I see applications that I don’t usually use.

Photo of Pine64 booth with laptops

Pine64 Hardware Exposed

Lots of people were asking about Pine64 hardware, so we referred them to the stand over in building AW. Here’s a picture with everything tidy — it must have been Saturday during set-up, before the crowds arrived. I didn’t have much time with the Pine hardware — the phone, the new laptop, and all the other gadgetry. They are showing off a huge number of little gadgets, all very open and inexpensive to boot.

In the background of this photo, the Espruino and MicroPython projects are showing off their devices. Especially the MicroPython is a beautiful little machine in its aluminum case.

Thanks to the Pine64 people for a wonderful after-hours get-together as well. Among others, the PostmarketOS people were there — I’ve never seen so many N900s at one table since 2008.

Unlike previous years, I stayed one night extra to have a relaxed journey home. And now I’ve got a pile of business cards to go through and a long list of technologies to try.

Ring in the new

It’s the second week of 2019 already, which means I’m curious what Nate is going to do with his series This week in usability .. reset the numbering from week 1? That series is a great read, to keep up with all the little things that change in KDE source each week — aside from the release notes.

For the big ticket items of KDE on FreeBSD, you should read this blog instead.

In ports this week (mostly KDE, some unrelated):

  • KDE Plasma has been updated to the latest release, 5.14.5.
  • KDE Applications 18.12.1 were released today, so we’re right on top of them.
  • Marble was fixed for FreeBSD-running-on-Power9.
  • Musescore caught up on 18 months of releases.
  • Phonon updated to 4.10.1, along with its backends.

And in development, Qt WebEngine 5.12 has been prepared in the incongruously-named plasma-5.13 branch in Area51; that does contain all the latest bits described above, as well.

Modern KDE on FreeBSD

New stuff in the official FreeBSD repositories! The X11 team has landed a newer version of libinput, opening up the way for KDE Plasma 5.14 in ports. That’s a pretty big update and it may frighten people with a new wallpaper.

What this means is that the graphical stack is once again on-par with what Plasma upstream expects, and we can get back to chasing releases as soon as they happen, rather than gnashing our teeth at missing dependencies. The KDE-FreeBSD CI servers are in the process of being upgraded to 12-STABLE, and we’re integrating with the new experimental CI systems as well. This means we are chasing sensibly-modern systems (13-CURRENT is out of scope).

Looking ahead for the first quarter of 2019:

  • Qt4 is scheduled for removal┬ámid-March. That affects a lot more ports than KDE4 does, For instance leechcraft — that looks like a desktop environment to me, which I’d never heard of before. There doesn’t seem to be a release of it based on Qt5 yet, though.
  • QtWebEngine update from 5.9.5 to 5.12. WebEngine is terrible for distro packagers, especially outside of Google’s target audience. This has been lagging, but we’re now in a position to work on an update — and we’ve welcomed a new contributor who wants to make that happen.
  • Wayland! Really, it’s time to also have a KDE Plasma Wayland session on FreeBSD. I had some stuff working experimentally a year ago, but nothing that could work in the official ports tree. That’s now feasible (and then I can sit down to debug KMail Wayland issues as well).
  • Kookbook and Kolorfill. Aww, so cute.

KDE4 on FreeBSD, post-mortem

The KDE4 ports in the official FreeBSD ports tree have been removed. I was there at the release party, in Mountain View, in 2008. And I’m here at the end of 2018 to cast some earth upon it.

The KDE-FreeBSD team has spent the past month or more, along with FreeBSD ports committers and maintainers who have other KDE4-related ports, in bringing things up-to-date with recent KDE-Frameworks-based releases, with hunting down alternatives, and with making the tough call that some things are just going away. Thanks to Rene for doing the portmgr commits to clean it up (r488762, r488763, r488764 and followups to remove KDE4-options from other ports) .

The modern KDE Plasma desktop, KDE Applications, and the rest of the stack continue to be actively supported. As of this writing, there’s 20 ports bugs open for kde@, so I think we’re doing OK.

FreeBSD security settings and KDE Konsole

Konsole has this neat feature where you can automatically title each tab in the terminal-emulator window with information from the foreground process running in that tab. Useful if you have lots of shells opened to different directories in the system.
Screenshot of konsole tab bar
It’s configurable, of course, by editing the tab’s profile (Settings -> Edit Current Profile -> Tabs). There’s a printf-ish configuration widget. I usually cut it down to just %d, the working directory.

When I switched over to FreeBSD 12.0, I enabled some extra security features from the installer, and noticed that konsole was being less informative than usual:Screen shot of konsole tab bar without directories

The reason is simple: konsole uses the debugging interface (e.g. ptrace) to query its child processes, and I have turned off debugging support for unprivileged processes. A quick sysctl security.bsd.unprivileged_proc_debug=1 restores the show-current-directory functionality in konsole, although that does, of course, switch off that security feature. Set it in /etc/sysctl.conf to make it permanent.

Patching Qt5Network for Christmas

Qt5 and KDE Plasma 5 have been running smoothly on my workstation desktop for a year or more. I have a kind of boring desktop: there is one CPU, one graphics card, two network interfaces, and I use the default settings for just about everything. .. and everything (that I need) just works.

But it didn’t work for everyone: there was this one weird bug report that when the system had VLANs defined, that most Qt5-based applications would crash or refuse to start up. That first manifested itself there as a build failure of kf5-syntaxhighlighting. After some discussion with Volker, I ended up with a workaround: don’t validate the schema’s during the build. That takes away the networking dependency, and things were OK again.

Other similar bug reports trickled in. They’re now all closed as duplicates of this original. Some patches trickled in, which I didn’t particularly like because they were of the “comment this bit out and things work”. Thankfully the original reporter of the kf5-syntaxhighlighting build failure, Ting-Wei Lan, did a great deal of debugging work. Enough to give me a handle on where to continue looking. I hemmed and hawed, tried blaming the run-time loader, but really all the evidence pointed at memory corruption from inside Qt5Network.

Fortunately the problem was totally reproducible and consistent in the way it crashed: create a VLAN, and one by one all Qt-based applications that touch the network would crash with an unresolved symbol. Rebuilding with debug symbols and everything turned on .. just got me a core dump somewhere else. After much futzing about, I found one location where adding a qWarning() << "foo"; made the problem go away. That's just as unsatisfying as commenting-out bits until it works.

Valgrind to the rescue. It told me about uninitialized memory being used in ioctl() calls, in an area of Qt5Network that I already thought was a bit flaky (wrt. FreeBSD support, anyway).

En passant I learned more about gdb, valgrind, ioctl() internals, and network status querying. And on Christmas Eve (or afternoon) I finally landed a bunch of patches:

  • Network bearer detection fixed; Ethernet is now recognized as such and doesn't hit the generic bearer.
  • Network media detection fixed; don't re-use ioctl buffers for a different ioctl; use the right ioctl number (apparently NetBSD and FreeBSD differ there).
  • Be slightly smarter about closing sockets; I took this opportunity to introduce a SockPuppet class, for silliness.
  • Support LibreSSL, OpenSSL 1.0, and OpenSSL 1.1 all at the same time.

The last item, supporting different SSL implementations, is all other people's work. I just built, tested and landed their efforts. Credits are in the corresponding ports commits.

As a consequence of all this, along with the release of FreeBSD 12.0, I now have an i3-based FreeBSD 12 machine with up-to-date Intel graphics and a KDE Plasma 5 desktop that uses libressl across the entire stack, and can survive having VLANs modified, as well. That's a good present for the end of the year. (For the new year, I resolve to try to upstream some of these fixes, minus any silliness)

Semantik on FreeBSD

Semantik 1.2.0 was just released this week. It is (or was) one of the bits of KDE4-era software in the FreeBSD ports tree. So our packaging has jumped forward by two years for this particular piece of software. Here it is, running in a weird test-VM without a KDE Plasma environment:

Screenshot of Semantik 1.2.0

Semantik 1.2.0, with the example sheet loaded and a preview generated.

I’d like to thank Thomas Nagy for being a responsive upstream, particularly in the face of downstream-packager questions (which can be summarized as “I can’t be arsed to read the manual and I don’t use this application normally, but I compiled it and now it doesn’t do what I expect”).

This leaves us with just four applications to update (or rescue) from the KDE4 era before The Kulling takes place.

KDE4ward on FreeBSD

KDE4 is deprecated in FreeBSD. Even more: kdelibs4 doesn’t build on 12-STABLE because of changes in OpenSSL. The KDE-FreeBSD has decided not to put any effort into reconciling long-EOL’ed software with current dependencies.

Of course, we don’t want to lose software if we can help it. So there is a wiki page detailing which packages there are and what we are doing about it. (The Debian wiki page for the same is quite useful, too; both wiki pages address the broader issue of removing Qt4)

Right now we’re in the phase of figuring out what can be moved forward, and what is really over and out. As an example: basket. This is a desktop-organizer application. At one time it was (nearly?) part of KDE-PIM, but has wandered off to be a not-KDE-community project. It’s still alive, and (nearly?) has a KDE Frameworks-based release. So we updated that port from v1.81 to somewhere post-2.49. Software saved, KDE4ward!

I did kaffeine, the media player, this evening, and our friends from GNOME-FreeBSD did avahi-qt5. We’re rapidly reaching a point where we’ve updated our own ports and everyone else’s that depends on KDE4, to newer versions if they are available at all. The effect on users should be minimal (if pulling-in-Qt5 is considered minimal).

KDE ports on FreeBSD 12 (amd64)

FreeBSD 12 was released last week. I’m in the process of rebuilding my main workstation to all-flash (which means backups, disentangling ZFS pools, etc. etc.) and in the meantime installed 12-R to an older i3 I had lying around. KDE Applications 18.12 were released last thursday. Those are in ports, but haven’t made it around to the official packages yet. So here are some notes on almost-current KDE on almost-current FreeBSD:

Installing modern KDE: from a freshly installed 12-R system, getting to a KDE Plasma desktop is a matter of installing two metapackages: pkg install xorg kde5 . That will leave you in a state where you need to link .xinitrc to startkde .. rather old-school. For purposes of having a pleasant setup, pkg install falkon quassel sddm as well.

Graphics configuration: with FreeBSD 12, the Intel on-board graphics drivers have synced up with Linux KMS. Since I’m running an Intel box with iGPU, I installed package drm-kmod and drm-fbsd12.0-kmod, and added the kernel module (as instructed by the pkg-message):

sysrc kld_list+="/boot/modules/i915kms.ko"

Configuring KDE packages: Plasma (modern desktops in general) want to have DBus running, so enable it: sysrc dbus_enable=YES. If you want SDDM, enable it too: sysrc sddm_enable=YES. The invocations of sysrc can be combined, it’s smart enough.

And .. that’s it! Updates (for KDE Applications 18.12) are a pkg upgrade away.

There are a couple of tweaks I’ve left out: SDDM will complain about HAL not being started; I need to sort out what that means, effectively, for us. And both Falkon and Akonadi want larger local socket buffers than the default. That requires sysctl.conf changes and I’m not sure they are actually needed on 12-R. So it’s more a matter of “these legacy tweaks might still be necessary, I’m ignoring them to find out if they are actually necessary.”

KDE4 and Qt4 deprecation in FreeBSD

This is a reminder — for those who don’t read all of the FreeBSD mailing lists — that KDE4 is marked deprecated in the official ports tree for FreeBSD, and will be removed at the end of this year (in about 20 days). Then Qt4 will be removed from the official ports tree in mid-march.

Since both pieces of software are end-of-life and unmaintained upstream already for several years, the kde@ team at FreeBSD no longer can maintain them. Recent time-sinks were dealing with OpenSSL 1.1.1, libressl, C++17, .. the code is old, and there’s newer, nicer, better-maintained code available generally by replacing 4 with 5.

Users are encouraged to migrate to Qt5 and KDE Plasma plus KDE Applications. The easiest way to do so is to follow the instructions on the KDE-FreeBSD community wiki.