Oops I did it again.

What, you’ll ask? I broke Gentoo/FreeBSD, or at least I’m preparing locally to break it, badly.

With 6.1 release I thought I was finally safe from libraries being moved out of base system, changing sonames (switching from the pimped up versions of FreeBSD to the proper ones from their authors), but it seems like I didn’t hit a crazy one now.

I should have paid more attention to Tiziano the other day, and I would have broke Gentoo/FreeBSD a couple of days already, and fixed it too, but I had to end up with my head against the wall of libeditline to end up working on the problem.

A little background: GNU readline is a cool library for line editing, the thing you usually do in bash when you move on the command line you’re writing and change it here and there; it’s released under the GPL license, not the LGPL license, so the software that’s released with non-GPL licenses can’t use it (think of BSD or MPL licensed software). To overcome this problem, NetBSD project developed libeditline (or simply libedit) that is a BSD library, API compatible with GNU readline.

This library is used (with an inline copy) in Heimdal (which Tiziano was working on) and in Firebird (which I tried to work on last night); as this end up creating conflicts, and in general is against our policies, I told him (and knew for myself) that the inline copy should have been replaced by a shared copy of the library.. for Linux it’s easy, Mike added some time go the dev-libs/libedit package, but on FreeBSD, where the library should have been provided by sys-freebsd/freebsd-lib, they try to use add_history() and readline() functions that are not available.

I then tried to write an ebuild for the version of libedit that’s in ports but that didn’t work out much good, mostly because it would have meant having two packages almost identical in the tree, and because it was also older than Mike’s package. As this didn’t work, I then worked on making dev-libs/libedit build on FreeBSD by splitting the Gentoo patch from the GLIBC patch, and the result is quite neat, I’m just waiting for Mike to check it and say if he’s okay with this merge.

What’s the problem then, if this is done already? Eh, as I said, the library changed soname, from libread.so.5 to libread.so, and the result is that /bin/sh won’t load after you merge freebsd-lib and before merging freebsd-bin again with libedit installed.

Okay, it’s hardly a showstopper, considering that not much of portage relies on /bin/sh and most simply depends on bash (that links to readline and is thus safe) but it will be a mess for first time installs.

For this reason, I decided that as soon as Mike merges the changes, I’ll be rebuilding the 6.2 stage, and updating the documentation myself so that I can point people to 6.2 directly (that’s proving simpler to manage than 6.1 especially with the new baselayout). The problem is the migration from one to the other being not that trivial, but that can be fixed easily too.

Anyway, the new stages will be shinier and cleaner, with the libedit split out, and after that we can work on getting Firebird and Heimdal on Gentoo/FreeBSD :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s