bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#47375: guix test failure: tests/print


From: Chris Marusich
Subject: bug#47375: guix test failure: tests/print
Date: Wed, 24 Mar 2021 20:59:41 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Hi,

Julien Lepiller <julien@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

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]