unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Chris Marusich <cmmarusich@gmail.com>
To: Julien Lepiller <julien@lepiller.eu>
Cc: 47375@debbugs.gnu.org
Subject: bug#47375: guix test failure: tests/print
Date: Wed, 24 Mar 2021 20:59:41 -0700	[thread overview]
Message-ID: <87im5f7uj6.fsf@gmail.com> (raw)
In-Reply-To: <C3C79618-8D9C-4830-BD49-BC2994CEBBE1@lepiller.eu> (Julien Lepiller's message of "Wed, 24 Mar 2021 21:54:48 -0400")

[-- Attachment #1: Type: text/plain, Size: 2683 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

  reply	other threads:[~2021-03-25  4:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25  1:44 bug#47375: guix test failure: tests/print Léo Le Bouter via Bug reports for GNU Guix
2021-03-25  1:54 ` Julien Lepiller
2021-03-25  3:59   ` Chris Marusich [this message]
2021-03-25  7:55     ` Maxime Devos
2021-03-25  8:15       ` Maxime Devos
2021-03-25 23:23         ` Ludovic Courtès
2021-03-25 23:24 ` Ludovic Courtès
2021-03-25 23:27   ` Léo Le Bouter via Bug reports for GNU Guix
2021-03-28 16:25     ` Ludovic Courtès
2021-03-28 16:31       ` Léo Le Bouter via Bug reports for GNU Guix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87im5f7uj6.fsf@gmail.com \
    --to=cmmarusich@gmail.com \
    --cc=47375@debbugs.gnu.org \
    --cc=julien@lepiller.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).