Bug 257623 - devel/glib20: Add option for test suite
Summary: devel/glib20: Add option for test suite
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-desktop (Team)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-04 17:33 UTC by Daniel Engberg
Modified: 2021-08-11 22:29 UTC (History)
4 users (show)

See Also:
tcberner: maintainer-feedback+


Attachments
Patch for glib20 (2.10 KB, patch)
2021-08-04 17:33 UTC, Daniel Engberg
no flags Details | Diff
Log of tests that fails (15.89 KB, text/plain)
2021-08-04 17:37 UTC, Daniel Engberg
no flags Details
Patch for glib20 v2 (2.19 KB, patch)
2021-08-11 08:29 UTC, Daniel Engberg
no flags Details | Diff
Patch for glib20 v3 (2.50 KB, patch)
2021-08-11 22:21 UTC, Daniel Engberg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Engberg freebsd_committer 2021-08-04 17:33:45 UTC
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)
Comment 1 Daniel Engberg freebsd_committer 2021-08-04 17:35:42 UTC
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)
Comment 2 Charlie Li freebsd_committer 2021-08-04 17:35:53 UTC
Static libraries must be built, otherwise at least emulators/qemu-user-static fails to build.
Comment 3 Daniel Engberg freebsd_committer 2021-08-04 17:37:13 UTC
Created attachment 226951 [details]
Log of tests that fails
Comment 4 Daniel Engberg freebsd_committer 2021-08-04 17:39:07 UTC
(In reply to Charlie Li from comment #2)
I know, that's why only shared libraries option isn't enabled by default
Comment 5 Charlie Li freebsd_committer 2021-08-04 17:50:47 UTC
(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?
Comment 6 Tobias C. Berner freebsd_committer 2021-08-06 07:17:44 UTC
(In reply to Charlie Li from comment #2)
this should be part of the option Description.
Comment 7 Daniel Engberg freebsd_committer 2021-08-11 08:29:20 UTC
Created attachment 227103 [details]
Patch for glib20 v2

Add more specific description regarding static lib(s) option
Comment 8 Tobias C. Berner freebsd_committer 2021-08-11 15:44:31 UTC
(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
Comment 9 Daniel Engberg freebsd_committer 2021-08-11 22:21:35 UTC
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)
Comment 10 Daniel Engberg freebsd_committer 2021-08-11 22:28:03 UTC
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)
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――