GNU bug report logs - #67896
[PATCH] gnu: ghc-9.2: Make Cabal respect GHC_PACKAGE_PATH

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: soeren@HIDDEN; Keywords: patch; dated Tue, 19 Dec 2023 10:08:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 67896 <at> debbugs.gnu.org:


Received: (at 67896) by debbugs.gnu.org; 7 Jan 2024 09:38:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 07 04:38:02 2024
Received: from localhost ([127.0.0.1]:60633 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rMPbW-0006Ep-IA
	for submit <at> debbugs.gnu.org; Sun, 07 Jan 2024 04:38:02 -0500
Received: from magnesium.8pit.net ([45.76.88.171]:27644)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <soeren@HIDDEN>) id 1rMPbU-0006EP-14
 for 67896 <at> debbugs.gnu.org; Sun, 07 Jan 2024 04:38:01 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=opensmtpd; bh=gkOZooAtUa
 v9Vz2ArucLZbpUH35+YcoUsV7BljJySkE=;
 h=in-reply-to:references:from:
 subject:cc:to:date; d=soeren-tempel.net; b=I7kjNlV68syBu5UgU/VXQ6OZkum
 d/BEjoVIfXlIkZnR0F37gQ0PzWHonzHr8o7YMvqQwLuWqX8VysO8jMkVTRsThJmgclojnf
 2+ps4HMOrLyPiY1gPr8jv8gecktNlf9UNC9wzg6PaQa6I/CJeAC+IwvLC4raxI+eCRCtK2
 m/08=
Received: from localhost
 (dynamic-2a02-3102-49da-001b-dbac-d05c-0836-c585.310.pool.telefonica.de
 [2a02:3102:49da:1b:dbac:d05c:836:c585])
 by magnesium.8pit.net (OpenSMTPD) with ESMTPSA id a5d50719
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:YES); 
 Sun, 7 Jan 2024 10:37:52 +0100 (CET)
Date: Sun, 07 Jan 2024 10:37:45 +0100
To: Saku Laesvuori <saku@HIDDEN>
Subject: Re: [bug#67896] [PATCH] gnu: ghc-9.2: Make Cabal respect
 GHC_PACKAGE_PATH
From: =?UTF-8?Q?S=C3=B6ren?= Tempel <soeren@HIDDEN>
References: <3K6E1L1WLK573.223FCVRGQCGWL@HIDDEN>
 <ZZloY0SubqGqVa_O@HIDDEN> <3ELNY2F2SV7KX.2JFO7970OJNKU@HIDDEN>
 <w5b6g7spkrevdxpb6m6ugrecumgjwaf6myrh5ig4g6pgep4htj@h4vgj6if5zkj>
In-Reply-To: <w5b6g7spkrevdxpb6m6ugrecumgjwaf6myrh5ig4g6pgep4htj@h4vgj6if5zkj>
Message-Id: <270O1QKCL3GA8.2UGLUU9CUOGAL@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67896
Cc: Lars-Dominik Braun <lars@HIDDEN>, 67896 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

I just tested this, the patch applies cleanly for both GHC 9.4.8 and 9.6.3.=


Saku Laesvuori <saku@HIDDEN> wrote:
> > Hi,
> >=20
> > Lars-Dominik Braun <lars@HIDDEN> wrote:
> > > sorry for the delay, I just tried your patch and it works well combin=
ing
> > > a local cabal project and libraries/GHC from Guix. I=E2=80=99d say th=
is is a
> > > massive improvement, so I=E2=80=99d like to ship it with Guix. Howeve=
r this
> > > is a world rebuilding change, so I=E2=80=99ll push it to the haskell-=
team
> > > branch and probably wait for #67921 to be ready before it can hit mas=
ter.
> >=20
> > Yea, glad to hear that. Waiting for #67921 is fine by me. Should I also=

> > prepare a patch for the GHC 9.4 package then? Currently this is only GH=
C
> > 9.2.
>=20
> I'm currently trying to update GHC to 9.6 in that series (there are some
> weird issues when running the test suite). If the same cabal patch works
> with GHC 9.6 I can add the reference to it in the package definition
> (same with 9.4). Otherwise a patch for those versions would be nice.




Information forwarded to guix-patches@HIDDEN:
bug#67896; Package guix-patches. Full text available.

Message received at 67896 <at> debbugs.gnu.org:


Received: (at 67896) by debbugs.gnu.org; 6 Jan 2024 21:16:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 06 16:16:42 2024
Received: from localhost ([127.0.0.1]:60338 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rME25-0002QW-Nj
	for submit <at> debbugs.gnu.org; Sat, 06 Jan 2024 16:16:42 -0500
Received: from vmi571514.contaboserver.net ([75.119.130.101]:42812
 helo=mail.laesvuori.fi) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <saku@HIDDEN>) id 1rME23-0002Ne-0n
 for 67896 <at> debbugs.gnu.org; Sat, 06 Jan 2024 16:16:39 -0500
Received: from X-kone (88-113-24-127.elisa-laajakaista.fi [88.113.24.127])
 by mail.laesvuori.fi (Postfix) with ESMTPSA id 496FA343045;
 Sat,  6 Jan 2024 22:16:48 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=laesvuori.fi; s=mail;
 t=1704575808; bh=jDcCNblsvN/fdro3zBluEbGlHJIuvLumdxKaVj6xX58=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To;
 b=m1jufk4hwdbjIQNRhXrsA/H0NhxTEjWbIhEyLcGmOnmGZCDZjAoACfkFaQP6iUexi
 GFDQZCM870GNGt7UZM/hFkrpUlP8+kmb1cAiBBiuTai1WTHi8VuKvLbUPMQATaZsi2
 DRen/0rvmz5siQuJZlsvd/FxmBIl7QCt1UjSuHDE=
Date: Sat, 6 Jan 2024 23:16:27 +0200
From: Saku Laesvuori <saku@HIDDEN>
To: =?utf-8?B?U8O2cmVu?= Tempel <soeren@HIDDEN>
Subject: Re: [bug#67896] [PATCH] gnu: ghc-9.2: Make Cabal respect
 GHC_PACKAGE_PATH
Message-ID: <w5b6g7spkrevdxpb6m6ugrecumgjwaf6myrh5ig4g6pgep4htj@h4vgj6if5zkj>
References: <3K6E1L1WLK573.223FCVRGQCGWL@HIDDEN>
 <ZZloY0SubqGqVa_O@HIDDEN>
 <3ELNY2F2SV7KX.2JFO7970OJNKU@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature"; boundary="3i5z5yyieqak3tre"
Content-Disposition: inline
In-Reply-To: <3ELNY2F2SV7KX.2JFO7970OJNKU@HIDDEN>
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67896
Cc: Lars-Dominik Braun <lars@HIDDEN>, 67896 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--3i5z5yyieqak3tre
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

> Hi,
>=20
> Lars-Dominik Braun <lars@HIDDEN> wrote:
> > sorry for the delay, I just tried your patch and it works well combining
> > a local cabal project and libraries/GHC from Guix. I=E2=80=99d say this=
 is a
> > massive improvement, so I=E2=80=99d like to ship it with Guix. However =
this
> > is a world rebuilding change, so I=E2=80=99ll push it to the haskell-te=
am
> > branch and probably wait for #67921 to be ready before it can hit maste=
r.
>=20
> Yea, glad to hear that. Waiting for #67921 is fine by me. Should I also
> prepare a patch for the GHC 9.4 package then? Currently this is only GHC
> 9.2.

I'm currently trying to update GHC to 9.6 in that series (there are some
weird issues when running the test suite). If the same cabal patch works
with GHC 9.6 I can add the reference to it in the package definition
(same with 9.4). Otherwise a patch for those versions would be nice.

--3i5z5yyieqak3tre
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEoMkZR3NPB29fCOn/JX0oSiodOjIFAmWZwysACgkQJX0oSiod
OjLRBRAAwIm+OVdfsjEVmZGGygim1vjjFIq0GUXIXGyQ7qArsIhHQ+Uy1CD9nuRf
HnjbF+6LCqcF8WFTmnCiHuHUo6v0Af8iXUhbO6iGpuQ+bnj9YYLubI+l81QyN83f
yf9ON60AVy0X0Mlb1TDA4IO02idbftr+9VKMpUbyO1jZVm76T+w1M7B0YscXhHXN
dnZM/naUxcOvHEdL8qBSPz+357oRXOdYZYGe3FpeP8oVygB9VXQwfXeJej7QE71H
H+0LSlv2/7rqbBolMJRGX/I1LbE5RsBbprBaaSrbSLBQSgVL3btbarziQWlFUdsq
HViIyyVk9HquIkWee6vqXmPsh/AJBMjZWQtrAlPhiMkblQgnoqNOlSovYRHzBE0D
WCH3pR3PdNqlzmmwUqkQ48VVN1geklk1pStxbBcSRt+ReoX+wWptlzz6lyU687Ia
RUSXnWMSksO3+Ghy/rjxETAsy0OLELepPfDuvUocvQMVE7S6znNi+hRyL4TnOQDV
K7VnprCzh7tAAP+6Gyw4Yh9Ee0WVta7gjLsLm9USBtNo/TPf9bWQwu3rpjwgzzAD
zEKfNfWkBYPthIBdZouJGPbkDfVsg66Stn4zMmReRKOU9awUogx7qmKO0usRPHKb
Qvero3/bfeAknXaEWXgXpJeO5540jLpAIH3OsDLYeytCBvyZXq4=
=vwJz
-----END PGP SIGNATURE-----

--3i5z5yyieqak3tre--




Information forwarded to guix-patches@HIDDEN:
bug#67896; Package guix-patches. Full text available.

Message received at 67896 <at> debbugs.gnu.org:


Received: (at 67896) by debbugs.gnu.org; 6 Jan 2024 15:51:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 06 10:51:45 2024
Received: from localhost ([127.0.0.1]:60170 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rM8xc-0004Zg-R6
	for submit <at> debbugs.gnu.org; Sat, 06 Jan 2024 10:51:45 -0500
Received: from mout-p-101.mailbox.org ([2001:67c:2050:0:465::101]:49336)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lars@HIDDEN>) id 1rM8xa-0004ZR-Sj
 for 67896 <at> debbugs.gnu.org; Sat, 06 Jan 2024 10:51:43 -0500
Received: from smtp1.mailbox.org (smtp1.mailbox.org
 [IPv6:2001:67c:2050:b231:465::1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4T6lDc2WxJz9sNb;
 Sat,  6 Jan 2024 16:51:28 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001;
 t=1704556288;
 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=kncE/0u2l/RYT+e0FinjxWsqM/CVPJkkewz4Bs02kzA=;
 b=kP+7vvg/3EkvZKLeYCNu/UTr7qsrAWXmseZD1bnDMo0G+SDvY+paCPJNW0IXA5FN4zBeDo
 XSWpwWknnKbVzj6b8mAZsbInzFeGphVVuqYsRozzNkFCGUQteTNXsqKp1/TDnMTILozK1L
 KRuHiLSHy01p65EUuobJ91GkOwW2iG3N0HBXK6xtNKjYhu1X8bu6l/eaxP1bT647c0as0O
 HlhYAw3PCGiL8Wt8BzG2kvnVG1yb6vtHXwT71LBAmX9ssZroqeg8QiDdOTDPuiSMXMvvr/
 T3H42x0wbLYbK6LpFNeya9f9Fx4eBNZyTd792sdfy61DcsJAOw41rzpYjS843g==
Date: Sat, 6 Jan 2024 16:51:24 +0100
From: Lars-Dominik Braun <lars@HIDDEN>
To: =?iso-8859-1?Q?S=F6ren?= Tempel <soeren@HIDDEN>
Subject: Re: [PATCH] gnu: ghc-9.2: Make Cabal respect GHC_PACKAGE_PATH
Message-ID: <ZZl2_OMTbD9bovN1@HIDDEN>
References: <3K6E1L1WLK573.223FCVRGQCGWL@HIDDEN>
 <ZZloY0SubqGqVa_O@HIDDEN>
 <3ELNY2F2SV7KX.2JFO7970OJNKU@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <3ELNY2F2SV7KX.2JFO7970OJNKU@HIDDEN>
X-Rspamd-Queue-Id: 4T6lDc2WxJz9sNb
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 67896
Cc: 67896 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi,

> Yea, glad to hear that. Waiting for #67921 is fine by me. Should I also
> prepare a patch for the GHC 9.4 package then? Currently this is only GHC
> 9.2.

as far as I see 9.4 inherits from 9.2 and thus this patch should be
applied automatically.

> I just grep'ed for GHC_PACKAGE_PATH, e.g.:
> 
> * https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/virtualization.scm#n784
> * https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/haskell-build-system.scm#n111
> * https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/haskell.scm#n963

Ah, I see. I’ll check whether this is still necessary.

Cheers,
Lars





Information forwarded to guix-patches@HIDDEN:
bug#67896; Package guix-patches. Full text available.

Message received at 67896 <at> debbugs.gnu.org:


Received: (at 67896) by debbugs.gnu.org; 6 Jan 2024 15:07:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 06 10:07:22 2024
Received: from localhost ([127.0.0.1]:60129 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rM8Gf-00045W-Uw
	for submit <at> debbugs.gnu.org; Sat, 06 Jan 2024 10:07:22 -0500
Received: from magnesium.8pit.net ([45.76.88.171]:21759)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <soeren@HIDDEN>) id 1rM8Gc-00045K-LU
 for 67896 <at> debbugs.gnu.org; Sat, 06 Jan 2024 10:07:20 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=opensmtpd; bh=8n2Mi/o5/4
 BGcdBmVZjjjCdkB7YRrRMfJc/E4oPAeYY=;
 h=in-reply-to:references:from:
 subject:cc:to:date; d=soeren-tempel.net; b=bLlGW3fjOfp6LUydIGIZlhM8Ex3
 iGKCrwjK+fjCioRJ01vq2Vn7mcnALQ8yFhkKWtCMtFN89XGdlH/jMrnMbQPfnnWIOg2G6H
 WWr9OvvwJR/rxOb5JdmiYaNB1UPK37MeZYPIG3/mgaopjLuuf8FO/5+4bv8Dt5Svn8tkQN
 bgFA=
Received: from localhost
 (dynamic-2a02-3102-49da-001b-3b7d-d1ac-1e16-7275.310.pool.telefonica.de
 [2a02:3102:49da:1b:3b7d:d1ac:1e16:7275])
 by magnesium.8pit.net (OpenSMTPD) with ESMTPSA id e911015a
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:YES); 
 Sat, 6 Jan 2024 16:07:10 +0100 (CET)
Date: Sat, 06 Jan 2024 16:07:05 +0100
To: Lars-Dominik Braun <lars@HIDDEN>
Subject: Re: [PATCH] gnu: ghc-9.2: Make Cabal respect GHC_PACKAGE_PATH
From: =?UTF-8?Q?S=C3=B6ren?= Tempel <soeren@HIDDEN>
References: <3K6E1L1WLK573.223FCVRGQCGWL@HIDDEN>
 <ZZloY0SubqGqVa_O@HIDDEN>
In-Reply-To: <ZZloY0SubqGqVa_O@HIDDEN>
Message-Id: <3ELNY2F2SV7KX.2JFO7970OJNKU@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67896
Cc: 67896 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

Lars-Dominik Braun <lars@HIDDEN> wrote:
> sorry for the delay, I just tried your patch and it works well combining
> a local cabal project and libraries/GHC from Guix. I=E2=80=99d say this i=
s a
> massive improvement, so I=E2=80=99d like to ship it with Guix. However th=
is
> is a world rebuilding change, so I=E2=80=99ll push it to the haskell-team=

> branch and probably wait for #67921 to be ready before it can hit master.=


Yea, glad to hear that. Waiting for #67921 is fine by me. Should I also
prepare a patch for the GHC 9.4 package then? Currently this is only GHC
9.2.

> One minor issue: If you add a patch file, also add it to gnu/local.mk.

Oh, I wasn't aware. Thanks for pointing that out, will keep it in mind
for future patches!

> > However, given that Setup.hs also uses
> > Distribution.Simple and that there are several places in Guix itself
> > where we need to unset GHC_PACKAGE_PATH atm, I personally believe it
> > to be preferable to fix the vendored version.
>=20
> Which locations are you referring to?

I just grep'ed for GHC_PACKAGE_PATH, e.g.:

* https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/virtualizati=
on.scm#n784
* https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/haskell-build-=
system.scm#n111
* https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/haskell.scm#=
n963

Greetings
S=C3=B6ren




Information forwarded to guix-patches@HIDDEN:
bug#67896; Package guix-patches. Full text available.

Message received at 67896 <at> debbugs.gnu.org:


Received: (at 67896) by debbugs.gnu.org; 6 Jan 2024 14:49:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 06 09:49:28 2024
Received: from localhost ([127.0.0.1]:58873 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rM7zM-0000kK-1P
	for submit <at> debbugs.gnu.org; Sat, 06 Jan 2024 09:49:28 -0500
Received: from mout-p-103.mailbox.org ([2001:67c:2050:0:465::103]:46682)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lars@HIDDEN>) id 1rM7zI-0000k4-VC
 for 67896 <at> debbugs.gnu.org; Sat, 06 Jan 2024 09:49:26 -0500
Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4T6jrm0grXz9sS2;
 Sat,  6 Jan 2024 15:49:12 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001;
 t=1704552552;
 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=oHkWeNMLRU6xqKoBqOJrNoHl8PSmZ5ECE5KNzTua4o8=;
 b=IuzHgNKQ/rU1zSj+EkRcjyYQRkENtaLPfva5Fn15EFBWAWZxhfsVybVztVItGg+WjdqayN
 3/nlCYR1/36ajzN1/QhskBNf8NJZV46rLrWFu4UgMB/a9nnsJjAzoMAKeNFBpAZYztEOO1
 6r+BeBgyomWbY3VJynL0PrjVlyutbKVyNfx+4ghFqi4wq9uc9/5CFaGM+XHGfpoOIoKzW9
 j0nC9APAdqUUecUKrnIa9QEbTb8H+54dYIoudYnmumBz834UveMaF8BL6YTvJTrmAa+wPY
 63ZEu0vLYjjIv7WZO2Ysu2tQp9Lsnd17p2mzaOO+NVHMk+SRBYJRPx2iOrwlFg==
Date: Sat, 6 Jan 2024 15:49:07 +0100
From: Lars-Dominik Braun <lars@HIDDEN>
To: =?iso-8859-1?Q?S=F6ren?= Tempel <soeren@HIDDEN>
Subject: Re: [PATCH] gnu: ghc-9.2: Make Cabal respect GHC_PACKAGE_PATH
Message-ID: <ZZloY0SubqGqVa_O@HIDDEN>
References: <3K6E1L1WLK573.223FCVRGQCGWL@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <3K6E1L1WLK573.223FCVRGQCGWL@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 67896
Cc: 67896 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi,

sorry for the delay, I just tried your patch and it works well combining
a local cabal project and libraries/GHC from Guix. I’d say this is a
massive improvement, so I’d like to ship it with Guix. However this
is a world rebuilding change, so I’ll push it to the haskell-team
branch and probably wait for #67921 to be ready before it can hit master.

One minor issue: If you add a patch file, also add it to gnu/local.mk.

> However, given that Setup.hs also uses
> Distribution.Simple and that there are several places in Guix itself
> where we need to unset GHC_PACKAGE_PATH atm, I personally believe it
> to be preferable to fix the vendored version.

Which locations are you referring to?

Cheers,
Lars





Information forwarded to guix-patches@HIDDEN:
bug#67896; Package guix-patches. Full text available.

Message received at 67896 <at> debbugs.gnu.org:


Received: (at 67896) by debbugs.gnu.org; 6 Jan 2024 09:09:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 06 04:09:44 2024
Received: from localhost ([127.0.0.1]:58550 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rM2ga-0007Lg-Gd
	for submit <at> debbugs.gnu.org; Sat, 06 Jan 2024 04:09:44 -0500
Received: from magnesium.8pit.net ([45.76.88.171]:38893)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <soeren@HIDDEN>) id 1rM2gU-0007LN-JB
 for 67896 <at> debbugs.gnu.org; Sat, 06 Jan 2024 04:09:43 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=opensmtpd; bh=TM8sPw4vuV
 AQ7j90DdsXGzYnm4UAgbHj1pgWo5lB6lk=; h=from:subject:cc:to:date; 
 d=soeren-tempel.net;
 b=dBFeNdVUFBL3iksSMxLYSs1wzFVLgK7LHPYR7HTtFkWcIPd
 KaVPI46iORVBz8M+ZyZL5/uLnlW0KiagL8FQ5vOwrLPJysvefL9IWz6VC3gXIytbOyRMLV
 6V3wrWj72XeN2KgOZm2vNQfCQ/DmO0/i3Kk6QZadExRjoxOpu2Ieqg=
Received: from localhost
 (dynamic-2a02-3102-49da-001b-213d-aee2-0ee6-bb6e.310.pool.telefonica.de
 [2a02:3102:49da:1b:213d:aee2:ee6:bb6e])
 by magnesium.8pit.net (OpenSMTPD) with ESMTPSA id 6d1ef870
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:YES); 
 Sat, 6 Jan 2024 10:09:30 +0100 (CET)
Date: Sat, 06 Jan 2024 10:09:23 +0100
To: 67896 <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu: ghc-9.2: Make Cabal respect GHC_PACKAGE_PATH
From: =?UTF-8?Q?S=C3=B6ren?= Tempel <soeren@HIDDEN>
Message-Id: <3K6E1L1WLK573.223FCVRGQCGWL@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67896
Cc: lars@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

If we don't want to patch the vendored Cabal version shipped by GHC
itself, we could also explore packaging Cabal separately and making
cabal-install depend on that. However, given that Setup.hs also uses
Distribution.Simple and that there are several places in Guix itself
where we need to unset GHC_PACKAGE_PATH atm, I personally believe it
to be preferable to fix the vendored version.

Lars, what do you think?

Greetings
S=C3=B6ren




Information forwarded to guix-patches@HIDDEN:
bug#67896; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 19 Dec 2023 10:07:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 19 05:07:39 2023
Received: from localhost ([127.0.0.1]:34446 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rFX0k-0001x6-Ua
	for submit <at> debbugs.gnu.org; Tue, 19 Dec 2023 05:07:39 -0500
Received: from lists.gnu.org ([2001:470:142::17]:45970)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <soeren@HIDDEN>) id 1rFX0j-0001wX-Dd
 for submit <at> debbugs.gnu.org; Tue, 19 Dec 2023 05:07:38 -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 <soeren@HIDDEN>)
 id 1rFX0a-0004PC-1i
 for guix-patches@HIDDEN; Tue, 19 Dec 2023 05:07:28 -0500
Received: from magnesium.8pit.net ([45.76.88.171])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <soeren@HIDDEN>)
 id 1rFX0W-0000hg-VC; Tue, 19 Dec 2023 05:07:27 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=opensmtpd; bh=PkqmREvHFQ
 7W7gPH+C1ClmUdCFZePLpPMjEwMGOtwI8=; h=date:subject:to:from;
 d=soeren-tempel.net; b=Mv4HT8KGl6v6nF5hpLeu9/DaNH6GmqFBZil8DOTvrvc0wBk
 30KevrKz5UOYlTQt3L5aXaBWRjEAndRtarkQdEr1Fbjvbdh1bSBtORcxAlhKPsm1ncpVqe
 zizFnWQwCd7rO7sEvVO4qXbtLHSbq/XZZ0hQnNU0Rz/oAGQ8L/R62Y=
Received: from localhost
 (dynamic-2a02-3102-49da-001b-34ef-c804-0250-115c.310.pool.telefonica.de
 [2a02:3102:49da:1b:34ef:c804:250:115c])
 by magnesium.8pit.net (OpenSMTPD) with ESMTPSA id 5d9852b0
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:YES); 
 Tue, 19 Dec 2023 11:07:17 +0100 (CET)
From: soeren@HIDDEN
To: guix-patches@HIDDEN
Subject: [PATCH] gnu: ghc-9.2: Make Cabal respect GHC_PACKAGE_PATH
Date: Tue, 19 Dec 2023 11:05:32 +0100
Message-ID: <6fccf7c2e9095cb27cb93644f3bd4a92f4687d13.1702980332.git.soeren@HIDDEN>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Debbugs-Cc: lars@HIDDEN
X-Debbugs-Cc: Lars-Dominik Braun <lars@HIDDEN>
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=45.76.88.171;
 envelope-from=soeren@HIDDEN; helo=magnesium.8pit.net
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

From: Sören Tempel <soeren@HIDDEN>

**tl;dr** Applying this patch makes Cabal work in Guix environments
and ensures that Cabal picks up Haskell packages installed via Guix.

Guix makes heavy use of GHC_PACKAGE_PATH to make GHC pickup Haskell
packages installed via the Guix package manager. The environment
variable is set using native-search-paths from the GHC packages.

Unfortunately, upstream Cabal does presently not respect
GHC_PACKAGE_PATH. If this environment variable is set, `cabal build`
and other commands will terminate. For building packages, Guix does
not make much use of cabal-install hence this is not as big of an
issue. However, cabal-install does therefore presently not work
out-of-the-box in environments created by Guix. For example,
in `guix shell` environments. This makes it essentially impossible
to use Guix for setting up development environments for Haskell software.

Cabal upstream is aware of this issue and a patch exists to workaround
this problem. The patch is currently not merged upstream due to issues
related to reconfiguration (changing GHC_PACKAGE_PATH between `cabal
configure` and `cabal build`). However, I would argue that this edge
case is not that relevant for Guix and therefore propose including
this patch with the Cabal Guix package. As outlined above, cabal-install
is not usable by default presently, and I would therefore argue that
this is a major improvement over the current situation. I am willing to
work with Cabal upstream to have this issue fixed upstream eventually.

Note that this requires patching the GHC package instead of the
cabal-install package as Guix uses the version of the Cabal package
<https://hackage.haskell.org/package/Cabal> distributed with GHC.

See: https://github.com/haskell/cabal/issues/3728

* gnu/packages/haskell-apps.scm (cabal-install): Include patch
to support the GHC_PACKAGE_PATH environment variable.

Signed-off-by: Sören Tempel <soeren@HIDDEN>
---
 gnu/packages/haskell.scm                      |  3 +-
 .../ghc-9.2-cabal-support-package-path.patch  | 67 +++++++++++++++++++
 2 files changed, 69 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/ghc-9.2-cabal-support-package-path.patch

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 62815efbb1..0cd0734d6d 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -1348,7 +1348,8 @@ (define-public ghc-9.2
                 (sha256
                  (base32
                   "07028i0hm74svvq9b3jpkczaj6lsdgn3hgr4wa7diqiq3dypj1h6"))
-                (patches (search-patches "ghc-9.2-glibc-2.33-link-order.patch"))))
+                (patches (search-patches "ghc-9.2-glibc-2.33-link-order.patch"
+                                         "ghc-9.2-cabal-support-package-path.patch"))))
       (arguments
        (substitute-keyword-arguments (package-arguments base)
          ((#:phases phases '%standard-phases)
diff --git a/gnu/packages/patches/ghc-9.2-cabal-support-package-path.patch b/gnu/packages/patches/ghc-9.2-cabal-support-package-path.patch
new file mode 100644
index 0000000000..9e4c405c50
--- /dev/null
+++ b/gnu/packages/patches/ghc-9.2-cabal-support-package-path.patch
@@ -0,0 +1,67 @@
+Without this patch, Cabal terminates if GHC_PACKAGE_PATH is set. This is
+an annoyance with Guix as it makes heavy use of GHC_PACKAGE_PATH to have
+GHC pickup Haskell package installed via Guix. Therefore, Cabal does
+presently not work by default in environments created by Guix. This is
+a workaround which makes Cabal respect GHC_PACKAGE_PATH.
+
+Taken from https://github.com/haskell/cabal/issues/3728
+
+diff -upr a/libraries/Cabal/Cabal/src/Distribution/Simple/GHC.hs b/libraries/Cabal/Cabal/src/Distribution/Simple/GHC.hs
+--- a/libraries/Cabal/Cabal/src/Distribution/Simple/GHC.hs	2022-11-06 20:41:17.000000000 +0100
++++ b/libraries/Cabal/Cabal/src/Distribution/Simple/GHC.hs	2023-12-18 14:34:15.148911717 +0100
+@@ -71,6 +71,7 @@ module Distribution.Simple.GHC (
+  ) where
+ 
+ import Prelude ()
++import Distribution.Compat.Environment (lookupEnv)
+ import Distribution.Compat.Prelude
+ 
+ import qualified Distribution.Simple.GHC.Internal as Internal
+@@ -117,7 +118,7 @@ import System.Directory
+          , canonicalizePath, removeFile, renameFile, getDirectoryContents )
+ import System.FilePath          ( (</>), (<.>), takeExtension
+                                 , takeDirectory, replaceExtension
+-                                ,isRelative )
++                                , isRelative, searchPathSeparator )
+ import qualified System.Info
+ #ifndef mingw32_HOST_OS
+ import System.Posix (createSymbolicLink)
+@@ -333,9 +334,11 @@ getInstalledPackages :: Verbosity -> Com
+                      -> ProgramDb
+                      -> IO InstalledPackageIndex
+ getInstalledPackages verbosity comp packagedbs progdb = do
+-  checkPackageDbEnvVar verbosity
+   checkPackageDbStack verbosity comp packagedbs
+-  pkgss <- getInstalledPackages' verbosity packagedbs progdb
++  envPackageDBs <-
++    maybe [] (map SpecificPackageDB . unintersperse searchPathSeparator)
++      <$> lookupEnv "GHC_PACKAGE_PATH"
++  pkgss <- getInstalledPackages' verbosity (envPackageDBs ++ packagedbs) progdb
+   index <- toPackageIndex verbosity pkgss progdb
+   return $! hackRtsPackage index
+ 
+@@ -405,10 +408,6 @@ getUserPackageDB _verbosity ghcProg plat
+     packageConfFileName = "package.conf.d"
+     ghcVersion = fromMaybe (error "GHC.getUserPackageDB: no ghc version") $ programVersion ghcProg
+ 
+-checkPackageDbEnvVar :: Verbosity -> IO ()
+-checkPackageDbEnvVar verbosity =
+-    Internal.checkPackageDbEnvVar verbosity "GHC" "GHC_PACKAGE_PATH"
+-
+ checkPackageDbStack :: Verbosity -> Compiler -> PackageDBStack -> IO ()
+ checkPackageDbStack verbosity comp =
+     if flagPackageConf implInfo
+@@ -461,8 +460,11 @@ getInstalledPackagesMonitorFiles :: Verb
+                                  -> ProgramDb
+                                  -> [PackageDB]
+                                  -> IO [FilePath]
+-getInstalledPackagesMonitorFiles verbosity platform progdb =
+-    traverse getPackageDBPath
++getInstalledPackagesMonitorFiles verbosity platform progdb packageDBs = do
++    envPackageDBs <-
++      maybe [] (map SpecificPackageDB . unintersperse searchPathSeparator)
++        <$> lookupEnv "GHC_PACKAGE_PATH"
++    traverse getPackageDBPath (envPackageDBs ++ packageDBs)
+   where
+     getPackageDBPath :: PackageDB -> IO FilePath
+     getPackageDBPath GlobalPackageDB =

base-commit: 29c94dd522833b2603a651c14a5b06120bcf1829




Acknowledgement sent to soeren@HIDDEN:
New bug report received and forwarded. Copy sent to lars@HIDDEN, guix-patches@HIDDEN. Full text available.
Report forwarded to lars@HIDDEN, guix-patches@HIDDEN:
bug#67896; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 20 Jan 2024 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.