[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#44344] [PATCH] guix: describe: Improve package provenance tracking.
From: |
Ludovic Courtès |
Subject: |
[bug#44344] [PATCH] guix: describe: Improve package provenance tracking. |
Date: |
Sat, 31 Oct 2020 18:30:07 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
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’.