Subject: Re: bug#67048: guix refresh -u -L does not work with relative path

From: Simon Tournier <[email-masked]>
Date: Tue, 14 Nov 2023 18:52:53 +0100

Hi,

On Mon, 13 Nov 2023 at 19:28, Simon Tournier <[email-masked]> wrote:

>>    guix refresh -u -L proj python-numpy-illustrated
>> yields the error
>> proj/example.scm:10:2: python-numpy-illustrated: updating from version 0.3 to version 0.3.1...
>> proj/example.scm:10:2: warning: python-numpy-illustrated: no `version' field in source; skipping

As mentioned in [1], the issue is from ’search-path’ – it returns #false
– it is involved in several layers.

See <https://issues.guix.gnu.org/67048#3> for a patch proposal.

Some details: When invoking “guix refresh” (guix scripts refresh):

 + It calls the procedure ’update-package’

  + which calls ’update-package-source’; see guix/upstream.scm

    + which calls ’package-field-location’; see guix/package.scm

     (match (search-path %load-path file)
       ((? string? file-found)
[...]
       (#f
        ;; FILE could not be found in %LOAD-PATH.
        #f)))

  -> Therefore in ’update-package-source’, the variable ’version-loc’ is
     false:

            (version-loc (package-field-location package 'version)))
        (if version-loc

  + Once fixed, later in ’update-package-source’, it reads,

               (file        (and=> (location-file loc)
                                   (cut search-path %load-path <>))))
          (if file

  -> Therefore, the variable ’file’ is false.

     + Once fixed, later in ’update-package-source’ it calls
     ’absolute-location’; see guix/diagnostics.scm.

            (if (string-prefix? "/" (location-file loc))
[...]
                (match (search-path %load-path (location-file loc))
                  (#f
                   (raise (formatted-message

Well, I do not know how to do better than
<https://issues.guix.gnu.org/67048#3>.

WDYT?

Cheers,
simon

1: bug#67048: guix refresh -u -L does not work with relative path
Simon Tournier <[email-masked]>
Mon, 13 Nov 2023 19:28:25 +0100
id:[email-masked]
https://issues.guix.gnu.org/67048
https://issues.guix.gnu.org/msgid/[email-masked]
https://yhetil.org/guix/[email-masked]