me
/
guix
Archived
1
0
Fork 0

gnu: glib: Work around test failure in 'gio/tests/network-address.c'.

* gnu/packages/patches/glib-tests-newnet.patch: New file.
* gnu/packages/glib.scm (glib): Use it.
* gnu-system.am (dist_patch_DATA): Add it.
master
Ludovic Courtès 2013-10-17 23:50:11 +02:00
parent 96e424672a
commit 93a3d8f609
3 changed files with 33 additions and 1 deletions

View File

@ -218,6 +218,7 @@ dist_patch_DATA = \
gnu/packages/patches/gcc-cross-environment-variables.patch \ gnu/packages/patches/gcc-cross-environment-variables.patch \
gnu/packages/patches/glib-tests-desktop.patch \ gnu/packages/patches/glib-tests-desktop.patch \
gnu/packages/patches/glib-tests-homedir.patch \ gnu/packages/patches/glib-tests-homedir.patch \
gnu/packages/patches/glib-tests-newnet.patch \
gnu/packages/patches/glib-tests-prlimit.patch \ gnu/packages/patches/glib-tests-prlimit.patch \
gnu/packages/patches/glibc-bootstrap-system.patch \ gnu/packages/patches/glibc-bootstrap-system.patch \
gnu/packages/patches/glibc-ldd-x86_64.patch \ gnu/packages/patches/glibc-ldd-x86_64.patch \

View File

@ -117,7 +117,8 @@ shared NFS home directories.")
(base32 "0cpzqadqk6z6bmb79p04pykxc8x57rvshh33414cnk41bvgaf4vm")) (base32 "0cpzqadqk6z6bmb79p04pykxc8x57rvshh33414cnk41bvgaf4vm"))
(patches (list (search-patch "glib-tests-homedir.patch") (patches (list (search-patch "glib-tests-homedir.patch")
(search-patch "glib-tests-desktop.patch") (search-patch "glib-tests-desktop.patch")
(search-patch "glib-tests-prlimit.patch"))))) (search-patch "glib-tests-prlimit.patch")
(search-patch "glib-tests-newnet.patch")))))
(build-system gnu-build-system) (build-system gnu-build-system)
(outputs '("out" ; everything (outputs '("out" ; everything
"doc")) ; 20 MiB of GTK-Doc reference "doc")) ; 20 MiB of GTK-Doc reference

View File

@ -0,0 +1,30 @@
Since guix-daemon runs in a separate networking name space, the only
interface available is "lo". However its index is incremented by one
at each build, so it can end up being greater than 255, leading to an
assertion failure in 'find_ifname_and_index'.
Work around that by directly querying the index of "lo".
--- glib-2.38.0/gio/tests/network-address.c 2013-09-17 20:47:14.000000000 +0200
+++ glib-2.38.0/gio/tests/network-address.c 2013-10-16 21:52:42.000000000 +0200
@@ -117,7 +117,7 @@ test_parse_host (gconstpointer d)
#define SCOPE_ID_TEST_PORT 99
#ifdef HAVE_IF_INDEXTONAME
-static char SCOPE_ID_TEST_IFNAME[IF_NAMESIZE];
+static char SCOPE_ID_TEST_IFNAME[] = "lo";
static int SCOPE_ID_TEST_INDEX;
#else
#define SCOPE_ID_TEST_IFNAME "1"
@@ -131,11 +131,7 @@ find_ifname_and_index (void)
return;
#ifdef HAVE_IF_INDEXTONAME
- for (SCOPE_ID_TEST_INDEX = 1; SCOPE_ID_TEST_INDEX < 255; SCOPE_ID_TEST_INDEX++) {
- if (if_indextoname (SCOPE_ID_TEST_INDEX, SCOPE_ID_TEST_IFNAME))
- break;
- }
- g_assert_cmpstr (SCOPE_ID_TEST_IFNAME, !=, "");
+ SCOPE_ID_TEST_INDEX = if_nametoindex (SCOPE_ID_TEST_IFNAME);
#endif
}