From unknown Fri Aug 15 15:56:31 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35812] [PATCH] fix hackage cabal tests Resent-From: Robert Vollmert Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 20 May 2019 19:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35812 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35812@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155837923918489 (code B ref -1); Mon, 20 May 2019 19:08:02 +0000 Received: (at submit) by debbugs.gnu.org; 20 May 2019 19:07:19 +0000 Received: from localhost ([127.0.0.1]:37915 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSnd1-0004o9-4I for submit@debbugs.gnu.org; Mon, 20 May 2019 15:07:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42717) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSncx-0004ns-C5 for submit@debbugs.gnu.org; Mon, 20 May 2019 15:07:17 -0400 Received: from lists.gnu.org ([209.51.188.17]:46643) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hSncs-0007sL-2u for submit@debbugs.gnu.org; Mon, 20 May 2019 15:07:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSncq-0000u1-NF for guix-patches@gnu.org; Mon, 20 May 2019 15:07:09 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSncp-0007qq-GT for guix-patches@gnu.org; Mon, 20 May 2019 15:07:08 -0400 Received: from mx2.mailbox.org ([80.241.60.215]:60368) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hSncp-0007o4-6J for guix-patches@gnu.org; Mon, 20 May 2019 15:07:07 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 2D08DA0AE8 for ; Mon, 20 May 2019 21:07:02 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id cME6Axzk8hP8 for ; Mon, 20 May 2019 21:07:00 +0200 (CEST) From: Robert Vollmert Content-Type: multipart/mixed; boundary="Apple-Mail=_CD780271-33D0-4271-91E4-2A9DE05FAD7F" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Message-Id: Date: Mon, 20 May 2019 21:06:59 +0200 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.241.60.215 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) --Apple-Mail=_CD780271-33D0-4271-91E4-2A9DE05FAD7F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hackage cabal tests didn=E2=80=99t run independently due to memoization, and test-cabal-6 was failing. Let me know if anything should be done differently. --Apple-Mail=_CD780271-33D0-4271-91E4-2A9DE05FAD7F Content-Disposition: attachment; filename=0001-tests-fix-cabal-tests-to-test-and-pass.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-tests-fix-cabal-tests-to-test-and-pass.patch" Content-Transfer-Encoding: quoted-printable =46rom=208b6dac85a9f6c4e851c1a75a4958dff7915fb2f1=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Robert=20Vollmert=20=0ADate:=20= Fri,=2017=20May=202019=2010:48:42=20+0200=0ASubject:=20[PATCH]=20tests:=20= fix=20cabal=20tests=20to=20test=20and=20pass=0A=0A*=20= guix/import/hackage.scm:=20export=20unmemoized=20import=20function=0A*=20= tests/hackage.scm:=20use=20unmemoized=20import=20function=20to=20make=20= tests=20independent=0A*=20tests/hackage.scm:=20fix=20failing=20= test-cabal-6=20by=20providing=20expected=20output=0A---=0A=20= guix/import/hackage.scm=20|=2031=20+++++++++++++++++--------------=0A=20= tests/hackage.scm=20=20=20=20=20=20=20|=2039=20= ++++++++++++++++++++++++++++++++++++---=0A=202=20files=20changed,=2053=20= insertions(+),=2017=20deletions(-)=0A=0Adiff=20--git=20= a/guix/import/hackage.scm=20b/guix/import/hackage.scm=0Aindex=20= 2a51420d14..5b80a7ea1d=20100644=0A---=20a/guix/import/hackage.scm=0A+++=20= b/guix/import/hackage.scm=0A@@=20-40,6=20+40,7=20@@=0A=20=20=20= #:use-module=20(guix=20packages)=0A=20=20=20#:use-module=20((guix=20= utils)=20#:select=20(call-with-temporary-output-file))=0A=20=20=20= #:export=20(hackage->guix-package=0A+=20=20=20=20=20=20=20=20=20=20=20=20= hackage->guix-package-impl=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= hackage-recursive-import=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= %hackage-updater=0A=20=0A@@=20-277,13=20+278,12=20@@=20representation=20= of=20a=20Cabal=20file=20as=20produced=20by=20'read-cabal'."=0A=20=20=20=20= =20=20=20=20=20(license=20,(string->license=20(cabal-package-license=20= cabal))))=0A=20=20=20=20=20=20(append=20hackage-dependencies=20= hackage-native-dependencies))))=0A=20=0A-(define=20hackage->guix-package=0A= -=20=20(memoize=0A-=20=20=20(lambda*=20(package-name=20#:key=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (include-test-dependencies?=20#t)=0A-=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(port=20#f)=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (cabal-environment=20'()))=0A-=20=20=20=20=20"Fetch=20the=20Cabal=20file=20= for=20PACKAGE-NAME=20from=20hackage.haskell.org,=20or,=20if=20the=0A= +(define=20hackage->guix-package-impl=0A+=20=20(lambda*=20(package-name=20= #:key=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(include-test-dependencies?=20#t)=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(port=20#f)=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (cabal-environment=20'()))=0A+=20=20=20"Fetch=20the=20Cabal=20file=20for=20= PACKAGE-NAME=20from=20hackage.haskell.org,=20or,=20if=20the=0A=20called=20= with=20keyword=20parameter=20PORT,=20from=20PORT.=20=20Return=20the=20= `package'=0A=20S-expression=20corresponding=20to=20that=20package,=20or=20= #f=20on=20failure.=0A=20CABAL-ENVIRONMENT=20is=20an=20alist=20defining=20= the=20environment=20in=20which=20the=20Cabal=0A@@=20-293,13=20+293,16=20= @@=20symbol=20'true'=20or=20'false'.=20=20The=20value=20associated=20= with=20other=20keys=20has=20to=20conform=0A=20to=20the=20Cabal=20file=20= format=20definition.=20=20The=20default=20value=20associated=20with=20= the=0A=20keys=20\"os\",=20\"arch\"=20and=20\"impl\"=20is=20\"linux\",=20= \"x86_64\"=20and=20\"ghc\"=0A=20respectively."=0A-=20=20=20=20=20(let=20= ((cabal-meta=20(if=20port=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(read-cabal=20= (canonical-newline-port=20port))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(hackage-fetch=20= package-name))))=0A-=20=20=20=20=20=20=20(and=3D>=20cabal-meta=20= (compose=20(cut=20hackage-module->sexp=20<>=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20#:include-test-dependencies?=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20include-test-dependencies?)=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (cut=20eval-cabal=20<>=20cabal-environment)))))))=0A+=20=20=20(let=20= ((cabal-meta=20(if=20port=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(read-cabal=20(canonical-newline-port=20= port))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(hackage-fetch=20package-name))))=0A+=20=20=20=20=20(and=3D>=20= cabal-meta=20(compose=20(cut=20hackage-module->sexp=20<>=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20#:include-test-dependencies?=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20include-test-dependencies?)=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (cut=20eval-cabal=20<>=20cabal-environment))))))=0A+=0A+(define=20= hackage->guix-package=0A+=20=20(memoize=20hackage->guix-package-impl))=0A= =20=0A=20(define*=20(hackage-recursive-import=20package-name=20.=20args)=0A= =20=20=20(recursive-import=20package-name=20#f=0Adiff=20--git=20= a/tests/hackage.scm=20b/tests/hackage.scm=0Aindex=20= e17851a213..e56aa996d6=20100644=0A---=20a/tests/hackage.scm=0A+++=20= b/tests/hackage.scm=0A@@=20-161,7=20+161,7=20@@=20library=0A=20=20=20=20=20= (lambda=20(name-version)=0A=20=20=20=20=20=20=20(call-with-input-string=20= test-cabal=0A=20=20=20=20=20=20=20=20=20read-cabal)))=0A-=20=20=20(match=20= (hackage->guix-package=20"foo"=20#:cabal-environment=20= cabal-environment)=0A+=20=20=20(match=20(hackage->guix-package-impl=20= "foo"=20#:cabal-environment=20cabal-environment)=0A=20=20=20=20=20=20= (('package=0A=20=20=20=20=20=20=20=20=20('name=20"ghc-foo")=0A=20=20=20=20= =20=20=20=20=20('version=20"1.0.0")=0A@@=20-207,8=20+207,41=20@@=20= library=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20#:cabal-environment=20'(("impl"=20.=20"ghc-7.8"))))=0A=20=0A=20= (test-assert=20"hackage->guix-package=20test=206"=0A-=20=20= (eval-test-with-cabal=20test-cabal-6=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20#:cabal-environment=20'(("impl"=20= .=20"ghc-7.8"))))=0A+=20=20(mock=0A+=20=20=20((guix=20import=20hackage)=20= hackage-fetch=0A+=20=20=20=20(lambda=20(name-version)=0A+=20=20=20=20=20=20= (call-with-input-string=20test-cabal-6=0A+=20=20=20=20=20=20=20=20= read-cabal)))=0A+=20=20=20(match=20(hackage->guix-package-impl=20"foo")=0A= +=20=20=20=20=20(('package=0A+=20=20=20=20=20=20=20=20('name=20= "ghc-foo")=0A+=20=20=20=20=20=20=20=20('version=20"1.0.0")=0A+=20=20=20=20= =20=20=20=20('source=0A+=20=20=20=20=20=20=20=20=20('origin=0A+=20=20=20=20= =20=20=20=20=20=20=20('method=20'url-fetch)=0A+=20=20=20=20=20=20=20=20=20= =20=20('uri=20('string-append=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20"https://hackage.haskell.org/package/foo/foo-"=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20'version=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20".tar.gz"))=0A+=20=20=20=20=20=20=20=20=20= =20=20('sha256=0A+=20=20=20=20=20=20=20=20=20=20=20=20('base32=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20(?=20string?=20hash)))))=0A+=20=20=20=20=20= =20=20=20('build-system=20'haskell-build-system)=0A+=20=20=20=20=20=20=20= =20('inputs=0A+=20=20=20=20=20=20=20=20=20('quasiquote=0A+=20=20=20=20=20= =20=20=20=20=20(("ghc-b"=20('unquote=20'ghc-b))=0A+=20=20=20=20=20=20=20=20= =20=20=20("ghc-http"=20('unquote=20'ghc-http))=0A+=20=20=20=20=20=20=20=20= =20=20=20("ghc-mtl"=20('unquote=20'ghc-mtl)))))=0A+=20=20=20=20=20=20=20=20= ('native-inputs=0A+=20=20=20=20=20=20=20=20=20('quasiquote=0A+=20=20=20=20= =20=20=20=20=20=20(("ghc-haskell-gi"=20('unquote=20'ghc-haskell-gi)))))=0A= +=20=20=20=20=20=20=20=20('home-page=20"http://test.org")=0A+=20=20=20=20= =20=20=20=20('synopsis=20(?=20string?))=0A+=20=20=20=20=20=20=20=20= ('description=20(?=20string?))=0A+=20=20=20=20=20=20=20=20('license=20= 'bsd-3))=0A+=20=20=20=20=20=20#t)=0A+=20=20=20=20=20(x=0A+=20=20=20=20=20= =20(pk=20'fail=20x=20#f)))))=0A=20=0A=20(test-assert=20"read-cabal=20= test=201"=0A=20=20=20(match=20(call-with-input-string=20= test-read-cabal-1=20read-cabal)=0A--=20=0A2.21.0=0A=0A= --Apple-Mail=_CD780271-33D0-4271-91E4-2A9DE05FAD7F-- From unknown Fri Aug 15 15:56:31 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35812] [PATCH] fix hackage cabal tests Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 May 2019 14:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35812 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Robert Vollmert Cc: 35812@debbugs.gnu.org Received: via spool by 35812-submit@debbugs.gnu.org id=B35812.155845012722656 (code B ref 35812); Tue, 21 May 2019 14:49:02 +0000 Received: (at 35812) by debbugs.gnu.org; 21 May 2019 14:48:47 +0000 Received: from localhost ([127.0.0.1]:40539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hT64M-0005tL-Ir for submit@debbugs.gnu.org; Tue, 21 May 2019 10:48:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hT64K-0005t8-4Q for 35812@debbugs.gnu.org; Tue, 21 May 2019 10:48:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT64D-0004Xq-U6; Tue, 21 May 2019 10:48:37 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=40380 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hT64C-0005Xn-4B; Tue, 21 May 2019 10:48:37 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: Date: Tue, 21 May 2019 16:48:34 +0200 In-Reply-To: (Robert Vollmert's message of "Mon, 20 May 2019 21:06:59 +0200") Message-ID: <874l5n2799.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello Robert, Robert Vollmert skribis: > Hackage cabal tests didn=E2=80=99t run independently due to memoization, > and test-cabal-6 was failing. I don=E2=80=99t think memoization can get in the way here: the argument lis= t is used as a key in the memoization hash table. Thus, if you pass different arguments, you get a cache miss and call the underlying procedure. Or am I missing something? > From 8b6dac85a9f6c4e851c1a75a4958dff7915fb2f1 Mon Sep 17 00:00:00 2001 > From: Robert Vollmert > Date: Fri, 17 May 2019 10:48:42 +0200 > Subject: [PATCH] tests: fix cabal tests to test and pass > > * guix/import/hackage.scm: export unmemoized import function > * tests/hackage.scm: use unmemoized import function to make tests indepen= dent > * tests/hackage.scm: fix failing test-cabal-6 by providing expected output [...] > (test-assert "hackage->guix-package test 6" > - (eval-test-with-cabal test-cabal-6 > - #:cabal-environment '(("impl" . "ghc-7.8")))) > + (mock > + ((guix import hackage) hackage-fetch > + (lambda (name-version) > + (call-with-input-string test-cabal-6 > + read-cabal))) > + (match (hackage->guix-package-impl "foo") > + (('package > + ('name "ghc-foo") > + ('version "1.0.0") > + ('source > + ('origin > + ('method 'url-fetch) > + ('uri ('string-append > + "https://hackage.haskell.org/package/foo/foo-" > + 'version > + ".tar.gz")) > + ('sha256 > + ('base32 > + (? string? hash))))) > + ('build-system 'haskell-build-system) > + ('inputs > + ('quasiquote > + (("ghc-b" ('unquote 'ghc-b)) > + ("ghc-http" ('unquote 'ghc-http)) > + ("ghc-mtl" ('unquote 'ghc-mtl))))) > + ('native-inputs > + ('quasiquote > + (("ghc-haskell-gi" ('unquote 'ghc-haskell-gi))))) > + ('home-page "http://test.org") > + ('synopsis (? string?)) > + ('description (? string?)) > + ('license 'bsd-3)) > + #t) > + (x > + (pk 'fail x #f))))) So this test needed to be changed as a result of turning off memoization? Thanks, Ludo=E2=80=99. From unknown Fri Aug 15 15:56:31 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#35812] [PATCH] fix hackage cabal tests Resent-From: Robert Vollmert Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 May 2019 15:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35812 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 35812@debbugs.gnu.org Received: via spool by 35812-submit@debbugs.gnu.org id=B35812.155845146724896 (code B ref 35812); Tue, 21 May 2019 15:12:01 +0000 Received: (at 35812) by debbugs.gnu.org; 21 May 2019 15:11:07 +0000 Received: from localhost ([127.0.0.1]:40578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hT6Pz-0006TT-8O for submit@debbugs.gnu.org; Tue, 21 May 2019 11:11:07 -0400 Received: from mx2.mailbox.org ([80.241.60.215]:10282) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hT6Px-0006Sf-Ll for 35812@debbugs.gnu.org; Tue, 21 May 2019 11:11:06 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 46742A16F3; Tue, 21 May 2019 17:10:57 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id nl3arTPMove9; Tue, 21 May 2019 17:10:53 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) From: Robert Vollmert In-Reply-To: <874l5n2799.fsf@gnu.org> Date: Tue, 21 May 2019 17:10:51 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <616C2CBF-8171-401C-9515-5679A5E01823@vllmrt.net> References: <874l5n2799.fsf@gnu.org> X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Ludo=E2=80=99, > On 21. May 2019, at 16:48, Ludovic Court=C3=A8s wrote: > Robert Vollmert skribis: >=20 >> Hackage cabal tests didn=E2=80=99t run independently due to = memoization, >> and test-cabal-6 was failing. >=20 > I don=E2=80=99t think memoization can get in the way here: the = argument list is > used as a key in the memoization hash table. Thus, if you pass > different arguments, you get a cache miss and call the underlying > procedure. >=20 > Or am I missing something? I agree that memoization of a pure function shouldn=E2=80=99t have such = effects, but my (limited) understanding is that hackage->guix-packages would cache import results by package name on the assumption that cabal files for the same package name don=E2=80=99t change between calls. That observation is consistent with the test behaviour, but I may well be missing something. >> =46rom 8b6dac85a9f6c4e851c1a75a4958dff7915fb2f1 Mon Sep 17 00:00:00 = 2001 >> From: Robert Vollmert >> Date: Fri, 17 May 2019 10:48:42 +0200 >> Subject: [PATCH] tests: fix cabal tests to test and pass >>=20 >> * guix/import/hackage.scm: export unmemoized import function >> * tests/hackage.scm: use unmemoized import function to make tests = independent >> * tests/hackage.scm: fix failing test-cabal-6 by providing expected = output >=20 > [...] >=20 >> (test-assert "hackage->guix-package test 6" >> - (eval-test-with-cabal test-cabal-6 >> - #:cabal-environment '(("impl" . = "ghc-7.8")))) >> + (mock >> + ((guix import hackage) hackage-fetch >> + (lambda (name-version) >> + (call-with-input-string test-cabal-6 >> + read-cabal))) >> + (match (hackage->guix-package-impl "foo") >> + (('package >> + ('name "ghc-foo") >> + ('version "1.0.0") >> + ('source >> + ('origin >> + ('method 'url-fetch) >> + ('uri ('string-append >> + "https://hackage.haskell.org/package/foo/foo-" >> + 'version >> + ".tar.gz")) >> + ('sha256 >> + ('base32 >> + (? string? hash))))) >> + ('build-system 'haskell-build-system) >> + ('inputs >> + ('quasiquote >> + (("ghc-b" ('unquote 'ghc-b)) >> + ("ghc-http" ('unquote 'ghc-http)) >> + ("ghc-mtl" ('unquote 'ghc-mtl))))) >> + ('native-inputs >> + ('quasiquote >> + (("ghc-haskell-gi" ('unquote 'ghc-haskell-gi))))) >> + ('home-page "http://test.org") >> + ('synopsis (? string?)) >> + ('description (? string?)) >> + ('license 'bsd-3)) >> + #t) >> + (x >> + (pk 'fail x #f))))) >=20 > So this test needed to be changed as a result of turning off > memoization? Precisely. The other tests all expect various cabal fragments to yield the same package definition, while the extra fragment custom-setup setup-depends: base >=3D 4.7 && < 5, Cabal >=3D 1.24, haskell-gi =3D=3D 0.21.* in test-cabal-6 causes the extra native input ghc-haskell-gi. As I understand it, this test failure used to be shadowed because hackage->guix-packages would just return the successful parse of the test-cabal-1. (There=E2=80=99s probably some more elegant way to avoid duplicating the whole package definition, but I generally prefer a bit of explicit verbosity in test data.) Cheers Rob From debbugs-submit-bounces@debbugs.gnu.org Thu May 23 09:36:25 2019 Received: (at control) by debbugs.gnu.org; 23 May 2019 13:36:25 +0000 Received: from localhost ([127.0.0.1]:44109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTntR-00020G-94 for submit@debbugs.gnu.org; Thu, 23 May 2019 09:36:25 -0400 Received: from mx2.mailbox.org ([80.241.60.215]:29528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTntQ-000203-Ep for control@debbugs.gnu.org; Thu, 23 May 2019 09:36:24 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 3F11BA1060 for ; Thu, 23 May 2019 15:36:18 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id V6371pXpriYb for ; Thu, 23 May 2019 15:36:02 +0200 (CEST) From: Robert Vollmert Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: merge guix hackage patch sets Message-Id: <6D3F6DA7-0356-4E60-92F0-EABAA280A340@vllmrt.net> Date: Thu, 23 May 2019 15:36:01 +0200 To: control@debbugs.gnu.org X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) merge 35812 35846 35859 thanks From unknown Fri Aug 15 15:56:31 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Robert Vollmert Subject: bug#35812: closed (Re: [bug#35812] [PATCH] fix hackage cabal tests) Message-ID: References: <87r28kkj00.fsf@gnu.org> X-Gnu-PR-Message: they-closed 35812 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 35812@debbugs.gnu.org Date: Sun, 26 May 2019 21:24:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1558905842-22425-1" This is a multi-part message in MIME format... ------------=_1558905842-22425-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #35812: [PATCH] fix hackage cabal tests which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 35812@debbugs.gnu.org. --=20 35812: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D35812 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1558905842-22425-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 35812-done) by debbugs.gnu.org; 26 May 2019 21:23:40 +0000 Received: from localhost ([127.0.0.1]:51950 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hV0cG-0005p7-3U for submit@debbugs.gnu.org; Sun, 26 May 2019 17:23:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hV0cC-0005os-NH for 35812-done@debbugs.gnu.org; Sun, 26 May 2019 17:23:38 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52716) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hV0c6-0007mu-Ea; Sun, 26 May 2019 17:23:30 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=49896 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hV0c5-0005pt-QX; Sun, 26 May 2019 17:23:30 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Robert Vollmert Subject: Re: [bug#35812] [PATCH] fix hackage cabal tests References: <874l5n2799.fsf@gnu.org> <616C2CBF-8171-401C-9515-5679A5E01823@vllmrt.net> Date: Sun, 26 May 2019 23:23:27 +0200 In-Reply-To: <616C2CBF-8171-401C-9515-5679A5E01823@vllmrt.net> (Robert Vollmert's message of "Tue, 21 May 2019 17:10:51 +0200") Message-ID: <87r28kkj00.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 35812-done Cc: 35812-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Robert Vollmert skribis: >> On 21. May 2019, at 16:48, Ludovic Court=C3=A8s wrote: >> Robert Vollmert skribis: >>=20 >>> Hackage cabal tests didn=E2=80=99t run independently due to memoization, >>> and test-cabal-6 was failing. >>=20 >> I don=E2=80=99t think memoization can get in the way here: the argument = list is >> used as a key in the memoization hash table. Thus, if you pass >> different arguments, you get a cache miss and call the underlying >> procedure. >>=20 >> Or am I missing something? > > I agree that memoization of a pure function shouldn=E2=80=99t have such e= ffects, > but my (limited) understanding is that hackage->guix-packages would > cache import results by package name on the assumption that cabal > files for the same package name don=E2=80=99t change between calls. Oh, got it. I pushed a variant of the patch as commit ad7466aafd7f166d0b6be5eb32dda1d3ee8a6445. Thanks! Ludo=E2=80=99. ------------=_1558905842-22425-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 20 May 2019 19:07:19 +0000 Received: from localhost ([127.0.0.1]:37915 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSnd1-0004o9-4I for submit@debbugs.gnu.org; Mon, 20 May 2019 15:07:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42717) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSncx-0004ns-C5 for submit@debbugs.gnu.org; Mon, 20 May 2019 15:07:17 -0400 Received: from lists.gnu.org ([209.51.188.17]:46643) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hSncs-0007sL-2u for submit@debbugs.gnu.org; Mon, 20 May 2019 15:07:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSncq-0000u1-NF for guix-patches@gnu.org; Mon, 20 May 2019 15:07:09 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSncp-0007qq-GT for guix-patches@gnu.org; Mon, 20 May 2019 15:07:08 -0400 Received: from mx2.mailbox.org ([80.241.60.215]:60368) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hSncp-0007o4-6J for guix-patches@gnu.org; Mon, 20 May 2019 15:07:07 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 2D08DA0AE8 for ; Mon, 20 May 2019 21:07:02 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id cME6Axzk8hP8 for ; Mon, 20 May 2019 21:07:00 +0200 (CEST) From: Robert Vollmert Content-Type: multipart/mixed; boundary="Apple-Mail=_CD780271-33D0-4271-91E4-2A9DE05FAD7F" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: [PATCH] fix hackage cabal tests Message-Id: Date: Mon, 20 May 2019 21:06:59 +0200 To: guix-patches@gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.241.60.215 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) --Apple-Mail=_CD780271-33D0-4271-91E4-2A9DE05FAD7F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hackage cabal tests didn=E2=80=99t run independently due to memoization, and test-cabal-6 was failing. Let me know if anything should be done differently. --Apple-Mail=_CD780271-33D0-4271-91E4-2A9DE05FAD7F Content-Disposition: attachment; filename=0001-tests-fix-cabal-tests-to-test-and-pass.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-tests-fix-cabal-tests-to-test-and-pass.patch" Content-Transfer-Encoding: quoted-printable =46rom=208b6dac85a9f6c4e851c1a75a4958dff7915fb2f1=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Robert=20Vollmert=20=0ADate:=20= Fri,=2017=20May=202019=2010:48:42=20+0200=0ASubject:=20[PATCH]=20tests:=20= fix=20cabal=20tests=20to=20test=20and=20pass=0A=0A*=20= guix/import/hackage.scm:=20export=20unmemoized=20import=20function=0A*=20= tests/hackage.scm:=20use=20unmemoized=20import=20function=20to=20make=20= tests=20independent=0A*=20tests/hackage.scm:=20fix=20failing=20= test-cabal-6=20by=20providing=20expected=20output=0A---=0A=20= guix/import/hackage.scm=20|=2031=20+++++++++++++++++--------------=0A=20= tests/hackage.scm=20=20=20=20=20=20=20|=2039=20= ++++++++++++++++++++++++++++++++++++---=0A=202=20files=20changed,=2053=20= insertions(+),=2017=20deletions(-)=0A=0Adiff=20--git=20= a/guix/import/hackage.scm=20b/guix/import/hackage.scm=0Aindex=20= 2a51420d14..5b80a7ea1d=20100644=0A---=20a/guix/import/hackage.scm=0A+++=20= b/guix/import/hackage.scm=0A@@=20-40,6=20+40,7=20@@=0A=20=20=20= #:use-module=20(guix=20packages)=0A=20=20=20#:use-module=20((guix=20= utils)=20#:select=20(call-with-temporary-output-file))=0A=20=20=20= #:export=20(hackage->guix-package=0A+=20=20=20=20=20=20=20=20=20=20=20=20= hackage->guix-package-impl=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= hackage-recursive-import=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= %hackage-updater=0A=20=0A@@=20-277,13=20+278,12=20@@=20representation=20= of=20a=20Cabal=20file=20as=20produced=20by=20'read-cabal'."=0A=20=20=20=20= =20=20=20=20=20(license=20,(string->license=20(cabal-package-license=20= cabal))))=0A=20=20=20=20=20=20(append=20hackage-dependencies=20= hackage-native-dependencies))))=0A=20=0A-(define=20hackage->guix-package=0A= -=20=20(memoize=0A-=20=20=20(lambda*=20(package-name=20#:key=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (include-test-dependencies?=20#t)=0A-=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(port=20#f)=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (cabal-environment=20'()))=0A-=20=20=20=20=20"Fetch=20the=20Cabal=20file=20= for=20PACKAGE-NAME=20from=20hackage.haskell.org,=20or,=20if=20the=0A= +(define=20hackage->guix-package-impl=0A+=20=20(lambda*=20(package-name=20= #:key=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(include-test-dependencies?=20#t)=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(port=20#f)=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (cabal-environment=20'()))=0A+=20=20=20"Fetch=20the=20Cabal=20file=20for=20= PACKAGE-NAME=20from=20hackage.haskell.org,=20or,=20if=20the=0A=20called=20= with=20keyword=20parameter=20PORT,=20from=20PORT.=20=20Return=20the=20= `package'=0A=20S-expression=20corresponding=20to=20that=20package,=20or=20= #f=20on=20failure.=0A=20CABAL-ENVIRONMENT=20is=20an=20alist=20defining=20= the=20environment=20in=20which=20the=20Cabal=0A@@=20-293,13=20+293,16=20= @@=20symbol=20'true'=20or=20'false'.=20=20The=20value=20associated=20= with=20other=20keys=20has=20to=20conform=0A=20to=20the=20Cabal=20file=20= format=20definition.=20=20The=20default=20value=20associated=20with=20= the=0A=20keys=20\"os\",=20\"arch\"=20and=20\"impl\"=20is=20\"linux\",=20= \"x86_64\"=20and=20\"ghc\"=0A=20respectively."=0A-=20=20=20=20=20(let=20= ((cabal-meta=20(if=20port=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(read-cabal=20= (canonical-newline-port=20port))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(hackage-fetch=20= package-name))))=0A-=20=20=20=20=20=20=20(and=3D>=20cabal-meta=20= (compose=20(cut=20hackage-module->sexp=20<>=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20#:include-test-dependencies?=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20include-test-dependencies?)=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (cut=20eval-cabal=20<>=20cabal-environment)))))))=0A+=20=20=20(let=20= ((cabal-meta=20(if=20port=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(read-cabal=20(canonical-newline-port=20= port))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(hackage-fetch=20package-name))))=0A+=20=20=20=20=20(and=3D>=20= cabal-meta=20(compose=20(cut=20hackage-module->sexp=20<>=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20#:include-test-dependencies?=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20include-test-dependencies?)=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (cut=20eval-cabal=20<>=20cabal-environment))))))=0A+=0A+(define=20= hackage->guix-package=0A+=20=20(memoize=20hackage->guix-package-impl))=0A= =20=0A=20(define*=20(hackage-recursive-import=20package-name=20.=20args)=0A= =20=20=20(recursive-import=20package-name=20#f=0Adiff=20--git=20= a/tests/hackage.scm=20b/tests/hackage.scm=0Aindex=20= e17851a213..e56aa996d6=20100644=0A---=20a/tests/hackage.scm=0A+++=20= b/tests/hackage.scm=0A@@=20-161,7=20+161,7=20@@=20library=0A=20=20=20=20=20= (lambda=20(name-version)=0A=20=20=20=20=20=20=20(call-with-input-string=20= test-cabal=0A=20=20=20=20=20=20=20=20=20read-cabal)))=0A-=20=20=20(match=20= (hackage->guix-package=20"foo"=20#:cabal-environment=20= cabal-environment)=0A+=20=20=20(match=20(hackage->guix-package-impl=20= "foo"=20#:cabal-environment=20cabal-environment)=0A=20=20=20=20=20=20= (('package=0A=20=20=20=20=20=20=20=20=20('name=20"ghc-foo")=0A=20=20=20=20= =20=20=20=20=20('version=20"1.0.0")=0A@@=20-207,8=20+207,41=20@@=20= library=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20#:cabal-environment=20'(("impl"=20.=20"ghc-7.8"))))=0A=20=0A=20= (test-assert=20"hackage->guix-package=20test=206"=0A-=20=20= (eval-test-with-cabal=20test-cabal-6=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20#:cabal-environment=20'(("impl"=20= .=20"ghc-7.8"))))=0A+=20=20(mock=0A+=20=20=20((guix=20import=20hackage)=20= hackage-fetch=0A+=20=20=20=20(lambda=20(name-version)=0A+=20=20=20=20=20=20= (call-with-input-string=20test-cabal-6=0A+=20=20=20=20=20=20=20=20= read-cabal)))=0A+=20=20=20(match=20(hackage->guix-package-impl=20"foo")=0A= +=20=20=20=20=20(('package=0A+=20=20=20=20=20=20=20=20('name=20= "ghc-foo")=0A+=20=20=20=20=20=20=20=20('version=20"1.0.0")=0A+=20=20=20=20= =20=20=20=20('source=0A+=20=20=20=20=20=20=20=20=20('origin=0A+=20=20=20=20= =20=20=20=20=20=20=20('method=20'url-fetch)=0A+=20=20=20=20=20=20=20=20=20= =20=20('uri=20('string-append=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20"https://hackage.haskell.org/package/foo/foo-"=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20'version=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20".tar.gz"))=0A+=20=20=20=20=20=20=20=20=20= =20=20('sha256=0A+=20=20=20=20=20=20=20=20=20=20=20=20('base32=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20(?=20string?=20hash)))))=0A+=20=20=20=20=20= =20=20=20('build-system=20'haskell-build-system)=0A+=20=20=20=20=20=20=20= =20('inputs=0A+=20=20=20=20=20=20=20=20=20('quasiquote=0A+=20=20=20=20=20= =20=20=20=20=20(("ghc-b"=20('unquote=20'ghc-b))=0A+=20=20=20=20=20=20=20=20= =20=20=20("ghc-http"=20('unquote=20'ghc-http))=0A+=20=20=20=20=20=20=20=20= =20=20=20("ghc-mtl"=20('unquote=20'ghc-mtl)))))=0A+=20=20=20=20=20=20=20=20= ('native-inputs=0A+=20=20=20=20=20=20=20=20=20('quasiquote=0A+=20=20=20=20= =20=20=20=20=20=20(("ghc-haskell-gi"=20('unquote=20'ghc-haskell-gi)))))=0A= +=20=20=20=20=20=20=20=20('home-page=20"http://test.org")=0A+=20=20=20=20= =20=20=20=20('synopsis=20(?=20string?))=0A+=20=20=20=20=20=20=20=20= ('description=20(?=20string?))=0A+=20=20=20=20=20=20=20=20('license=20= 'bsd-3))=0A+=20=20=20=20=20=20#t)=0A+=20=20=20=20=20(x=0A+=20=20=20=20=20= =20(pk=20'fail=20x=20#f)))))=0A=20=0A=20(test-assert=20"read-cabal=20= test=201"=0A=20=20=20(match=20(call-with-input-string=20= test-read-cabal-1=20read-cabal)=0A--=20=0A2.21.0=0A=0A= --Apple-Mail=_CD780271-33D0-4271-91E4-2A9DE05FAD7F-- ------------=_1558905842-22425-1-- From unknown Fri Aug 15 15:56:31 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Robert Vollmert Subject: bug#35846: closed (Re: [bug#35812] [PATCH] fix hackage cabal tests) Message-ID: References: <87r28kkj00.fsf@gnu.org> X-Gnu-PR-Message: they-closed 35846 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 35846@debbugs.gnu.org Date: Sun, 26 May 2019 21:24:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1558905842-22425-3" This is a multi-part message in MIME format... ------------=_1558905842-22425-3 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #35812: [PATCH] guix/import/cabal: handle braced descriptions (fixes #35735) which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 35846@debbugs.gnu.org. --=20 35812: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D35812 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1558905842-22425-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 35812-done) by debbugs.gnu.org; 26 May 2019 21:23:40 +0000 Received: from localhost ([127.0.0.1]:51950 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hV0cG-0005p7-3U for submit@debbugs.gnu.org; Sun, 26 May 2019 17:23:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hV0cC-0005os-NH for 35812-done@debbugs.gnu.org; Sun, 26 May 2019 17:23:38 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52716) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hV0c6-0007mu-Ea; Sun, 26 May 2019 17:23:30 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=49896 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hV0c5-0005pt-QX; Sun, 26 May 2019 17:23:30 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Robert Vollmert Subject: Re: [bug#35812] [PATCH] fix hackage cabal tests References: <874l5n2799.fsf@gnu.org> <616C2CBF-8171-401C-9515-5679A5E01823@vllmrt.net> Date: Sun, 26 May 2019 23:23:27 +0200 In-Reply-To: <616C2CBF-8171-401C-9515-5679A5E01823@vllmrt.net> (Robert Vollmert's message of "Tue, 21 May 2019 17:10:51 +0200") Message-ID: <87r28kkj00.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 35812-done Cc: 35812-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Robert Vollmert skribis: >> On 21. May 2019, at 16:48, Ludovic Court=C3=A8s wrote: >> Robert Vollmert skribis: >>=20 >>> Hackage cabal tests didn=E2=80=99t run independently due to memoization, >>> and test-cabal-6 was failing. >>=20 >> I don=E2=80=99t think memoization can get in the way here: the argument = list is >> used as a key in the memoization hash table. Thus, if you pass >> different arguments, you get a cache miss and call the underlying >> procedure. >>=20 >> Or am I missing something? > > I agree that memoization of a pure function shouldn=E2=80=99t have such e= ffects, > but my (limited) understanding is that hackage->guix-packages would > cache import results by package name on the assumption that cabal > files for the same package name don=E2=80=99t change between calls. Oh, got it. I pushed a variant of the patch as commit ad7466aafd7f166d0b6be5eb32dda1d3ee8a6445. Thanks! Ludo=E2=80=99. ------------=_1558905842-22425-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 21 May 2019 14:02:42 +0000 Received: from localhost ([127.0.0.1]:40437 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hT5Ll-0004dZ-T1 for submit@debbugs.gnu.org; Tue, 21 May 2019 10:02:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hT5Lg-0004dC-4B for submit@debbugs.gnu.org; Tue, 21 May 2019 10:02:37 -0400 Received: from lists.gnu.org ([209.51.188.17]:58527) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hT5La-0003Hi-VP for submit@debbugs.gnu.org; Tue, 21 May 2019 10:02:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT5LV-0007e8-Ma for guix-patches@gnu.org; Tue, 21 May 2019 10:02:30 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hT5LP-00039C-SU for guix-patches@gnu.org; Tue, 21 May 2019 10:02:21 -0400 Received: from mx1.mailbox.org ([80.241.60.212]:8232) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hT5LJ-00031l-MT for guix-patches@gnu.org; Tue, 21 May 2019 10:02:15 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id CAE805024A for ; Tue, 21 May 2019 15:55:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id sui-IL57mUN9 for ; Tue, 21 May 2019 15:55:04 +0200 (CEST) From: Robert Vollmert Content-Type: multipart/mixed; boundary="Apple-Mail=_B5C39A47-9915-4AA5-A9C8-20F6047DF3F8" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: [PATCH] guix/import/cabal: handle braced descriptions (fixes #35735) Message-Id: Date: Tue, 21 May 2019 15:55:03 +0200 To: guix-patches@gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.241.60.212 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) --Apple-Mail=_B5C39A47-9915-4AA5-A9C8-20F6047DF3F8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 This fixes the cabal importer to deal with braced instead of layouted properties. This is based on the current approach of lexing a whole property as a token; it feels not ideal, but I=E2=80=99m not fluent = enough in guile (or the cabal format) to do better. Compare https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D35735 --Apple-Mail=_B5C39A47-9915-4AA5-A9C8-20F6047DF3F8 Content-Disposition: attachment; filename=0001-guix-import-cabal-parse-braced-description-propertie.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-guix-import-cabal-parse-braced-description-propertie.patch" Content-Transfer-Encoding: quoted-printable =46rom=20801181aab72d9a373de7658f3b201c5735708849=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Robert=20Vollmert=20=0ADate:=20= Fri,=2017=20May=202019=2014:26:36=20+0200=0ASubject:=20[PATCH]=20guix:=20= import:=20cabal:=20parse=20braced=20description=20properties=0A=0A*=20= guix/import/cabal.scm:=20generalize=20property=20bracing=20to=20both=0A=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= layouted=20and=20simple=20braced=20blocks=0A*=20guix/tests/hackage.scm:=20= test=20braced=20description=20import=0A---=0A=20guix/import/cabal.scm=20= |=2037=20++++++++++++++++++++++++++++++-------=0A=20tests/hackage.scm=20=20= =20=20=20|=2020=20++++++++++++++++++++=0A=202=20files=20changed,=2050=20= insertions(+),=207=20deletions(-)=0A=0Adiff=20--git=20= a/guix/import/cabal.scm=20b/guix/import/cabal.scm=0Aindex=20= 13c2f3f48c..383702f2be=20100644=0A---=20a/guix/import/cabal.scm=0A+++=20= b/guix/import/cabal.scm=0A@@=20-270,6=20+270,12=20@@=20following=20lines=20= with=20indentation=20larger=20than=20MIN-INDENT."=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(peek-next-line-indent=20port)))=0A=20=20=20= =20=20=20=20=20=20val)))=0A=20=0A+(define*=20(read-braced-value=20port)=0A= +=20=20"Read=20up=20to=20a=20closing=20brace."=0A+=20=20(begin=0A+=20=20=20= =20=20(display=20"reading=20braced=20value\n")=0A+=20=20=20=20=20= (string-trim-both=20(read-delimited=20"}"=20port=20'trim))))=0A+=0A=20= (define=20(lex-white-space=20port=20bol)=0A=20=20=20"Consume=20white=20= spaces=20and=20comment=20lines=20on=20PORT.=20=20If=20a=20new=20line=20= is=20started=20return=20#t,=0A=20otherwise=20return=20BOL=20= (beginning-of-line)."=0A@@=20-343,8=20+349,11=20@@=20matching=20a=20= string=20against=20the=20created=20regexp."=0A=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(make-regexp=20pat))))=0A=20=20=20=20=20(cut=20= regexp-exec=20rx=20<>)))=0A=20=0A-(define=20is-property=20= (make-rx-matcher=20"([a-z0-9-]+)[=20\t]*:[=20\t]*(\\w?.*)$"=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20regexp/icase))=0A+(define=20is-layout-property=20= (make-rx-matcher=20"([a-z0-9-]+)[=20\t]*:[=20\t]*(\\w?[^\\{\\}]*)$"=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20regexp/icase))=0A+=0A= +(define=20is-braced-property=20(make-rx-matcher=20"([a-z0-9-]+)[=20= \t]*:[=20\t]*\\{[=20\t]*$"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20regexp/icase))=0A=20=0A=20(define=20is-flag=20= (make-rx-matcher=20"^flag=20+([a-z0-9_-]+)"=0A=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= regexp/icase))=0A@@=20-435,13=20+444,19=20@@=20string=20with=20the=20= read=20characters."=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(begin=20(unread-char=20c)=20(list->string=20res)))))=0A=20=20=20=20=20= =20=20=20=20=20=20(else=20(list->string=20res)))))=0A=20=0A-(define=20= (lex-property=20k-v-rx-res=20loc=20port)=0A+(define=20= (lex-layout-property=20k-v-rx-res=20loc=20port)=0A=20=20=20(let=20((key=20= (string-downcase=20(match:substring=20k-v-rx-res=201)))=0A=20=20=20=20=20= =20=20=20=20(value=20(match:substring=20k-v-rx-res=202)))=0A=20=20=20=20=20= (make-lexical-token=0A=20=20=20=20=20=20'PROPERTY=20loc=0A=20=20=20=20=20= =20(list=20key=20`(,(read-value=20port=20value=20= (current-indentation)))))))=0A=20=0A+(define=20(lex-braced-property=20= k-rx-res=20loc=20port)=0A+=20=20(let=20((key=20(string-downcase=20= (match:substring=20k-rx-res=201))))=0A+=20=20=20=20(make-lexical-token=0A= +=20=20=20=20=20'PROPERTY=20loc=0A+=20=20=20=20=20(list=20key=20= `(,(read-braced-value=20port))))))=0A+=0A=20(define=20(lex-rx-res=20= rx-res=20token=20loc)=0A=20=20=20(let=20((name=20(string-downcase=20= (match:substring=20rx-res=201))))=0A=20=20=20=20=20(make-lexical-token=20= token=20loc=20name)))=0A@@=20-552,7=20+567,6=20@@=20LOC=20is=20the=20= current=20port=20location."=0A=20the=20current=20port=20location."=0A=20=20= =20(let*=20((s=20(read-delimited=20"\n{}"=20port=20'peek)))=0A=20=20=20=20= =20(cond=0A-=20=20=20=20=20((is-property=20s)=20=3D>=20(cut=20= lex-property=20<>=20loc=20port))=0A=20=20=20=20=20=20((is-flag=20s)=20=3D>= =20(cut=20lex-flag=20<>=20loc))=0A=20=20=20=20=20=20((is-src-repo=20s)=20= =3D>=20(cut=20lex-src-repo=20<>=20loc))=0A=20=20=20=20=20=20((is-exec=20= s)=20=3D>=20(cut=20lex-exec=20<>=20loc))=0A@@=20-561,13=20+575,22=20@@=20= the=20current=20port=20location."=0A=20=20=20=20=20=20((is-benchmark=20= s)=20=3D>=20(cut=20lex-benchmark=20<>=20loc))=0A=20=20=20=20=20=20= ((is-lib=20s)=20(lex-lib=20loc))=0A=20=20=20=20=20=20((is-else=20s)=20= (lex-else=20loc))=0A-=20=20=20=20=20(else=0A-=20=20=20=20=20=20#f))))=0A= +=20=20=20=20=20(else=20(unread-string=20s=20port)=20#f))))=0A+=0A= +(define=20(lex-property=20port=20loc)=0A+=20=20(let*=20((s=20= (read-delimited=20"\n"=20port=20'peek)))=0A+=20=20=20=20(cond=0A+=20=20=20= =20=20=20((is-braced-property=20s)=20=3D>=20(cut=20lex-braced-property=20= <>=20loc=20port))=0A+=20=20=20=20=20=20((is-layout-property=20s)=20=3D>=20= (cut=20lex-layout-property=20<>=20loc=20port))=0A+=20=20=20=20=20=20= (else=20#f))))=0A=20=0A=20(define=20(lex-token=20port)=0A=20=20=20(let*=20= ((loc=20(make-source-location=20(cabal-file-name)=20(port-line=20port)=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(port-column=20port)=20-1=20-1)))=0A= -=20=20=20=20(or=20(lex-single-char=20port=20loc)=20(lex-word=20port=20= loc)=20(lex-line=20port=20loc))))=0A+=20=20=20=20(or=20(lex-single-char=20= port=20loc)=0A+=20=20=20=20=20=20=20=20(lex-word=20port=20loc)=0A+=20=20=20= =20=20=20=20=20(lex-line=20port=20loc)=0A+=20=20=20=20=20=20=20=20= (lex-property=20port=20loc))))=0A=20=0A=20;;=20Lexer-=20and=20= error-function=20generators=0A=20=0Adiff=20--git=20a/tests/hackage.scm=20= b/tests/hackage.scm=0Aindex=20e56aa996d6..772ecd5217=20100644=0A---=20= a/tests/hackage.scm=0A+++=20b/tests/hackage.scm=0A@@=20-128,6=20+128,22=20= @@=20library=0A=20=20=20=20=20=20=20mtl=20=20=20=20=20=20=20=20>=3D=20= 2.0=20=20=20=20=20=20&&=20<=203=0A=20")=0A=20=0A+;;=20Check=20braces=20= instead=20of=20layout=0A+(define=20test-cabal-7=0A+=20=20"name:=20foo=0A= +version:=201.0.0=0A+homepage:=20http://test.org=0A+synopsis:=20synopsis=0A= +description:=20{=0A+description=0A+}=0A+license:=20BSD3=0A+executable=20= cabal=0A+=20=20build-depends:=0A+=20=20=20=20HTTP=20=20=20=20=20=20=20>=3D= =204000.2.5=20&&=20<=204000.3,=0A+=20=20=20=20mtl=20=20=20=20=20=20=20=20= >=3D=202.0=20=20=20=20=20=20&&=20<=203=0A+")=0A+=0A=20;;=20A=20fragment=20= of=20a=20real=20Cabal=20file=20with=20minor=20modification=20to=20check=20= precedence=0A=20;;=20of=20'and'=20over=20'or',=20missing=20final=20= newline,=20spaces=20between=20keywords=20and=0A=20;;=20parentheses=20and=20= between=20key=20and=20column.=0A@@=20-243,6=20+259,10=20@@=20library=0A=20= =20=20=20=20=20(x=0A=20=20=20=20=20=20=20(pk=20'fail=20x=20#f)))))=0A=20=0A= +(test-assert=20"hackage->guix-package=20test=207"=0A+=20=20= (eval-test-with-cabal=20test-cabal-7=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20#:cabal-environment=20'(("impl"=20= .=20"ghc-7.8"))))=0A+=0A=20(test-assert=20"read-cabal=20test=201"=0A=20=20= =20(match=20(call-with-input-string=20test-read-cabal-1=20read-cabal)=0A=20= =20=20=20=20((("name"=20("test-me"))=0A--=20=0A2.21.0=0A=0A= --Apple-Mail=_B5C39A47-9915-4AA5-A9C8-20F6047DF3F8-- ------------=_1558905842-22425-3-- From unknown Fri Aug 15 15:56:31 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Robert Vollmert Subject: bug#35859: closed (Re: [bug#35812] [PATCH] fix hackage cabal tests) Message-ID: References: <87r28kkj00.fsf@gnu.org> <72F268CC-5FB7-421C-B6F7-B47EAAB823C1@vllmrt.net> X-Gnu-PR-Message: they-closed 35859 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 35859@debbugs.gnu.org Date: Sun, 26 May 2019 21:24:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1558905843-22425-5" This is a multi-part message in MIME format... ------------=_1558905843-22425-5 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #35812: [PATCH] hackage import: Setup.hs generation and revision support which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 35859@debbugs.gnu.org. --=20 35812: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D35812 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1558905843-22425-5 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 35812-done) by debbugs.gnu.org; 26 May 2019 21:23:40 +0000 Received: from localhost ([127.0.0.1]:51950 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hV0cG-0005p7-3U for submit@debbugs.gnu.org; Sun, 26 May 2019 17:23:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hV0cC-0005os-NH for 35812-done@debbugs.gnu.org; Sun, 26 May 2019 17:23:38 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52716) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hV0c6-0007mu-Ea; Sun, 26 May 2019 17:23:30 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=49896 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hV0c5-0005pt-QX; Sun, 26 May 2019 17:23:30 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Robert Vollmert Subject: Re: [bug#35812] [PATCH] fix hackage cabal tests References: <874l5n2799.fsf@gnu.org> <616C2CBF-8171-401C-9515-5679A5E01823@vllmrt.net> Date: Sun, 26 May 2019 23:23:27 +0200 In-Reply-To: <616C2CBF-8171-401C-9515-5679A5E01823@vllmrt.net> (Robert Vollmert's message of "Tue, 21 May 2019 17:10:51 +0200") Message-ID: <87r28kkj00.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 35812-done Cc: 35812-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Robert Vollmert skribis: >> On 21. May 2019, at 16:48, Ludovic Court=C3=A8s wrote: >> Robert Vollmert skribis: >>=20 >>> Hackage cabal tests didn=E2=80=99t run independently due to memoization, >>> and test-cabal-6 was failing. >>=20 >> I don=E2=80=99t think memoization can get in the way here: the argument = list is >> used as a key in the memoization hash table. Thus, if you pass >> different arguments, you get a cache miss and call the underlying >> procedure. >>=20 >> Or am I missing something? > > I agree that memoization of a pure function shouldn=E2=80=99t have such e= ffects, > but my (limited) understanding is that hackage->guix-packages would > cache import results by package name on the assumption that cabal > files for the same package name don=E2=80=99t change between calls. Oh, got it. I pushed a variant of the patch as commit ad7466aafd7f166d0b6be5eb32dda1d3ee8a6445. Thanks! Ludo=E2=80=99. ------------=_1558905843-22425-5 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 22 May 2019 20:12:33 +0000 Received: from localhost ([127.0.0.1]:43025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTXbF-0005pq-4u for submit@debbugs.gnu.org; Wed, 22 May 2019 16:12:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTXbC-0005pa-Fi for submit@debbugs.gnu.org; Wed, 22 May 2019 16:12:31 -0400 Received: from lists.gnu.org ([209.51.188.17]:56005) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hTXb7-0002Ee-Bc for submit@debbugs.gnu.org; Wed, 22 May 2019 16:12:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTXb6-0002J1-96 for guix-patches@gnu.org; Wed, 22 May 2019 16:12:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTXb5-0002Ck-AM for guix-patches@gnu.org; Wed, 22 May 2019 16:12:24 -0400 Received: from mx2a.mailbox.org ([2001:67c:2050:104:0:2:25:2]:62768 helo=mx2.mailbox.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hTXb3-00023X-3j for guix-patches@gnu.org; Wed, 22 May 2019 16:12:23 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 81FDEA29ED for ; Wed, 22 May 2019 22:12:10 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id OAIBlOY8MfWu for ; Wed, 22 May 2019 22:11:50 +0200 (CEST) From: Robert Vollmert Content-Type: multipart/mixed; boundary="Apple-Mail=_BDC1C73C-B364-49AE-93AE-4AA935BAE22B" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: [PATCH] hackage import: Setup.hs generation and revision support Message-Id: <72F268CC-5FB7-421C-B6F7-B47EAAB823C1@vllmrt.net> Date: Wed, 22 May 2019 22:11:50 +0200 To: guix-patches@gnu.org X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:67c:2050:104:0:2:25:2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) --Apple-Mail=_BDC1C73C-B364-49AE-93AE-4AA935BAE22B Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii These patches are on top of https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35812 (fix cabal tests) https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35846 (braced properties) - substitute missing Setup.hs and remove manual per-package workarounds - handle hackage metadata revisions I believe the code works, but some may not be the most idiomatic scheme code. Particularly around building the quoted argument list and returning a pair of cabal data and hash. --Apple-Mail=_BDC1C73C-B364-49AE-93AE-4AA935BAE22B Content-Disposition: attachment; filename=0001-gnu-ghc-easy-plot-remove-superfluous-Setup.hs-rename.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-gnu-ghc-easy-plot-remove-superfluous-Setup.hs-rename.patch" Content-Transfer-Encoding: quoted-printable =46rom=2044c8df36d718940bcb1081e17dad17e2df42dd78=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Robert=20Vollmert=20=0ADate:=20= Fri,=2017=20May=202019=2016:28:44=20+0200=0ASubject:=20[PATCH=201/5]=20= gnu:=20ghc-easy-plot:=20remove=20superfluous=20Setup.hs=20rename=0A=20= step=0A=0Ahaskell-build-system=20already=20uses=20whichever=20of=20= Setup.hs=20and=0ASetup.lhs=20exists.=0A=0A*=20gnu/packages/haskell.scm=20= (ghc-easy-plot):=20don't=20rename=0ASetup.lhs=20to=20Setup.hs=0A---=0A=20= gnu/packages/haskell.scm=20|=204=20----=0A=201=20file=20changed,=204=20= deletions(-)=0A=0Adiff=20--git=20a/gnu/packages/haskell.scm=20= b/gnu/packages/haskell.scm=0Aindex=2061c6119322..c40581a8cd=20100644=0A= ---=20a/gnu/packages/haskell.scm=0A+++=20b/gnu/packages/haskell.scm=0A@@=20= -8063,10=20+8063,6=20@@=20interface=20for=20statistics=20based=20on=20= hmatrix=20and=20GSL.")=0A=20=20=20=20=20=20=20=20=20(base32=20= "18kndgvdj2apjpfga6fp7m16y1gx8zrwp3c5vfj03sx4v6jvciqk"))))=0A=20=20=20=20= =20(build-system=20haskell-build-system)=0A=20=20=20=20=20= (propagated-inputs=20`(("gnuplot"=20,gnuplot)))=0A-=20=20=20=20= (arguments=0A-=20=20=20=20=20`(#:phases=20(modify-phases=20= %standard-phases=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (add-after=20'unpack=20'fix-setup-suffix=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(lambda=20_=20(rename-file=20"Setup.lhs"=20= "Setup.hs")=20#t)))))=0A=20=20=20=20=20(home-page=20= "https://hub.darcs.net/scravy/easyplot")=0A=20=20=20=20=20(synopsis=20= "Haskell=20plotting=20library=20based=20on=20gnuplot")=0A=20=20=20=20=20= (description=20"This=20package=20provides=20a=20plotting=20library=20for=0A= --=20=0A2.21.0=0A=0A= --Apple-Mail=_BDC1C73C-B364-49AE-93AE-4AA935BAE22B Content-Disposition: attachment; filename=0002-guix-haskell-build-system-correct-haddock-phase-docu.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0002-guix-haskell-build-system-correct-haddock-phase-docu.patch" Content-Transfer-Encoding: quoted-printable =46rom=2059fa86edcda6769bd5d9fb90342302a26e231e65=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Robert=20Vollmert=20=0ADate:=20= Fri,=2017=20May=202019=2018:58:55=20+0200=0ASubject:=20[PATCH=202/5]=20= guix:=20haskell-build-system:=20correct=20haddock=20phase=0A=20= documentation=0A=0A*=20guix/build/haskell-build-system.scm=20(haddock):=20= Correct=20docstring=0A---=0A=20guix/build/haskell-build-system.scm=20|=20= 2=20+-=0A=201=20file=20changed,=201=20insertion(+),=201=20deletion(-)=0A=0A= diff=20--git=20a/guix/build/haskell-build-system.scm=20= b/guix/build/haskell-build-system.scm=0Aindex=2023d97e6602..5c5b32322b=20= 100644=0A---=20a/guix/build/haskell-build-system.scm=0A+++=20= b/guix/build/haskell-build-system.scm=0A@@=20-260,7=20+260,7=20@@=20= given=20Haskell=20package."=0A=20=20=20#t)=0A=20=0A=20(define*=20= (haddock=20#:key=20outputs=20haddock?=20haddock-flags=20= #:allow-other-keys)=0A-=20=20"Run=20the=20test=20suite=20of=20a=20given=20= Haskell=20package."=0A+=20=20"Generate=20haddock=20documentation=20of=20= a=20given=20Haskell=20package."=0A=20=20=20(when=20haddock?=0A=20=20=20=20= =20(run-setuphs=20"haddock"=20haddock-flags))=0A=20=20=20#t)=0A--=20=0A= 2.21.0=0A=0A= --Apple-Mail=_BDC1C73C-B364-49AE-93AE-4AA935BAE22B Content-Disposition: attachment; filename=0003-guix-haskell-build-system-generate-Setup.hs-if-not-e.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0003-guix-haskell-build-system-generate-Setup.hs-if-not-e.patch" Content-Transfer-Encoding: quoted-printable =46rom=209c2c8202f490a20340e2db5522a5813f0dd7183f=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Robert=20Vollmert=20=0ADate:=20= Fri,=2017=20May=202019=2016:26:31=20+0200=0ASubject:=20[PATCH=203/5]=20= guix:=20haskell-build-system:=20generate=20Setup.hs=20if=20not=0A=20= exists=0A=0AThe=20default=20Setup.hs=20is=20boilerplate=20that=20is=20= frequently=20left=20out=20of=0Asource=20packages,=20causing=20build=20= failure=20for=20package=20definitions=20as=0Agenerated=20by=20`guix=20= import=20hackage`.=20Compare=0A= =0A=0A*=20= guix/build/haskell-build-system.scm:=20Generate=20Setup.hs=20if=20= missing,=0Aafter=20unpack=20phase.=0A---=0A=20= guix/build/haskell-build-system.scm=20|=2012=20++++++++++++=0A=201=20= file=20changed,=2012=20insertions(+)=0A=0Adiff=20--git=20= a/guix/build/haskell-build-system.scm=20= b/guix/build/haskell-build-system.scm=0Aindex=205c5b32322b..0c648e510f=20= 100644=0A---=20a/guix/build/haskell-build-system.scm=0A+++=20= b/guix/build/haskell-build-system.scm=0A@@=20-275,9=20+275,21=20@@=20= given=20Haskell=20package."=0A=20=20=20=20=20=20=20(_=20(error=20"Could=20= not=20find=20a=20Cabal=20file=20to=20patch."))))=0A=20=20=20#t)=0A=20=0A= +(define*=20(generate-setup=20#:rest=20empty)=0A+=20=20"Generate=20= boilerplate=20Setup.hs=20if=20missing."=0A+=20=20(when=20(not=20(or=20= (file-exists?=20"Setup.hs")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(file-exists?=20"Setup.lhs")))=0A+=20=20=20=20(format=20#t=20= "generating=20missing=20Setup.hs~%")=0A+=20=20=20=20(with-output-to-file=20= "Setup.hs"=0A+=20=20=20=20=20=20(lambda=20()=0A+=20=20=20=20=20=20=20=20= (format=20#t=20"import=20Distribution.Simple~%")=0A+=20=20=20=20=20=20=20= =20(format=20#t=20"main=20=3D=20defaultMain~%"))))=0A+=20=20#t)=0A+=0A=20= (define=20%standard-phases=0A=20=20=20(modify-phases=20= gnu:%standard-phases=0A=20=20=20=20=20(add-after=20'unpack=20= 'patch-cabal-file=20patch-cabal-file)=0A+=20=20=20=20(add-after=20= 'unpack=20'generate-setup=20generate-setup)=0A=20=20=20=20=20(delete=20= 'bootstrap)=0A=20=20=20=20=20(add-before=20'configure=20'setup-compiler=20= setup-compiler)=0A=20=20=20=20=20(add-before=20'install=20'haddock=20= haddock)=0A--=20=0A2.21.0=0A=0A= --Apple-Mail=_BDC1C73C-B364-49AE-93AE-4AA935BAE22B Content-Disposition: attachment; filename=0004-gnu-haskell-leave-Setup.hs-generation-to-build-syste.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0004-gnu-haskell-leave-Setup.hs-generation-to-build-syste.patch" Content-Transfer-Encoding: quoted-printable =46rom=2077952a3fe2fdbe027552149eef9d676b828b9e92=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Robert=20Vollmert=20=0ADate:=20= Fri,=2017=20May=202019=2016:29:08=20+0200=0ASubject:=20[PATCH=204/5]=20= gnu:=20haskell:=20leave=20Setup.hs=20generation=20to=20build=20system=0A=0A= Remove=20explicit=20Setup.hs=20generation=20from=20the=20configure=20= step=0Anow=20that=20haskell-build-system=20does=20it.=0A=0A*=20= gnu/packages/haskell.scm=20(ghc-foundation,=20ghc-inline-c,=0A= ghc-inline-c-cpp,=20ghc-rio):=20Don't=20generate=20Setup.hs=0A---=0A=20= gnu/packages/haskell.scm=20|=2042=20= ----------------------------------------=0A=201=20file=20changed,=2042=20= deletions(-)=0A=0Adiff=20--git=20a/gnu/packages/haskell.scm=20= b/gnu/packages/haskell.scm=0Aindex=20c40581a8cd..f12371f3ce=20100644=0A= ---=20a/gnu/packages/haskell.scm=0A+++=20b/gnu/packages/haskell.scm=0A@@=20= -9688,16=20+9688,6=20@@=20packages.")=0A=20=20=20=20=20=20=20=20=20= (base32=0A=20=20=20=20=20=20=20=20=20=20= "1q43y8wfj0wf9gdq2kzphwjwq6m5pvryy1lqgk954aq5z3ks1lsf"))))=0A=20=20=20=20= =20(build-system=20haskell-build-system)=0A-=20=20=20=20(arguments=0A-=20= =20=20=20=20`(#:phases=0A-=20=20=20=20=20=20=20(modify-phases=20= %standard-phases=0A-=20=20=20=20=20=20=20=20=20(add-after=20'unpack=20= 'add-setup-script=0A-=20=20=20=20=20=20=20=20=20=20=20(lambda=20_=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20;;=20The=20usual=20"Setup.hs"=20script=20= is=20missing=20from=20the=20source.=0A-=20=20=20=20=20=20=20=20=20=20=20=20= =20(with-output-to-file=20"Setup.hs"=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(lambda=20()=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(format=20#t=20"import=20Distribution.Simple~%")=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(format=20#t=20"main=20=3D=20= defaultMain~%"))))))))=0A=20=20=20=20=20(inputs=20`(("ghc-basement"=20= ,ghc-basement)))=0A=20=20=20=20=20(home-page=20= "https://github.com/haskell-foundation/foundation")=0A=20=20=20=20=20= (synopsis=20"Alternative=20prelude=20with=20batteries=20and=20no=20= dependencies")=0A@@=20-10575,16=20+10565,6=20@@=20widths=20to=20the=20= Char=20type.")=0A=20=20=20=20=20=20=20=20=20(base32=0A=20=20=20=20=20=20=20= =20=20=20"064h8a4hp53a479d3ak0vmqbx8hi0cpg7zn4wp23rjy26dka8p7g"))))=0A=20= =20=20=20=20(build-system=20haskell-build-system)=0A-=20=20=20=20= (arguments=0A-=20=20=20=20=20`(#:phases=0A-=20=20=20=20=20=20=20= (modify-phases=20%standard-phases=0A-=20=20=20=20=20=20=20=20=20= (add-after=20'unpack=20'add-setup-script=0A-=20=20=20=20=20=20=20=20=20=20= =20(lambda=20_=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20The=20= usual=20"Setup.hs"=20script=20is=20missing=20from=20the=20source.=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20(with-output-to-file=20"Setup.hs"=0A-=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(lambda=20()=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(format=20#t=20"import=20= Distribution.Simple~%")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(format=20#t=20"main=20=3D=20defaultMain~%"))))))))=0A=20=20=20=20=20= (inputs=0A=20=20=20=20=20=20`(("ghc-exceptions"=20,ghc-exceptions)=0A=20=20= =20=20=20=20=20=20("ghc-hashable"=20,ghc-hashable)=0A@@=20-11107,17=20= +11087,6=20@@=20DOS/Windows=20paths=20and=20markup=20languages=20(such=20= as=20XML).")=0A=20=20=20=20=20=20=20=20=20(base32=0A=20=20=20=20=20=20=20= =20=20=20"0vbfrsqsi7mdziqsnj68bsqlwbqxxhvrmy9rv6w8z18d1m8w3n6h"))))=0A=20= =20=20=20=20(build-system=20haskell-build-system)=0A-=20=20=20=20= (arguments=0A-=20=20=20=20=20`(#:phases=0A-=20=20=20=20=20=20=20= (modify-phases=20%standard-phases=0A-=20=20=20=20=20=20=20=20=20= (add-after=20'unpack=20'create-Setup.hs=0A-=20=20=20=20=20=20=20=20=20=20= =20(lambda=20_=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= (with-output-to-file=20"Setup.hs"=0A-=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(lambda=20_=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (display=20"\=0A-import=20Distribution.Simple=0A-main=20=3D=20= defaultMain")))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20#t)))))=0A=20=20= =20=20=20(inputs=0A=20=20=20=20=20=20`(("ghc-ansi-wl-pprint"=20= ,ghc-ansi-wl-pprint)=0A=20=20=20=20=20=20=20=20("ghc-cryptohash"=20= ,ghc-cryptohash)=0A@@=20-11251,17=20+11220,6=20@@=20handling=20wrong.")=0A= =20=20=20=20=20=20=20=20=20(base32=0A=20=20=20=20=20=20=20=20=20=20= "1rk7fmpkmxw9hhwr8df29kadnf0ybnwj64ggdbnsdrpfyhnkisci"))))=0A=20=20=20=20= =20(build-system=20haskell-build-system)=0A-=20=20=20=20(arguments=0A-=20= =20=20=20=20`(#:phases=0A-=20=20=20=20=20=20=20(modify-phases=20= %standard-phases=0A-=20=20=20=20=20=20=20=20=20(add-after=20'unpack=20= 'create-Setup.hs=0A-=20=20=20=20=20=20=20=20=20=20=20(lambda=20_=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20(with-output-to-file=20"Setup.hs"=0A-=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(lambda=20_=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(display=20"\=0A-import=20= Distribution.Simple=0A-main=20=3D=20defaultMain")))=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20#t)))))=0A=20=20=20=20=20(inputs=0A=20=20=20=20=20=20= `(("ghc-inline-c"=20,ghc-inline-c)=0A=20=20=20=20=20=20=20=20= ("ghc-safe-exceptions"=20,ghc-safe-exceptions)))=0A--=20=0A2.21.0=0A=0A= --Apple-Mail=_BDC1C73C-B364-49AE-93AE-4AA935BAE22B Content-Disposition: attachment; filename=0005-guix-import-hackage-handle-hackage-revisions.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0005-guix-import-hackage-handle-hackage-revisions.patch" Content-Transfer-Encoding: quoted-printable =46rom=203b899cfd69dbc19fa542a0a790bee124868058ca=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Robert=20Vollmert=20=0ADate:=20= Fri,=2017=20May=202019=2022:52:24=20+0200=0ASubject:=20[PATCH=205/5]=20= guix:=20import:=20hackage:=20handle=20hackage=20revisions=0A=0AHackage=20= packages=20can=20have=20metadata=20revision=20(cabal-file=20only)=0Athat=20= aren't=20reflected=20in=20the=20source=20archive.=20haskell-build-system=0A= has=20support=20for=20this,=20but=20previously=20`guix=20import=20= hackage`=20would=0Acreate=20a=20definition=20based=20on=20the=20new=20= cabal=20file=20but=20building=20using=0Athe=20old=20cabal=20file.=0A=0A= Compare=20https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D35750.=0A=0A*=20= guix/import/cabal.scm:=20Parse=20`x-revision:`=20property.=0A*=20= guix/import/hackage.scm:=20Compute=20hash=20of=20cabal=20file,=20and=20= write=0Acabal-revision=20build=20system=20arguments.=0A---=0A=20= guix/import/cabal.scm=20=20=20|=20=207=20+++--=0A=20= guix/import/hackage.scm=20|=2061=20= ++++++++++++++++++++++++++++++-----------=0A=202=20files=20changed,=2050=20= insertions(+),=2018=20deletions(-)=0A=0Adiff=20--git=20= a/guix/import/cabal.scm=20b/guix/import/cabal.scm=0Aindex=20= 383702f2be..97105eb154=20100644=0A---=20a/guix/import/cabal.scm=0A+++=20= b/guix/import/cabal.scm=0A@@=20-40,6=20+40,7=20@@=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20cabal-package?=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= cabal-package-name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= cabal-package-version=0A+=20=20=20=20=20=20=20=20=20=20=20=20= cabal-package-revision=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= cabal-package-license=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= cabal-package-home-page=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= cabal-package-source-repository=0A@@=20-640,13=20+641,14=20@@=20If=20#f=20= use=20the=20function=20'port-filename'=20to=20obtain=20it."=0A=20;;=20= information=20of=20the=20Cabal=20file,=20but=20only=20the=20ones=20we=20= currently=20are=0A=20;;=20interested=20in.=0A=20(define-record-type=20= =0A-=20=20(make-cabal-package=20name=20version=20license=20= home-page=20source-repository=0A+=20=20(make-cabal-package=20name=20= version=20revision=20license=20home-page=20source-repository=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20synopsis=20= description=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20executables=20lib=20test-suites=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20flags=20eval-environment=20= custom-setup)=0A=20=20=20cabal-package?=0A=20=20=20(name=20=20=20= cabal-package-name)=0A=20=20=20(version=20cabal-package-version)=0A+=20=20= (revision=20cabal-package-revision)=0A=20=20=20(license=20= cabal-package-license)=0A=20=20=20(home-page=20cabal-package-home-page)=0A= =20=20=20(source-repository=20cabal-package-source-repository)=0A@@=20= -840,6=20+842,7=20@@=20See=20the=20manual=20for=20limitations.")))))))=0A= =20=20=20(define=20(cabal-evaluated-sexp->package=20evaluated-sexp)=0A=20= =20=20=20=20(let*=20((name=20(lookup-join=20evaluated-sexp=20"name"))=0A=20= =20=20=20=20=20=20=20=20=20=20=20(version=20(lookup-join=20= evaluated-sexp=20"version"))=0A+=20=20=20=20=20=20=20=20=20=20=20= (revision=20(lookup-join=20evaluated-sexp=20"x-revision"))=0A=20=20=20=20= =20=20=20=20=20=20=20=20(license=20(lookup-join=20evaluated-sexp=20= "license"))=0A=20=20=20=20=20=20=20=20=20=20=20=20(home-page=20= (lookup-join=20evaluated-sexp=20"homepage"))=0A=20=20=20=20=20=20=20=20=20= =20=20=20(home-page-or-hackage=0A@@=20-858,7=20+861,7=20@@=20See=20the=20= manual=20for=20limitations.")))))))=0A=20=20=20=20=20=20=20=20=20=20=20=20= (custom-setup=20(match=20(make-cabal-section=20evaluated-sexp=20= 'custom-setup)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20((x)=20x)=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(_=20#f))))=0A-=20=20=20=20= =20=20(make-cabal-package=20name=20version=20license=20= home-page-or-hackage=0A+=20=20=20=20=20=20(make-cabal-package=20name=20= version=20revision=20license=20home-page-or-hackage=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= source-repository=20synopsis=20description=20executables=20lib=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= test-suites=20flags=20eval-environment=20custom-setup)))=0A=20=0Adiff=20= --git=20a/guix/import/hackage.scm=20b/guix/import/hackage.scm=0Aindex=20= 5b80a7ea1d..fe0c6d13e4=20100644=0A---=20a/guix/import/hackage.scm=0A+++=20= b/guix/import/hackage.scm=0A@@=20-117,9=20+117,15=20@@=20version=20is=20= returned."=0A=20=20=20=20=20=20=20=20=20=20=20(#f=20name)=0A=20=20=20=20=20= =20=20=20=20=20=20(m=20(match:substring=20m=201)))))))=0A=20=0A-(define=20= (hackage-fetch=20name-version)=0A-=20=20"Return=20the=20Cabal=20file=20= for=20the=20package=20NAME-VERSION,=20or=20#f=20on=20failure.=20=20If=0A= -the=20version=20part=20is=20omitted=20from=20the=20package=20name,=20= then=20return=20the=20latest=0A+(define=20(read-cabal-and-hash=20port)=0A= +=20=20(let-values=20(((port=20get-hash)=20(open-sha256-input-port=20= port)))=0A+=20=20=20=20(cons=0A+=20=20=20=20=20=20(read-cabal=20port)=0A= +=20=20=20=20=20=20(bytevector->nix-base32-string=20(get-hash)))))=0A+=0A= +(define=20(hackage-fetch-and-hash=20name-version)=0A+=20=20"Return=20= the=20Cabal=20file=20and=20hash=20for=20the=20package=20NAME-VERSION,=20= or=20#f=20on=20failure.=0A+If=20the=20version=20part=20is=20omitted=20= from=20the=20package=20name,=20then=20return=20the=20latest=0A=20= version."=0A=20=20=20(guard=20(c=20((and=20(http-get-error?=20c)=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(=3D=20404=20= (http-get-error-code=20c)))=0A@@=20-127,10=20+133,18=20@@=20version."=0A=20= =20=20=20=20(let-values=20(((name=20version)=20= (package-name->name+version=20name-version)))=0A=20=20=20=20=20=20=20= (let*=20((url=20(hackage-cabal-url=20name=20version))=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(port=20(http-fetch=20url))=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20(result=20(read-cabal=20(canonical-newline-port=20= port))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20(result=20= (read-cabal-and-hash=20(canonical-newline-port=20port))))=0A=20=20=20=20=20= =20=20=20=20(close-port=20port)=0A=20=20=20=20=20=20=20=20=20result))))=0A= =20=0A+(define=20(hackage-fetch=20name-version)=0A+=20=20"Return=20the=20= Cabal=20file=20for=20the=20package=20NAME-VERSION,=20or=20#f=20on=20= failure.=20=20If=0A+the=20version=20part=20is=20omitted=20from=20the=20= package=20name,=20then=20return=20the=20latest=0A+version."=0A+=20=20= (match=20(hackage-fetch-and-hash=20name-version)=0A+=20=20=20=20=20=20=20= =20=20((cabal=20.=20hash)=20cabal)=0A+=20=20=20=20=20=20=20=20=20(_=20=20= =20=20=20=20=20=20=20=20=20=20=20=20#f)))=0A+=0A=20(define=20= string->license=0A=20=20=20;;=20List=20of=20valid=20values=20from=0A=20=20= =20;;=20https://www.haskell.org=0A@@=20-196,15=20+210,19=20@@=20package=20= being=20processed=20and=20is=20used=20to=20filter=20references=20to=20= itself."=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(cons=20own-name=20= ghc-standard-libraries))))=0A=20=20=20=20=20=20=20=20=20=20=20= dependencies))=0A=20=0A-(define*=20(hackage-module->sexp=20cabal=20#:key=20= (include-test-dependencies?=20#t))=0A+(define*=20(hackage-module->sexp=20= cabal=20cabal-hash=20#:key=20(include-test-dependencies?=20#t))=0A=20=20=20= "Return=20the=20`package'=20S-expression=20for=20a=20Cabal=20package.=20=20= CABAL=20is=20the=0A-representation=20of=20a=20Cabal=20file=20as=20= produced=20by=20'read-cabal'."=0A+representation=20of=20a=20Cabal=20file=20= as=20produced=20by=20'read-cabal'.=20CABAL-HASH=20is=0A+the=20hash=20of=20= the=20Cabal=20file."=0A=20=0A=20=20=20(define=20name=0A=20=20=20=20=20= (cabal-package-name=20cabal))=0A=20=0A=20=20=20(define=20version=0A=20=20= =20=20=20(cabal-package-version=20cabal))=0A+=0A+=20=20(define=20= revision=0A+=20=20=20=20(cabal-package-revision=20cabal))=0A=20=20=20=0A=20= =20=20(define=20source-url=0A=20=20=20=20=20(hackage-source-url=20name=20= version))=0A@@=20-250,9=20+268,17=20@@=20representation=20of=20a=20Cabal=20= file=20as=20produced=20by=20'read-cabal'."=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(list=20'quasiquote=20inputs))))))=0A=20=20= =20=0A=20=20=20(define=20(maybe-arguments)=0A-=20=20=20=20(if=20(not=20= include-test-dependencies?)=0A-=20=20=20=20=20=20=20=20'((arguments=20= `(#:tests?=20#f)))=0A-=20=20=20=20=20=20=20=20'()))=0A+=20=20=20=20= (define=20testargs=20(if=20(not=20include-test-dependencies?)=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'(#:tests?=20= #f)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20'()))=0A+=20=20=20=20(define=20revargs=20=20(if=20(not=20= (string-null?=20revision))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20`(#:cabal-revision=20(,revision=20,cabal-hash))=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= '()))=0A+=20=20=20=20(define=20args=20(append=20testargs=20revargs))=0A+=20= =20=20=20(if=20(not=20(nil?=20args))=0A+=20=20=20=20=20=20(let=20((qargs=20= `(,'quasiquote=20,args)))=0A+=20=20=20=20=20=20=20=20`((arguments=20= ,qargs)))=0A+=20=20=20=20=20=20'()))=0A=20=0A=20=20=20(let=20((tarball=20= (with-store=20store=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(download-to-store=20store=20source-url))))=0A@@=20-293,13=20= +319,16=20@@=20symbol=20'true'=20or=20'false'.=20=20The=20value=20= associated=20with=20other=20keys=20has=20to=20conform=0A=20to=20the=20= Cabal=20file=20format=20definition.=20=20The=20default=20value=20= associated=20with=20the=0A=20keys=20\"os\",=20\"arch\"=20and=20\"impl\"=20= is=20\"linux\",=20\"x86_64\"=20and=20\"ghc\"=0A=20respectively."=0A-=20=20= =20(let=20((cabal-meta=20(if=20port=0A-=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(read-cabal=20= (canonical-newline-port=20port))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(hackage-fetch=20package-name))))=0A= -=20=20=20=20=20(and=3D>=20cabal-meta=20(compose=20(cut=20= hackage-module->sexp=20<>=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= #:include-test-dependencies?=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= include-test-dependencies?)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(cut=20eval-cabal=20= <>=20cabal-environment))))))=0A+=20=20=20(match=0A+=20=20=20=20=20(if=20= port=20(read-cabal-and-hash=20(canonical-newline-port=20port))=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(hackage-fetch-and-hash=20= package-name))=0A+=20=20=20=20=20((cabal-meta=20.=20cabal-hash)=0A+=20=20= =20=20=20=20(and=3D>=20cabal-meta=20(compose=20(cut=20= hackage-module->sexp=20<>=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= cabal-hash=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= #:include-test-dependencies?=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= include-test-dependencies?)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(cut=20= eval-cabal=20<>=20cabal-environment))))=0A+=20=20=20=20=20(_=20#f))))=0A=20= =0A=20(define=20hackage->guix-package=0A=20=20=20(memoize=20= hackage->guix-package-impl))=0A--=20=0A2.21.0=0A=0A= --Apple-Mail=_BDC1C73C-B364-49AE-93AE-4AA935BAE22B-- ------------=_1558905843-22425-5--