GNU bug report logs - #47375
guix test failure: tests/print

Previous Next

Package: guix;

Reported by: Léo Le Bouter <lle-bout <at> zaclys.net>

Date: Thu, 25 Mar 2021 01:45:01 UTC

Severity: normal

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47375 in the body.
You can then email your comments to 47375 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#47375; Package guix. (Thu, 25 Mar 2021 01:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Léo Le Bouter <lle-bout <at> zaclys.net>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 25 Mar 2021 01:45:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Léo Le Bouter <lle-bout <at> zaclys.net>
To: bug-guix <at> gnu.org
Subject: guix test failure: tests/print
Date: Thu, 25 Mar 2021 02:44:37 +0100
[Message part 1 (text/plain, inline)]
FAIL: tests/print
=================

test-name: simple package
location: /tmp/guix-build-guix-1.2.0-18.86dd54f.drv-
0/source/tests/print.scm:70
source:
+ (test-equal
+   "simple package"
+   `(define-public test ,pkg-source)
+   (package->code pkg))
expected-value: (define-public test (package (name "test") (version
"1.2.3") (source (origin (method url-fetch) (uri (string-append
"file:///tmp/test-" version ".tar.gz")) (sha256 (base32
"070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah")))) (build-
system (@ (guix build-system gnu) gnu-build-system)) (home-page "
http://gnu.org") (synopsis "Dummy") (description "This is a dummy
package.") (license license:gpl3+)))
actual-value: (define-public test (package (name "test") (version
"1.2.3") (source (origin (method url-fetch*) (uri (string-append
"file:///tmp/test-" version ".tar.gz")) (sha256 (base32
"070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah")))) (build-
system (@ (guix build-system gnu) gnu-build-system)) (home-page "
http://gnu.org") (synopsis "Dummy") (description "This is a dummy
package.") (license license:gpl3+)))
result: FAIL

test-name: package with inputs
location: /tmp/guix-build-guix-1.2.0-18.86dd54f.drv-
0/source/tests/print.scm:74
source:
+ (test-equal
+   "package with inputs"
+   `(define-public test ,pkg-with-inputs-source)
+   (package->code pkg-with-inputs))
expected-value: (define-public test (package (name "test") (version
"1.2.3") (source (origin (method url-fetch) (uri (string-append
"file:///tmp/test-" version ".tar.gz")) (sha256 (base32
"070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah")))) (build-
system (@ (guix build-system gnu) gnu-build-system)) (inputs
(quasiquote (("coreutils" (unquote (@ (gnu packages base) coreutils)))
("glibc" (unquote (@ (gnu packages base) glibc)) "debug")))) (home-page 
"http://gnu.org") (synopsis "Dummy") (description "This is a dummy
package.") (license license:gpl3+)))
actual-value: (define-public test (package (name "test") (version
"1.2.3") (source (origin (method url-fetch*) (uri (string-append
"file:///tmp/test-" version ".tar.gz")) (sha256 (base32
"070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah")))) (build-
system (@ (guix build-system gnu) gnu-build-system)) (inputs
(quasiquote (("coreutils" (unquote (@ (gnu packages base) coreutils)))
("glibc" (unquote (@ (gnu packages base) glibc)) "debug")))) (home-page 
"http://gnu.org") (synopsis "Dummy") (description "This is a dummy
package.") (license license:gpl3+)))
result: FAIL

Full log: https://ci.guix.gnu.org/build/117996/log/raw

Seems related to f7008ca71351e5368a7c1c5bc3fe88fb80b01298

This patch fixes the issue but I am not sure it retains the test's
original intent:

diff --git a/tests/print.scm b/tests/print.scm
index 3386590d3a..85735cf9ae 100644
--- a/tests/print.scm
+++ b/tests/print.scm
@@ -19,7 +19,7 @@
 (define-module (test-print)
   #:use-module (guix import print)
   #:use-module (guix build-system gnu)
-  #:use-module (guix download)
+  #:use-module (guix build download)
   #:use-module (guix packages)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (srfi srfi-64))

Let me know!

Thank you
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#47375; Package guix. (Thu, 25 Mar 2021 01:56:02 GMT) Full text and rfc822 format available.

Message #8 received at 47375 <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: Léo Le Bouter <lle-bout <at> zaclys.net>,
 47375 <at> debbugs.gnu.org
Subject: Re: bug#47375: guix test failure: tests/print
Date: Wed, 24 Mar 2021 21:54:48 -0400
[Message part 1 (text/plain, inline)]
I don't think this is the right fix. Now you define packages with the incorrect url-fetch, so the test passes, but package->code would still not work as intended on actual packages that are properly defined.

It seems that the issue is package->code uses the internal name url-fetch* whereas it should be the exported name url-fetch. I think this is a legitimate bug in package->code and your patch incorrectly hides it.

Le 24 mars 2021 21:44:37 GMT-04:00, "Léo Le Bouter via Bug reports for GNU Guix" <bug-guix <at> gnu.org> a écrit :
>FAIL: tests/print
>=================
>
>test-name: simple package
>location: /tmp/guix-build-guix-1.2.0-18.86dd54f.drv-
>0/source/tests/print.scm:70
>source:
>+ (test-equal
>+   "simple package"
>+   `(define-public test ,pkg-source)
>+   (package->code pkg))
>expected-value: (define-public test (package (name "test") (version
>"1.2.3") (source (origin (method url-fetch) (uri (string-append
>"file:///tmp/test-" version ".tar.gz")) (sha256 (base32
>"070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah")))) (build-
>system (@ (guix build-system gnu) gnu-build-system)) (home-page "
>http://gnu.org") (synopsis "Dummy") (description "This is a dummy
>package.") (license license:gpl3+)))
>actual-value: (define-public test (package (name "test") (version
>"1.2.3") (source (origin (method url-fetch*) (uri (string-append
>"file:///tmp/test-" version ".tar.gz")) (sha256 (base32
>"070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah")))) (build-
>system (@ (guix build-system gnu) gnu-build-system)) (home-page "
>http://gnu.org") (synopsis "Dummy") (description "This is a dummy
>package.") (license license:gpl3+)))
>result: FAIL
>
>test-name: package with inputs
>location: /tmp/guix-build-guix-1.2.0-18.86dd54f.drv-
>0/source/tests/print.scm:74
>source:
>+ (test-equal
>+   "package with inputs"
>+   `(define-public test ,pkg-with-inputs-source)
>+   (package->code pkg-with-inputs))
>expected-value: (define-public test (package (name "test") (version
>"1.2.3") (source (origin (method url-fetch) (uri (string-append
>"file:///tmp/test-" version ".tar.gz")) (sha256 (base32
>"070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah")))) (build-
>system (@ (guix build-system gnu) gnu-build-system)) (inputs
>(quasiquote (("coreutils" (unquote (@ (gnu packages base) coreutils)))
>("glibc" (unquote (@ (gnu packages base) glibc)) "debug")))) (home-page
>
>"http://gnu.org") (synopsis "Dummy") (description "This is a dummy
>package.") (license license:gpl3+)))
>actual-value: (define-public test (package (name "test") (version
>"1.2.3") (source (origin (method url-fetch*) (uri (string-append
>"file:///tmp/test-" version ".tar.gz")) (sha256 (base32
>"070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah")))) (build-
>system (@ (guix build-system gnu) gnu-build-system)) (inputs
>(quasiquote (("coreutils" (unquote (@ (gnu packages base) coreutils)))
>("glibc" (unquote (@ (gnu packages base) glibc)) "debug")))) (home-page
>
>"http://gnu.org") (synopsis "Dummy") (description "This is a dummy
>package.") (license license:gpl3+)))
>result: FAIL
>
>Full log: https://ci.guix.gnu.org/build/117996/log/raw
>
>Seems related to f7008ca71351e5368a7c1c5bc3fe88fb80b01298
>
>This patch fixes the issue but I am not sure it retains the test's
>original intent:
>
>diff --git a/tests/print.scm b/tests/print.scm
>index 3386590d3a..85735cf9ae 100644
>--- a/tests/print.scm
>+++ b/tests/print.scm
>@@ -19,7 +19,7 @@
> (define-module (test-print)
>   #:use-module (guix import print)
>   #:use-module (guix build-system gnu)
>-  #:use-module (guix download)
>+  #:use-module (guix build download)
>   #:use-module (guix packages)
>   #:use-module ((guix licenses) #:prefix license:)
>   #:use-module (srfi srfi-64))
>
>Let me know!
>
>Thank you
[Message part 2 (text/html, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#47375; Package guix. (Thu, 25 Mar 2021 04:00:02 GMT) Full text and rfc822 format available.

Message #11 received at 47375 <at> debbugs.gnu.org (full text, mbox):

From: Chris Marusich <cmmarusich <at> gmail.com>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 47375 <at> debbugs.gnu.org, Léo Le Bouter <lle-bout <at> zaclys.net>,
 Ludovic Courtès <ludo <at> gnu.org>
Subject: Re: bug#47375: guix test failure: tests/print
Date: Wed, 24 Mar 2021 20:59:41 -0700
[Message part 1 (text/plain, inline)]
Hi,

Julien Lepiller <julien <at> lepiller.eu> writes:

> I don't think this is the right fix. Now you define packages with the
> incorrect url-fetch, so the test passes, but package->code would still
> not work as intended on actual packages that are properly defined.
>
> It seems that the issue is package->code uses the internal name
> url-fetch* whereas it should be the exported name url-fetch. I think
> this is a legitimate bug in package->code and your patch incorrectly
> hides it.

I think Julien is correct.  The url-fetch* procedure from
guix/download.scm is here:

(define* (url-fetch* url hash-algo hash
                     #:optional name
                     #:key (system (%current-system))
                     (guile (default-guile))
                     executable?)
  "Return a fixed-output derivation that fetches data from URL (a string, or a
list of strings denoting alternate URLs), which is expected to have hash HASH
of type HASH-ALGO (a symbol).  By default, the file name is the base name of
URL; optionally, NAME can specify a different file name.  When EXECUTABLE? is
true, make the downloaded file executable.
...

And the url-fetch procedure from guix/build/download.scm is here:

(define* (url-fetch url file
                    #:key
                    (timeout 10) (verify-certificate? #t)
                    (mirrors '()) (content-addressed-mirrors '())
                    (hashes '())
                    print-build-trace?)
  "Fetch FILE from URL; URL may be either a single string, or a list of
string denoting alternate URLs for FILE.  Return #f on failure, and FILE
on success.
...

They do different things, even though they share the same name.  The
problem, apparently introduced with commit
f7008ca71351e5368a7c1c5bc3fe88fb80b01298, is that before the change,
package->code produced code that uses url-fetch, and after the change,
it produced code that uses url-fetch*.

Reverting the change fixes it.  I reverted it and tested it, and it does
fix the test.  I wonder if we can just revert it for now?  What do you
think, Ludo?

In guix/import/print.scm, package->code generates the code by invoking
(origin-method source) to get the origin's "method", and then invoking
(procedure-name method) on the method thus obtained.  It seems that
procedure-name returns the name "url-fetch*" (the name used privately in
the (guix download) module), but it should be returning the name
"url-fetch" (the public name exported by the (guix download) module).

I wonder if there is any way to get the public name of the procedure
programmatically, instead of the private one?

-- 
Chris
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#47375; Package guix. (Thu, 25 Mar 2021 07:56:02 GMT) Full text and rfc822 format available.

Message #14 received at 47375 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Chris Marusich <cmmarusich <at> gmail.com>, Julien Lepiller <julien <at> lepiller.eu>
Cc: 47375 <at> debbugs.gnu.org
Subject: Re: bug#47375: guix test failure: tests/print
Date: Thu, 25 Mar 2021 08:55:20 +0100
[Message part 1 (text/plain, inline)]
On Wed, 2021-03-24 at 20:59 -0700, Chris Marusich wrote:
> [..]
> 
> In guix/import/print.scm, package->code generates the code by invoking
> (origin-method source) to get the origin's "method", and then invoking
> (procedure-name method) on the method thus obtained.  It seems that
> procedure-name returns the name "url-fetch*" (the name used privately in
> the (guix download) module), but it should be returning the name
> "url-fetch" (the public name exported by the (guix download) module).
> 
> I wonder if there is any way to get the public name of the procedure
> programmatically, instead of the private one?

I believe there isn't, and I have spent some time around Guile's module
system.  Note that one could do ...

<start guile code>
(define-module (mod)
  #:export (x y z))

(define (fun) 'stuff)
(define x fun)
(define y fun
(define z fun)
<end guile code>

... in which case there would be more than one "public name".

However, there's a possible work-around.  It is change the procedure name
of a procedure, with the following

(define name (let ((visible-name (lambda () 'stuff))) visible-name))
(procedure-name name) ; -> visible-name

Patch attached (though written against a somewhat outdated tree).
Does this patch fixes the issue? (I'm not in the loop.)

Greetings, Maxime.
[0001-guix-Let-the-procedure-name-of-url-fetch-be-what-gui.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#47375; Package guix. (Thu, 25 Mar 2021 08:17:02 GMT) Full text and rfc822 format available.

Message #17 received at 47375 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Chris Marusich <cmmarusich <at> gmail.com>, Julien Lepiller <julien <at> lepiller.eu>
Cc: 47375 <at> debbugs.gnu.org
Subject: Re: bug#47375: guix test failure: tests/print
Date: Thu, 25 Mar 2021 09:15:56 +0100
[Message part 1 (text/plain, inline)]
Oops I messed up the commit message in the patch.
Revised patch is attached.
[0001-guix-Let-the-procedure-name-of-url-fetch-be-what-gui.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Thu, 25 Mar 2021 23:24:01 GMT) Full text and rfc822 format available.

Notification sent to Léo Le Bouter <lle-bout <at> zaclys.net>:
bug acknowledged by developer. (Thu, 25 Mar 2021 23:24:02 GMT) Full text and rfc822 format available.

Message #22 received at 47375-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 47375-done <at> debbugs.gnu.org, Julien Lepiller <julien <at> lepiller.eu>,
 Chris Marusich <cmmarusich <at> gmail.com>
Subject: Re: bug#47375: guix test failure: tests/print
Date: Fri, 26 Mar 2021 00:23:11 +0100
Hi!

Instead of renaming ‘url-fetch*’, I changed the thing that guesses the
procedure name so that it preferable uses the procedure’s public name,
rather than the name it has within its module.  Done in
96aa98b6ca78ffb798e309acac3c3e5068422f30.

Thanks, and apologies for the breakage!

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#47375; Package guix. (Thu, 25 Mar 2021 23:25:01 GMT) Full text and rfc822 format available.

Message #25 received at 47375 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Léo Le Bouter <lle-bout <at> zaclys.net>
Cc: 47375 <at> debbugs.gnu.org
Subject: Re: bug#47375: guix test failure: tests/print
Date: Fri, 26 Mar 2021 00:24:19 +0100
Léo Le Bouter <lle-bout <at> zaclys.net> skribis:

> Full log: https://ci.guix.gnu.org/build/117996/log/raw

Speaking of which: please always build packages before pushing.  :-)

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#47375; Package guix. (Thu, 25 Mar 2021 23:28:02 GMT) Full text and rfc822 format available.

Message #28 received at 47375 <at> debbugs.gnu.org (full text, mbox):

From: Léo Le Bouter <lle-bout <at> zaclys.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 47375 <at> debbugs.gnu.org
Subject: Re: bug#47375: guix test failure: tests/print
Date: Fri, 26 Mar 2021 00:27:37 +0100
[Message part 1 (text/plain, inline)]
On Fri, 2021-03-26 at 00:24 +0100, Ludovic Courtès wrote:
> Léo Le Bouter <lle-bout <at> zaclys.net> skribis:
> 
> > Full log: https://ci.guix.gnu.org/build/117996/log/raw
> 
> Speaking of which: please always build packages before pushing.  :-)
> 
> Thanks,
> Ludo’.

I ran 'guix pull' but turns out that wasnt sufficient.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#47375; Package guix. (Sun, 28 Mar 2021 16:26:01 GMT) Full text and rfc822 format available.

Message #31 received at 47375 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Léo Le Bouter <lle-bout <at> zaclys.net>
Cc: 47375 <at> debbugs.gnu.org
Subject: Re: bug#47375: guix test failure: tests/print
Date: Sun, 28 Mar 2021 18:25:37 +0200
Hi,

Léo Le Bouter <lle-bout <at> zaclys.net> skribis:

> On Fri, 2021-03-26 at 00:24 +0100, Ludovic Courtès wrote:
>> Léo Le Bouter <lle-bout <at> zaclys.net> skribis:
>> 
>> > Full log: https://ci.guix.gnu.org/build/117996/log/raw
>> 
>> Speaking of which: please always build packages before pushing.  :-)
>> 
>> Thanks,
>> Ludo’.
>
> I ran 'guix pull' but turns out that wasnt sufficient.

When updating the ‘guix’ package, what you need to run is:

  ./pre-inst-env guix build guix

It’s similar to other packages.

In general, we update it when there are changes to the daemon and its
helper programs (‘guix substitute’, etc.).  These are pretty much the
only reasons to update it.

HTH!

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#47375; Package guix. (Sun, 28 Mar 2021 16:32:01 GMT) Full text and rfc822 format available.

Message #34 received at 47375 <at> debbugs.gnu.org (full text, mbox):

From: Léo Le Bouter <lle-bout <at> zaclys.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 47375 <at> debbugs.gnu.org
Subject: Re: bug#47375: guix test failure: tests/print
Date: Sun, 28 Mar 2021 18:31:03 +0200
[Message part 1 (text/plain, inline)]
On Sun, 2021-03-28 at 18:25 +0200, Ludovic Courtès wrote:
> When updating the ‘guix’ package, what you need to run is:
> 
>   ./pre-inst-env guix build guix
> 
> It’s similar to other packages.
> 
> In general, we update it when there are changes to the daemon and its
> helper programs (‘guix substitute’, etc.).  These are pretty much the
> only reasons to update it.

Thanks will make sure to do that. I was a bit tired and I think I
misunderstood something in a discussion with Lfam on IRC that made me
only run 'guix pull' and restart guix-daemon.

Note, the reason I upgraded the 'guix' package here was to fix 'guix
pull' from older installations on powerpc64le-linux machines of mine.

Léo
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 26 Apr 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 359 days ago.

Previous Next


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