From c555134310728360cb3b12472e8d487421d57a7d Mon Sep 17 00:00:00 2001 Message-ID: From: Janneke Nieuwenhuizen Date: Fri, 6 Dec 2024 16:25:54 +0100 Subject: [PATCH] gnu: guile-3.0: Silence GC warnings on the Hurd. * gnu/packages/patches/guile-hurd-silence-gc-warnings.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/guile.scm (guile-3.0): When building for the Hurd, use it in new stage "patch-silence-gc-warnings". Change-Id: I48f2641a162c3fab15655293e10c4aa2200d5843 --- gnu/local.mk | 1 + gnu/packages/guile.scm | 11 ++++ .../guile-hurd-silence-gc-warnings.patch | 58 +++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 gnu/packages/patches/guile-hurd-silence-gc-warnings.patch diff --git a/gnu/local.mk b/gnu/local.mk index a7bd32453b..d848ceddc4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1520,6 +1520,7 @@ dist_patch_DATA = \ %D%/packages/patches/guile-fix-invalid-unicode-handling.patch \ %D%/packages/patches/guile-gdbm-ffi-support-gdbm-1.14.patch \ %D%/packages/patches/guile-hurd-posix-spawn.patch \ + %D%/packages/patches/guile-hurd-silence-gc-warnings.patch \ %D%/packages/patches/guile-lzlib-hurd64.patch \ %D%/packages/patches/guile-present-coding.patch \ %D%/packages/patches/guile-rsvg-pkgconfig.patch \ diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 69dff9211f..41fbd895ed 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -413,6 +413,17 @@ (define-public guile-3.0 (search-patch "guile-hurd-posix-spawn.patch"))) (invoke "patch" "--force" "-p1" "-i" patch)))) #~()) + #$@(if (target-hurd?) + #~((add-before 'build 'patch-silence-gc-warnings + (lambda _ + ;; TODO: Move patch to 'source' on next rebuild + ;; cycle. + (define patch + #$(local-file + (search-patch + "guile-hurd-silence-gc-warnings.patch"))) + (invoke "patch" "--force" "-p1" "-i" patch)))) + #~()) #$@(if (system-hurd?) #~((add-after 'unpack 'disable-popen.test-no-duplicate ;; This test hangs on the Hurd. diff --git a/gnu/packages/patches/guile-hurd-silence-gc-warnings.patch b/gnu/packages/patches/guile-hurd-silence-gc-warnings.patch new file mode 100644 index 0000000000..a006d93361 --- /dev/null +++ b/gnu/packages/patches/guile-hurd-silence-gc-warnings.patch @@ -0,0 +1,58 @@ +From 1256fb0925c5ff7c94249f53e0fb47d1ec280b3f Mon Sep 17 00:00:00 2001 +From: Janneke Nieuwenhuizen +Date: Fri, 6 Dec 2024 16:18:13 +0100 +Subject: [PATCH] Silence GC warnings on the Hurd. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +On 32-bit GNU/Hurd (i586-gnu), libgc emits "Repeated allocation" +warnings that are annoying and interfere with communications between +'guix-daemon' and 'guix authenticate': +. + +* libguile/gc.c (scm_gc_no_warnings)[__GNU__]: New procedure. +(scm_init_gc)[__GNU__]: Use it to silence GC warnings. + +Co-authored-by: Ludovic Courtès +--- + libguile/gc.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/libguile/gc.c b/libguile/gc.c +index 3cbe43ec5..1ea4abcf8 100644 +--- a/libguile/gc.c ++++ b/libguile/gc.c +@@ -84,6 +84,13 @@ int scm_debug_cells_gc_interval = 0; + garbage collection. */ + static SCM scm_protects; + ++#if defined __GNU__ ++#include ++static void ++scm_gc_no_warnings (char *message, GC_word arg) ++{ ++} ++#endif + + + +@@ -616,7 +623,15 @@ scm_init_gc () + scm_c_hook_add (&scm_after_gc_c_hook, accumulate_gc_timer, NULL, 0); + + GC_set_oom_fn (scm_oom_fn); ++#if __GNU__ ++ /* XXX: On 32-bit GNU/Hurd (i586-gnu), libgc emits "Repeated allocation" ++ warnings that are annoying and interfere with communications between ++ 'guix-daemon' and 'guix authenticate': ++ . Silence them. */ ++ GC_set_warn_proc (scm_gc_no_warnings); ++#else + GC_set_warn_proc (scm_gc_warn_proc); ++#endif + GC_set_start_callback (run_before_gc_c_hook); + + #include "gc.x" +-- +2.46.0 + base-commit: 84fa76db424df8962ee21315ffd680c083edbf00 -- 2.46.0