From d0a49ddcb35b014b7f67dbbd69d2256420a5d7a2 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Sun, 25 Aug 2024 15:28:21 +0100 Subject: [PATCH 1/4] build: Check for epoll_create1 rather than epoll_create in meson.build Because `epoll_create1()` is what the code in `giounix-private.c` actually uses. Spotted by Xuntao Chi. Signed-off-by: Philip Withnall Fixes: #3450 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 48b4d9576..28f02e131 100644 --- a/meson.build +++ b/meson.build @@ -677,7 +677,7 @@ functions = [ 'copy_file_range', 'endmntent', 'endservent', - 'epoll_create', + 'epoll_create1', 'fallocate', 'fchmod', 'fchown', From 9a0b1498e030461751d8c9698c1dbdf63426f6c0 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Sun, 25 Aug 2024 15:34:32 +0100 Subject: [PATCH 2/4] gmenumodel: Acknowledge in docs that the UI used in the example is old MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This kind of deeply nested menu is definitely no longer good UI practice for most apps (deeply nested menus make things hard to find, and require good mouse control to navigate). However, it does serve as a good demonstration of the concepts in `GMenuModel`, so keep it, with a sentence to acknowledge that it’s not a good UI. Signed-off-by: Philip Withnall Fixes: #3451 --- gio/gmenumodel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gio/gmenumodel.c b/gio/gmenumodel.c index 2dd5daa0f..5aa1002f3 100644 --- a/gio/gmenumodel.c +++ b/gio/gmenumodel.c @@ -50,6 +50,8 @@ * * ![](menu-example.png) * + * While this kind of deeply nested menu is no longer considered good UI + * practice, it serves as a good example of the concepts in `GMenuModel`. * There are 8 ‘menus’ visible in the screenshot: one menubar, two * submenus and 5 sections: * From 4f85dfe34b0f27492ceeed066c8603475475c7a7 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Sun, 25 Aug 2024 18:25:51 +0100 Subject: [PATCH 3/4] meson: Fix reference to docs/macros.md in meson.options It was renamed from `macros.txt` a while ago. Signed-off-by: Philip Withnall --- meson.options | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meson.options b/meson.options index 14ece1039..dffbc9410 100644 --- a/meson.options +++ b/meson.options @@ -117,19 +117,19 @@ option('glib_debug', type : 'feature', value : 'auto', yield : true, - description : 'Enable GLib debug infrastructure (see docs/macros.txt)') + description : 'Enable GLib debug infrastructure (see docs/macros.md)') option('glib_assert', type : 'boolean', value : true, yield : true, - description : 'Enable GLib assertion (see docs/macros.txt)') + description : 'Enable GLib assertion (see docs/macros.md)') option('glib_checks', type : 'boolean', value : true, yield : true, - description : 'Enable GLib checks such as API guards (see docs/macros.txt)') + description : 'Enable GLib checks such as API guards (see docs/macros.md)') option('libelf', type : 'feature', From 635b033a2b00e2de6062542b30a35b3cba279b4a Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Sun, 25 Aug 2024 18:29:53 +0100 Subject: [PATCH 4/4] docs: Set -Dglib_debug=enabled by default and document it for distros MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Fixes: #3421 --- docs/macros.md | 4 ++++ meson.options | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/macros.md b/docs/macros.md index eac9b6db9..00350e7d7 100644 --- a/docs/macros.md +++ b/docs/macros.md @@ -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` diff --git a/meson.options b/meson.options index dffbc9410..93207e0ed 100644 --- a/meson.options +++ b/meson.options @@ -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',