Subject: Re: bug#55186: package-definition-location is wrong for inherited packages

From: Ludovic Courtès <[email-masked]>
Date: Mon, 02 May 2022 23:04:38 +0200

Hi,

Maxim Cournoyer <[email-masked]> skribis:

> Here's another problem with source location I've discovered when
> attempting to locate the source of `python2-pytest-warnings', which
> reads like:
>
> (define-public python2-pytest-warnings
>   (package (inherit (package-with-python2
>                      (strip-python2-variant python-pytest-warnings)))
>            (properties `((superseded . ,python2-pytest)))))

It works for me:

--8<---------------cut here---------------start------------->8---
$ guix repl
GNU Guile 3.0.8
Copyright (C) 1995-2021 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guix-user)> ,use(guix)
scheme@(guix-user)> ,use(gnu packages check)
scheme@(guix-user)> (package-definition-location python2-mock )
$1 = #<<location> file: "gnu/packages/check.scm" line: 882 column: 0>
scheme@(guix-user)> (package-definition-location python2-nose )
$2 = #<<location> file: "gnu/packages/check.scm" line: 917 column: 0>
scheme@(guix-user)> (package-definition-location python2-nose2 )
$3 = #f
scheme@(guix-user)> ,q
$ guix describe
Generation 214  May 02 2022 21:44:14    (current)
  guix 6b588da
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: 6b588da368c77cde82ea2f22ca315116228777ad
--8<---------------cut here---------------end--------------->8---

Note that ‘python2-nose2’ has #f.  This is because it’s defined without
a literal (package …) form:

--8<---------------cut here---------------start------------->8---
(define-public python2-nose2
  (package-with-python2 python-nose2))
--8<---------------cut here---------------end--------------->8---

It’s OK for the initial use case of ‘package-definition-location’, which
was the ‘generic-git’ updater.

Not sure if it helps, but I hope it does anyway.  :-)

Ludo’.