unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars-Dominik Braun <lars@6xq.net>
To: itd <itd@net.in.tum.de>
Cc: Philip Munksgaard <philip@munksgaard.me>, 54729@debbugs.gnu.org
Subject: [bug#54729] [PATCH] build: haskell-build-system: Support packages w. multiple libraries
Date: Fri, 6 Jan 2023 12:51:44 +0100	[thread overview]
Message-ID: <Y7gLUP2ybDO2Cjsh@noor.fritz.box> (raw)
In-Reply-To: <877d1uifzi.fsf@localhost>

[-- Attachment #1: Type: text/plain, Size: 580 bytes --]

Hi,

> >     The following packages are broken because other packages they depend on are missing. These broken packages must be rebuilt before they can be used.
> > installed package attoparsec-0.14.4 is broken due to missing package scientific-0.3.7.0-9XG3zUjXOw970JFcruv0cZ
I can reproduce the problem on wip-haskell, which also uses
attoparsec-0.14.4 and GHC 9.2.5.

Further analysis suggests that this is a different issue, which is simply
exposed by attoparsec’s multiple libraries. I applied the attached
patch to wip-haskell, which fixes the issue for me.

Cheers,
Lars


[-- Attachment #2: 0001-build-haskell-build-system-Process-all-transitive-de.patch --]
[-- Type: text/plain, Size: 2697 bytes --]

From 272dc241677872a235e19135885599a18ef5f102 Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <lars@6xq.net>
Date: Fri, 6 Jan 2023 12:46:26 +0100
Subject: [PATCH] build: haskell-build-system: Process all transitive
 dependencies.

A bug caused install-transitive-deps to stop looping if a dependency
file already existed in the target directory. For Haskell packages
with multiple libraries (like attoparsec) this resulted in missing
dependencies and error messages like this:

    The following packages are broken because other packages they depend
    on are missing. These broken packages must be rebuilt before they
    can be used.
    installed package attoparsec-0.14.4 is broken due to missing package
    scientific-0.3.7.0-9XG3zUjXOw970JFcruv0cZ

See <https://issues.guix.gnu.org/54729#11>.

* guix/build/haskell-build-system.scm (register): Unconditionally loop
over all tails.
---
 guix/build/haskell-build-system.scm | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build-system.scm
index fb4aba28ea..72e12ba746 100644
--- a/guix/build/haskell-build-system.scm
+++ b/guix/build/haskell-build-system.scm
@@ -214,14 +214,16 @@ (define (install-transitive-deps conf-file src dest)
         (() #t)                         ;done
         ((id . tail)
          (if (not (vhash-assoc id seen))
-             (let ((dep-conf  (string-append src  "/" id ".conf"))
-                   (dep-conf* (string-append dest "/" id ".conf")))
-               (unless (file-exists? dep-conf*)
-                 (unless (file-exists? dep-conf)
+             (let* ((dep-conf  (string-append src  "/" id ".conf"))
+                    (dep-conf* (string-append dest "/" id ".conf"))
+                    (dep-conf-exists? (file-exists? dep-conf))
+                    (dep-conf*-exists? (file-exists? dep-conf*))
+                    (next-tail (append lst (if dep-conf-exists? (conf-depends dep-conf) '()))))
+               (unless dep-conf*-exists?
+                 (unless dep-conf-exists?
                    (error (format #f "File ~a does not exist. This usually means the dependency ~a is missing. Was checking conf-file ~a." dep-conf id conf-file)))
-                 (copy-file dep-conf dep-conf*) ;XXX: maybe symlink instead?
-                 (loop (vhash-cons id #t seen)
-                       (append lst (conf-depends dep-conf)))))
+                 (copy-file dep-conf dep-conf*)) ;XXX: maybe symlink instead?
+                (loop (vhash-cons id #t seen) next-tail))
              (loop seen tail))))))
 
   (define (install-config-file conf-file dest output:doc output:lib)
-- 
2.38.2


  parent reply	other threads:[~2023-01-06 11:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-05 15:15 [bug#54729] [PATCH] build: haskell-build-system: Support packages w. multiple libraries Philip Munksgaard
2022-04-06 19:19 ` [bug#54729] [PATCH core-updates v2 1/2] build: haskell-build-system: Remove trailing #t zimoun
2022-04-06 19:19   ` [bug#54729] [PATCH core-updates v2 2/2] build: haskell-build-system: Support multiple libraries zimoun
2022-04-06 19:23 ` [bug#54729] [PATCH] build: haskell-build-system: Support packages w. " zimoun
2022-04-07  6:08   ` Lars-Dominik Braun
2022-04-07  6:49     ` Philip Munksgaard
2022-04-07  8:25       ` Philip Munksgaard
2022-04-07  7:35     ` zimoun
2022-04-13 18:59     ` Philip Munksgaard
2022-04-14 18:21       ` Lars-Dominik Braun
2022-04-15  8:19         ` Philip Munksgaard
2022-09-23  9:42 ` itd
2022-12-21 12:48   ` itd
2022-12-23 14:03     ` Philip Munksgaard
2023-01-06 11:51   ` Lars-Dominik Braun [this message]
2023-01-12 17:30     ` itd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y7gLUP2ybDO2Cjsh@noor.fritz.box \
    --to=lars@6xq.net \
    --cc=54729@debbugs.gnu.org \
    --cc=itd@net.in.tum.de \
    --cc=philip@munksgaard.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).