From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <guix-patches-bounces+larch=yhetil.org@gnu.org>
Received: from mp12.migadu.com ([2001:41d0:8:6d80::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms5.migadu.com with LMTPS
	id WHAeCrMLuGOJfAAAbAwnHQ
	(envelope-from <guix-patches-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Fri, 06 Jan 2023 12:53:23 +0100
Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp12.migadu.com with LMTPS
	id iPYwCrMLuGOsBwEAauVa8A
	(envelope-from <guix-patches-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Fri, 06 Jan 2023 12:53:23 +0100
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id 77AD42F703
	for <larch@yhetil.org>; Fri,  6 Jan 2023 12:53:22 +0100 (CET)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <guix-patches-bounces@gnu.org>)
	id 1pDlHX-0006qk-Ue; Fri, 06 Jan 2023 06:53:07 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1pDlHU-0006qY-B2
 for guix-patches@gnu.org; Fri, 06 Jan 2023 06:53:04 -0500
Received: from debbugs.gnu.org ([209.51.188.43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1pDlHT-00013q-01
 for guix-patches@gnu.org; Fri, 06 Jan 2023 06:53:04 -0500
Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1pDlHS-0004Ls-L1
 for guix-patches@gnu.org; Fri, 06 Jan 2023 06:53:02 -0500
X-Loop: help-debbugs@gnu.org
Subject: [bug#54729] [PATCH] build: haskell-build-system: Support packages w.
 multiple libraries
Resent-From: Lars-Dominik Braun <lars@6xq.net>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: guix-patches@gnu.org
Resent-Date: Fri, 06 Jan 2023 11:53:02 +0000
Resent-Message-ID: <handler.54729.B54729.167300592116619@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 54729
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: itd <itd@net.in.tum.de>
Cc: Philip Munksgaard <philip@munksgaard.me>, 54729@debbugs.gnu.org
Received: via spool by 54729-submit@debbugs.gnu.org id=B54729.167300592116619
 (code B ref 54729); Fri, 06 Jan 2023 11:53:02 +0000
Received: (at 54729) by debbugs.gnu.org; 6 Jan 2023 11:52:01 +0000
Received: from localhost ([127.0.0.1]:53910 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1pDlGQ-0004Jq-Gi
 for submit@debbugs.gnu.org; Fri, 06 Jan 2023 06:52:01 -0500
Received: from mout-p-101.mailbox.org ([80.241.56.151]:39726)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lars@6xq.net>) id 1pDlGN-0004JV-BU
 for 54729@debbugs.gnu.org; Fri, 06 Jan 2023 06:51:56 -0500
Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4NpMBV4gjHz9sQZ;
 Fri,  6 Jan 2023 12:51:46 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001;
 t=1673005906;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=jN4Ue1lkEmKhKxCqA+6t0O4WqznI/1qkPmpHRRSq/Ac=;
 b=oqSnJcDpRLkuEIQuXBik6VrDxRwMep4WXJif+vpwPluorFs6Su8Us4LE3zqbtrUncuGy+M
 ygPsQmf5h5CsV8wR7JKEcujnG5c4CP1BZVLpQLH7dPfIAqVYMiSCLhWk8ZrS6iqczKNjHH
 Kw+7LdAdyHd/Q7QYEvExXZQr1UOpURXetpolXc6dGWIQAyir3UlwwwO7QCM9Kwpt+vLNGf
 sAaMPfNBRthy6QKnCuEQt0wLQLWcSqmMjMnDaZ7HozpWp5+HPU0R97mW2C9iUfEJiUYaJW
 zVsWStwE8Y9wwfNX1KdhwLYw5RswgVsvIgOQ3o4H/CUCJNwLg47oJ/jQQzfcmQ==
Date: Fri, 6 Jan 2023 12:51:44 +0100
From: Lars-Dominik Braun <lars@6xq.net>
Message-ID: <Y7gLUP2ybDO2Cjsh@noor.fritz.box>
References: <8a396a9803fc35ee63f01e608f87ffb16863bc6d.1649171729.git.philip@munksgaard.me>
 <877d1uifzi.fsf@localhost>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="NwpbRF3a2GMVN2tE"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <877d1uifzi.fsf@localhost>
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: guix-patches@gnu.org
List-Id: <guix-patches.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>,
 <mailto:guix-patches-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/guix-patches>
List-Post: <mailto:guix-patches@gnu.org>
List-Help: <mailto:guix-patches-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>,
 <mailto:guix-patches-request@gnu.org?subject=subscribe>
Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org
Sender: guix-patches-bounces+larch=yhetil.org@gnu.org
X-Migadu-Country: US
X-Migadu-Flow: FLOW_IN
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1673006003; a=rsa-sha256; cv=none;
	b=UXTM/8NvPy+rbHchY5SYNFk0dePfcR0Y8gGEHq3FVfxAfP2Z+xbSsvHbH/9fX3kSh+E7pB
	XhpdoiYqcLzObl5VuABo8bK8NhdppCj6gw/2phEZjaIzaRAIKm/M++tmqRMD873yty7JQX
	C+h2gLJn0D/PkBCKLhgKFpIQGiA9gCE4BMLToopRM2vQF0E9JjoW6IgMag4wfZOSEHqsmL
	04aYQABMmqfXLunG/xzCBXWAtstE7ma3eEVdWf/7VSeDIUvhYrI2e92LiR2QO4q9ixeVDS
	fPA3Det4+6nPG7lSHQuIZwKSVc/U3o5+tK3/Q+NVJo2k8prQSzZ+wpf8mdJ4aQ==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=6xq.net header.s=MBO0001 header.b=oqSnJcDp;
	spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org";
	dmarc=fail reason="SPF not aligned (relaxed)" header.from=6xq.net (policy=none)
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1673006003;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:cc:mime-version:mime-version:
	 content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:resent-cc:
	 resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to:
	 references:references:list-id:list-help:list-unsubscribe:
	 list-subscribe:list-post:dkim-signature;
	bh=jN4Ue1lkEmKhKxCqA+6t0O4WqznI/1qkPmpHRRSq/Ac=;
	b=rm+mnRFuPmsCXqoQJQZNJ9/5vDnufQ8vffFz5K5JgNiH36RpQqONB5mOksNgg533n2zKbD
	+1hl67o/c0G4Fpk2rVoMYxjkBOHhG+OK+kDWqM4LXWRWaVcrLbg/erXe3Ba8cHXsnWAblF
	ImlUyDUVosoddxNNW1F8CdQ0BFm9B2+bNzHFaVZM1+BDLp1ytuTWSk7JsPcMhc0LHUzi0v
	apnQh1x6OZzm4qi555dP1pTdfLOyx7jfoaem0pCmAqmzJib2DUSWSkDmsLIQNFrO5g3mj0
	be2dxr1h1KkjgZVv5OkcXh+Kdyb/hMdxg7s73LKf8DHBVU3F05K4+GItDJBJtQ==
X-Spam-Score: -2.85
X-Migadu-Queue-Id: 77AD42F703
Authentication-Results: aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=6xq.net header.s=MBO0001 header.b=oqSnJcDp;
	spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org";
	dmarc=fail reason="SPF not aligned (relaxed)" header.from=6xq.net (policy=none)
X-Migadu-Scanner: scn0.migadu.com
X-Migadu-Spam-Score: -2.85
X-TUID: rdqwVfrW+F+r


--NwpbRF3a2GMVN2tE
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

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


--NwpbRF3a2GMVN2tE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename="0001-build-haskell-build-system-Process-all-transitive-de.patch"

>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


--NwpbRF3a2GMVN2tE--