unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: 55139@debbugs.gnu.org
Subject: bug#55139: package-location is wrong for transformed packages
Date: Mon, 02 May 2022 22:57:45 +0200	[thread overview]
Message-ID: <87pmkvr6t2.fsf@gnu.org> (raw)
In-Reply-To: <8735hz2t4u.fsf@gmail.com> (Maxim Cournoyer's message of "Tue, 26 Apr 2022 21:48:49 -0400")

Hi,

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

>> ,import (gnu packages) (guix packages)
>> (car (find-packages-by-name "python2-pyalsaaudio"))
> $1 = #<package python2-pyalsaaudio@0.8.4 gnu/packages/audio.scm:4327 7f2b76fab160>
>> (package-definition-location-code package $1)
> $2 = #f
>> (package-definition-location $2)
> $3 = #<<location> file: "gnu/packages/audio.scm" line: 4327 column: 2>
>
>
> This is wrong though, and gives the location of the parent package (the
> one it inherited from).  This seems to be made on purpose (?) given the
> code in (gnu build-system python):
>
> (package/inherit p
>         (location (package-location p))
>
>         ^ Here, we explicitly set the location to that of its parent.

Indeed, that’s on purpose; the rationale is that it’s more useful to see
the location of the original package (the Python 3 variant) than always
this one line in gnu/build-system/python.scm.

> Another related issue for package-with-python2 packages:
>
>> (package-definition-location-code $1)
> $4 = #f

Yes, I see it’s annoying, but that’s expected.

> I was expecting to use this to get rid of all leaf Python 2 packages,
> but it seems that may not work (as easily as I'd hoped).

You were willing to have a script that would automatically delete the
relevant lines, right?

It’s kinda silly but I think the script will have to estimate the
definition location by looking for “(define-public python2-…”.

HTH,
Ludo’.




  parent reply	other threads:[~2022-05-02 20:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27  1:48 bug#55139: package-location is wrong for transformed packages Maxim Cournoyer
2022-04-27 12:23 ` Liliana Marie Prikler
2022-05-02 20:57 ` Ludovic Courtès [this message]
2022-05-22  5:16   ` Maxim Cournoyer
2022-05-23 13:28     ` Ludovic Courtès
2022-06-08 21:29       ` Maxim Cournoyer

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=87pmkvr6t2.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=55139@debbugs.gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /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).