At Akademy 2023 Tarcisio Fischer gave a talk about a visualization tool, which was applied to Bloomberg’s BDE (Basic Development Environment) set of libraries. It’s a bit Boost-ish, in the sense that it adds a whole bunch of stuff to make C++ nicer, and communicates closely with the standards committee. It is an opinionated library, with strongly articulated views on coding style and documentation. Nominally, it is a portable library (e.g. to Solaris, AIX, and this upstart experimental thingy called Linux). So after hearing Tarcisio’s talk and attending a BoF about the library, I decided to package it for FreeBSD.

“Make C++ nicer” is a recurring theme. Qt does it, and has been doing it since the earliest days of (non-)standardization of C++, which is why we have QList and QString and QDate. Boost does it. BDE does it. Heck, my work-work has a “toolkit” library that is our expression of “things that we need to make C++ nicer”.

BDE has a bespoke build system which is a bunch of Python scripts that then run CMake – and documentation on the build process too, which fortunately includes a “plain CMake build”. That saves me the trouble of debugging two layers or indirection (shell scripts and Python programs that conspire together to run CMake).

Mostly the trick is to pretend that FreeBSD is Linux – which, from the point of view of “this is POSIX, plus some modernity and you can count on a recent Clang” is true. I spotted some use of /proc which is clearly non-portable (unless you mount the Linux-compatibility /proc filesystem, but it shouldn’t be necessary) and which will need to be repaired later.

There’s a bunch of places that #ifdef the supported platform, checking for Solaris, and AIX, and Linux, and Darwin, and then complaining if we’re not building on one of them. Usually, adding || defined(BSLS_PLATFORM_OS_FREEBSD) to the Linux branch (see above) is enough. With 11 patches I got the library to build and install, so I pushed an initial FreeBSD port to the ports tree last week and some updates for it this week.

What Next

There’s no consumers of the library in the FreeBSD ports collection, so I’ll need to go looking for one in order to exercise the library a bit and justify its inclusion.

I need to try out the examples – I suspect that the library isn’t quite complete and is missing a couple of symbols, actually – and then run the actual tests of the library. Once that works out, well, it becomes time to try to upstream the changes. So far no C++ code has needed to be written, so there’s hardly any coding guidelines to fall afoul of.

The BDE install process is somewhat rude, because it bundles and installs some things like pcre2. Hint to upstream: that’s already installed and you should put your spare copy elsewhere. Mostly I hit things with a hatchet until they work, chopping away the bits that seem less successful. A collection of the tests (the bsla group) can be built and run successfully, so the library is at least partially useful on FreeBSD already.