Reconsider default values for certain build options
Hi, I'm reviewing how Fedora's GLib build options diverge from the upstream GLib build options. (I wrote a blog post about this; see rule 1 and rule 2.) Fedora currently uses:
-Ddtrace=true \
-Dsystemtap=true \
-Dsysprof=enabled \
-Dglib_debug=disabled \
-Ddocumentation=true \
-Dinstalled_tests=true \
-Dgnutls=true \
--default-library=both \
-Ddtrace=true
, -Dsystemtap=true
, and -Dsysprof=enabled
are all required because these features are disabled by default upstream. This is questionable. I think it's pretty clear that distros are expected to ship with these features enabled, so they should either be enabled by default, or default to auto
. (Distros use or should use -Dauto_features=enabled
to enable all auto features by default.) auto
probably makes the most sense here, since it's OK for these features to be disabled when building GLib locally if you don't have required deps. It's easy to change sysprof
to auto
. Unfortunately, dtrace
and systemtap
cannot be changed without converting them from bool to feature type options. I'm tempted to do that, but GLib has a precedent for deprecating the old names of bool options and creating new names for feature options, and it's hard to think of appropriate replacement names.
-Dglib_debug
is by far the most important one to discuss, since it has significant impact on downstream. Fedora disabled this setting to "resolve" this bug report but I'm not sure whether it was wise or not. Notably, Debian does not use this flag, so that's a very major undesirable difference between Fedora ecosystem GLib and Debian ecosystem GLib. There are significant advantages and disadvantages to this choice, and it would be nice for major distros and upstream to do the same thing here. t first I was thinking "Fedora should change to match upstream" and "having debug enabled is safer and good." But enabling the option causes GLib's meson.build to define G_ENABLE_DEBUG
when building GLib itself; notably, it does not cause G_ENABLE_DEBUG
to be defined when building anything that depends on GLib, so it means GLib itself has more checks enabled than software that depends on GLib is likely to have (since few dependencies are going to manually define G_ENABLE_DEBUG
). It's weird for GLib to be compiled with G_ENABLE_DEBUG
while almost everything that depends on GLib is compiled without it (because it has to be defined manually and is not a default). So yeah, I don't know what the best default is. But we should discuss and agree on something, and ensure the default in meson_options.txt reflects best practice, so I can remove this flag from Fedora regardless of which way we choose.
-Ddocumentation=true
is tricky. We do want distros to ship with documentation enabled, so it's probably bad that it's currently disabled by default. But it depends on the introspection setting, with currently defaults to auto
. And we have a bootstrap issue: introspection cannot be enabled when bootstrapping. I don't think we should optimize for bootstrapping, though; distros should just manually set -Dintrospection=disabled -Ddocumentation=false
when bootstrapping, so that the default values of these options can match what we want distros to ship. But it doesn't make sense for introspection to be an auto feature if documentation is enabled by default, because that will just result in the build failing. So my suggestion here is the defaults should be -Ddocumentation=true
and also -Dintrospection=enabled
.
It seems to be conventional to disable installed tests by default upstream and enable them downstream. I guess this is because the installed tests are not useful unless the distro manually runs them? So maybe the status quo is OK here.
Then the final two options here are Fedora-specific and do not require further discussion. -Dgnutls=true
is added in a Fedora patch that we don't have a clear path to get rid of, see !903 (closed). --default-library=both
is needed for QEMU; I think all or almost all distros will need it, but that's definitely a downstream matter that's appropriate to configure manually.