docs: Set -Dglib_debug=enabled by default and document it for distros

As per https://gitlab.gnome.org/GNOME/glib/-/issues/3421#note_2206315:

It seems like there’s agreement that glib_debug should be enabled for
developers and disabled for distros; and it also seems like there’s no
reliable way to figure this out magically (because not everyone ties
things to `-Dbuildtype=*`). So, we’re left with forcing some group of
people to manually set the value of `glib_debug`. There are more
developers/contributors than there are distros, and distros are more
likely to notice an accidentally-slow GLib package than developers are
likely to notice an accidentally-not-asserting-hard-enough local build,
so let’s say:

The default should be `-Dglib_debug=enabled`, and distros should probably
all override that to `-Dglib_debug=disabled`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Fixes: #3421
This commit is contained in:
Philip Withnall 2024-08-25 18:29:53 +01:00
parent 94078c9f96
commit b02e29558f
No known key found for this signature in database
GPG Key ID: DCDF5885B1F3ED73
2 changed files with 6 additions and 2 deletions

View File

@ -61,6 +61,10 @@ Quite a bit of additional debugging code is compiled into GLib when this
macro is defined, and since it is a globally visible define, third-party code
may be affected by it similarly to `G_DISABLE_ASSERT`.
Some of these checks can be relatively expensive at runtime, as they affect
every GObject type cast. Distributions are recommended to disable
`G_ENABLE_DEBUG` in stable release builds.
The additional code executed/compiled for this macro currently includes the
following, but this is not an exhaustive list:
- extra validity checks for `GDate`

View File

@ -115,9 +115,9 @@ option('oss_fuzz',
option('glib_debug',
type : 'feature',
value : 'auto',
value : 'enabled',
yield : true,
description : 'Enable GLib debug infrastructure (see docs/macros.md)')
description : 'Enable GLib debug infrastructure (distros typically want this disabled in production; see docs/macros.md)')
option('glib_assert',
type : 'boolean',