From debbugs-submit-bounces@debbugs.gnu.org Mon May 20 15:07:19 2019 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-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 21 10:48:46 2019 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: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Robert Vollmert Subject: Re: [bug#35812] [PATCH] fix hackage cabal tests 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-Debbugs-Envelope-To: 35812 Cc: 35812@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 (---) 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 debbugs-submit-bounces@debbugs.gnu.org Tue May 21 11:11:07 2019 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\)) Subject: Re: [bug#35812] [PATCH] fix hackage cabal tests 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> To: =?utf-8?Q?Ludovic_Court=C3=A8s?= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 35812 Cc: 35812@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: -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 debbugs-submit-bounces@debbugs.gnu.org Sun May 26 17:23:40 2019 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. From unknown Thu Aug 14 21:51:02 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 24 Jun 2019 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator