GLib's approach to portability is that we only support systems that we can test. That means that either a large number of GLib developers are regularly using GLib on a particular system, or we have regular builds of GLib on that system.
Mac OS: minimum version OS X 10.7 (we don’t support universal binaries: see https://bugzilla.gnome.org/show_bug.cgi?id=780238); some features (like notification support) require OS X 10.9 (see https://bugzilla.gnome.org/show_bug.cgi?id=747146)
Android: minimum NDK version 15, see https://gitlab.gnome.org/GNOME/glib/issues/1113
GLib is regularly built on at least the following systems:
GNOME Continuous: http://build.gnome.org/#/gnome-continuous
- Windows (MinGW64)
- Windows (msys2-mingw32)
- Windows (Visual Studio 2017)
- Android (NDK r16, API 21, arm64)
We want to set up regular testing via jhbuild for these platforms:
- Debian (regular package builds, but could use a jhbuilder)
- Ubuntu (regular package builds, but could use a jhbuilder)
- Hurd on Debian
Please contact us if you want to help.
Policy and rationale
Due to their position in the market, we consider supporting GNU/Linux, Windows and Mac OS to be the highest priorities and we will go out of our way to accommodate these systems, even in places that they are contravening standards.
In general, we are open to the idea of supporting any Free Software UNIX-like system with good POSIX compliance. We are always interested in receiving patches that improve our POSIX compliance -- if there is a good POSIX equivalent for a platform-specific API that we're using, then all other things equal, we prefer the POSIX one.
We may use a non-POSIX API available on one or more of our supported systems in the case that it provides some advantage over the POSIX equivalent (such as the case with pipe2() solving the O_CLOEXEC race). In these cases, we will try to provide a fallback to the pure POSIX approach. If we've used a system-specific API without providing a fallback to a largely-equivalent POSIX API then it is likely a mistake, and we're happy to receive a patch to fix it.
We are not interested in supporting other systems if it involves adding code paths that we cannot test. Specifically, this means that we will reject patches that introduce platform-specific #ifdef sections in the code unless we are actively doing builds of GLib on this platform (ie: see the lists above). We've historically accepted such patches from users of these systems on an ad hoc basis, but it created an unsustainable situation. Patches that fix platform-specific build issues in such a way that the code is improved in the general case are of course welcome.
Although we aim to support all systems with good POSIX compliance, we are not interested in adhering to "pure POSIX and nothing else". If we need to add a feature and we can provide good support on all of the platforms that we support (above), we will not hold back for other systems. We will always try to provide a fallback to a POSIX-specified approach, if possible, or to simply replace a given functionality with a no-op, but even this may not be possible in cases of critical functionality.
Note that we currently depend on a number of features specified in POSIX, but listed as optional:
CLOCK_MONOTONIC is expected to be present and working
pthread_condattr_setclock() is expected to be present and working
Also see toolchain requirements.