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.
This commit is contained in:
Lars-Dominik Braun 2023-01-06 12:46:26 +01:00
parent b0fc911b5b
commit 39c97cf3d0
No known key found for this signature in database
GPG key ID: F663943E08D8092A

View file

@ -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)