Subject: bug#36811: Guix fails to build with libgc 8.0.4

From: Jonathan Brielmaier <[email-masked]>
Date: Tue, 19 Nov 2019 13:09:19 +0100

On 18.11.19 15:13, Ludovic Courtès wrote:
> To isolate the problem, how about:
>
>    1. Defining a Guix package for libgc 8.0.4;
>
>    2. Running “guix build guile --with-input=libgc@7=libgc@8” (or
>       defining a package along these lines).

I did this and the build was fine as I expected. Guile builds fine
against libgc-8. But building Guix with a guile-libgc8 goes wrong.

I got now this little patch and try to build guix with:
./pre-inst-env guix build guix -K

```
diff --git a/gnu/packages/bdw-gc.scm b/gnu/packages/bdw-gc.scm
index 7196ffcd32..172833780f 100644
--- a/gnu/packages/bdw-gc.scm
+++ b/gnu/packages/bdw-gc.scm
@@ -91,6 +91,19 @@ C or C++ programs, though that is not its primary goal.")

     (license (x11-style (string-append home-page "license.txt")))))

+(define-public libgc-8
+  (package
+    (inherit libgc)
+    (version "8.0.4")
+    (name "libgc")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/ivmai/bdwgc/releases"
+                                "/download/v" version "/gc-" version
".tar.gz"))
+            (sha256
+             (base32
+              "1798rp3mcfkgs38ynkbg2p47bq59pisrc6mn0l20pb5iczf0ssj3"))))))
+
  (define-public libgc/back-pointers
    (package
      (inherit libgc)
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 4419c48d1a..bc69488fa2 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -250,6 +250,14 @@ without requiring the source code to be rewritten.")
              (variable "GUILE_LOAD_COMPILED_PATH")
              (files '("lib/guile/2.2/site-ccache")))))))

+(define-public guile-2.2-libgc8
+  (package
+    (inherit guile-2.2)
+    (propagated-inputs
+     `(("libgc" ,libgc-8)
+       ,@(srfi-1:alist-delete "bdw-gc"
+                      (package-propagated-inputs guile-2.2))))))
+
  (define-public guile-2.2/fixed
    ;; A package of Guile 2.2 that's rarely changed.  It is the one used
    ;; in the `base' module, and thus changing it entails a full rebuild.
diff --git a/gnu/packages/package-management.scm
b/gnu/packages/package-management.scm
index 1daab4e879..d80e71749d 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -285,7 +285,7 @@
           ("sqlite" ,sqlite)
           ("libgcrypt" ,libgcrypt)

-         ("guile" ,guile-2.2)
+         ("guile" ,guile-2.2-libgc8)

           ;; Some of the tests use "unshare" when it is available.
           ("util-linux" ,util-linux)
```