unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Julien Lepiller <julien@lepiller.eu>
Cc: 44344@debbugs.gnu.org
Subject: [bug#44344] [PATCH] guix: describe: Improve package provenance tracking.
Date: Sat, 31 Oct 2020 18:30:07 +0100	[thread overview]
Message-ID: <87pn4ytiao.fsf@gnu.org> (raw)
In-Reply-To: <20201031144007.25531-1-julien@lepiller.eu> (Julien Lepiller's message of "Sat, 31 Oct 2020 15:40:07 +0100")

Hi Julien,

Julien Lepiller <julien@lepiller.eu> skribis:

> %load-path lists ~/.config/guix/current before individual channels.  We
> use canonicalize-path to get the store path for channel packages.
>
> * guix/describe.scm (package-provenance): Use canonicalize-path.

[...]

>       (let ((file (if (string-prefix? "/" file)
>                       file
> -                     (search-path %load-path file))))
> +                     (canonicalize-path (search-path %load-path file)))))

Could you explain what problem it solves, perhaps with a simple reproducer?

‘search-path’ can return #f (there’s a test right below), so this should
probably be: (and=> (search-path …) canonicalize-path).

As a rule of thumb, I think twice before calling ‘canonicalize-path’
because (1) it’s expensive (lots of stat(2) calls), and (2) it can have
undesirable effects on the UI (messages mention a file name other than
the one the user typed) and elsewhere (on logic that looks at what the
file name looks like).

Maybe it’s OK here, but I mention this for completeness.

Thanks,
Ludo’.




  reply	other threads:[~2020-10-31 17:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31 14:40 [bug#44344] [PATCH] guix: describe: Improve package provenance tracking Julien Lepiller
2020-10-31 17:30 ` Ludovic Courtès [this message]
2020-11-01 13:29   ` Julien Lepiller
2020-11-02 16:15     ` Ludovic Courtès
2020-11-02 16:42       ` Julien Lepiller
2020-11-03  9:17         ` Ludovic Courtès
2020-11-03 11:25           ` bug#44344: " Julien Lepiller

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=87pn4ytiao.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=44344@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).