Created attachment 226950 [details] Patch for glib20 Don't build tests by default, the reduces time spent on compiling substantially (~450 objects vs ~1200) Add option to not build static libraries, disabled by default Add missing dependencies for tests Compile and tested on FreeBSD 13.0-STABLE #0 stable/13-n246086-a20c597c6d7 (amd64) (make, make check-plist, make test)
3 tests fails on my end (I haven't looked closer at them): 97/274 glib:glib / unix FAIL 3.56s killed by signal 6 SIGABRT 142/274 glib:gio / gdbus-address-get-session FAIL 0.01s killed by signal 6 SIGABRT 161/274 glib:gio / gdbus-peer FAIL 0.77s killed by signal 6 SIGABRT During configure stage you also get this error: Run-time dependency libelf found: NO (tried pkgconfig and cmake)
Static libraries must be built, otherwise at least emulators/qemu-user-static fails to build.
Created attachment 226951 [details] Log of tests that fails
(In reply to Charlie Li from comment #2) I know, that's why only shared libraries option isn't enabled by default
(In reply to Daniel Engberg from comment #4) It should not be an option at all, period. This is not any other "library" port, too many consumers, known and unknown, depend on it. If it was any other "library" port this would not be a stink. Not building static libraries only saves just under 8 MiB (at least on amd64), but is that a good trade-off for the inevitable user reports of their builds failing in mysterious ways?
(In reply to Charlie Li from comment #2) this should be part of the option Description.
Created attachment 227103 [details] Patch for glib20 v2 Add more specific description regarding static lib(s) option
(In reply to Daniel Engberg from comment #7) It might be worth reconsidering whether the risk of breakage down the line because of accidental disabling of STATIC (say in general) might be to great for the benefit gained. Personally, I don't see the risk as that high. But it might still seem like it is adding little (as Charlie pointed out, ~8M saved) while risking a lot. mfg Tobias
Created attachment 227123 [details] Patch for glib20 v3 Remove option for optional static libraries Disable unit tests that causes circular dependencies and also (g)dbus tests that requires a machine-id file (dbus_enable="YES" in /etc/rc.conf)
This leaves us with one test failing 97/268 glib:glib / unix FAIL 3.57s killed by signal 6 SIGABRT >>> G_DEBUG=gc-friendly G_TEST_BUILDDIR=/usr/ports/devel/glib20/work/glib-2.68.3/_build/glib/tests MALLOC_CHECK_=2 MALLOC_PERTURB_=126 G_TEST_SRCDIR=/usr/ports/devel/glib20/work/glib-2.68.3/glib/tests /usr/ports/devel/glib20/work/glib-2.68.3/_build/glib/tests/unix ――――――――――――――――――――――――――――――――――――― ✀ ――――――――――――――――――――――――――――――――――――― stdout: # random seed: R02S434b2d622487f2bdf3316a9c2b7703c9 1..11 # Start of glib-unix tests ok 1 /glib-unix/pipe ok 2 /glib-unix/error ok 3 /glib-unix/nonblocking ok 4 /glib-unix/sighup ok 5 /glib-unix/sigterm ok 6 /glib-unix/sighup_again ok 7 /glib-unix/sighup_add_remove ok 8 /glib-unix/sighup_nested ok 9 /glib-unix/callback_after_signal # Start of get-passwd-entry tests # /glib-unix/get-passwd-entry/root summary: Tests that g_unix_get_passwd_entry() works for a known-existing username. Bail out! GLib:ERROR:../glib/tests/unix.c:309:test_get_passwd_entry_root: assertion failed (local_error == NULL): No error: 0 (g-unix-error-quark, 0) stderr: ** GLib:ERROR:../glib/tests/unix.c:309:test_get_passwd_entry_root: assertion failed (local_error == NULL): No error: 0 (g-unix-error-quark, 0) ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Created attachment 228336 [details] Patch for glib20 v4 Refresh with 2.70.0 Backport upstream commit 75c854b359b8bd8b78938e51e5a2c7a42e5847ae Reference: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2276
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=3014d5a8f0e3c411b758afb8873ba4043b2a003c commit 3014d5a8f0e3c411b758afb8873ba4043b2a003c Author: Daniel Engberg <diizzy@FreeBSD.org> AuthorDate: 2021-10-02 22:08:00 +0000 Commit: Daniel Engberg <diizzy@FreeBSD.org> CommitDate: 2021-10-02 23:01:33 +0000 devel/glib20: Add option for unit tests Don't build tests by default, the reduces time spent on compiling substantially (~450 objects vs ~1200) Add dependency for unit tests Some tests are disable due to circular dependency Backport upstream commit 75c854b359b8bd8b78938e51e5a2c7a42e5847ae to fix an issue calling getpwnam_r Thanks to arrowd for troubleshooting and submitting bugfix upstream References: https://gitlab.gnome.org/GNOME/glib/-/issues/2488 https://gitlab.gnome.org/GNOME/glib/-/commit/75c854b359b8bd8b78938e51e5a2c7a42e5847ae https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2276 (backport) PR: 257623 Approved by: arrowd (mentor) Differential Revision: https://reviews.freebsd.org/D31702 devel/glib20/Makefile | 6 ++- .../glib20/files/patch-gio_tests_meson.build (new) | 61 +++++++++++++++++++++ devel/glib20/files/patch-glib_glib-unix.c (new) | 63 ++++++++++++++++++++++ 3 files changed, 129 insertions(+), 1 deletion(-)