[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

11/13: build: haskell-build-system: Process all transitive dependencies.

From: guix-commits
Subject: 11/13: build: haskell-build-system: Process all transitive dependencies.
Date: Sat, 21 Jan 2023 06:55:20 -0500 (EST)

lbraun pushed a commit to branch wip-haskell
in repository guix.

commit 5bd4442e80a1e94047024c6474cf0222074d6218
Author: Lars-Dominik Braun <>
AuthorDate: Fri Jan 6 12:46:26 2023 +0100

    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
    See <>.
    * 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 
index fb4aba28ea..72e12ba746 100644
--- a/guix/build/haskell-build-system.scm
+++ b/guix/build/haskell-build-system.scm
@@ -214,14 +214,16 @@ given Haskell package."
         (() #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 
-                 (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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]