From: Hilton Chain via Guix-patches via <guix-patches@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Josselin Poiret <dev@jpoiret.xyz>,
Simon Tournier <zimon.toutoune@gmail.com>,
Mathieu Othacehe <othacehe@gnu.org>,
Tobias Geerinckx-Rice <me@tobias.gr>,
Ricardo Wurmus <rekado@elephly.net>,
65062@debbugs.gnu.org, Christopher Baines <guix@cbaines.net>
Subject: [bug#65062] [PATCH core-updates 1/1] packages: Specify output in input label when it's not "out".
Date: Tue, 03 Oct 2023 17:13:34 +0800 [thread overview]
Message-ID: <87jzs4vzk1.wl-hako@ultrarare.space> (raw)
In-Reply-To: <87msxw1fw6.fsf@gnu.org>
Hi Ludo,
On Sat, 09 Sep 2023 06:03:53 +0800,
Ludovic Courtès wrote:
>
> Hi,
>
> Hilton Chain <hako@ultrarare.space> skribis:
>
> >> Hilton Chain <hako@ultrarare.space> skribis:
> >>
> >> > * guix/packages.scm (add-input-label): Specify output when it's not "out".
> >>
> >> [...]
> >>
> >> > + (list (string-append (package-name package) ":" output)
> >> > + package
> >> > + output)))
> >>
> >> The Grand Plan¹ is to eventually get rid of labels entirely (or almost:
> >> there’d still be input alists on the build side). As such, I thought we
> >> shouldn’t worry too much about what the actual label is. But perhaps
> >> you stumbled upon situations where this is a problem? Could you
> >> describe them?
>
> [...]
>
> > My main concern is that currently modify-inputs, this-package-input
> > and this-package-native-input operate on input labels and there would
> > be duplicated labels if adding multiple outputs of a package.
> >
> > For modify-inputs, I think there's no approach to solve this without
> > also specifying labels in inputs.
>
> Yes, good point.
>
> Another, more radical approach, would be to change semantics, whereby
> (inputs (list p)) would mean that all the outputs of ‘p’, not just
> “out”, are taken as inputs. That’d simplify inputs at the expense of
> precision, and (this-package-input NAME) would always be unambiguous.
>
> But maybe that’s too radical and uncertain.
>
> So all things considered, I guess you’re right and we should do what you
> propose.
Thank you!
> Minor issues:
>
> > --- a/guix/packages.scm
> > +++ b/guix/packages.scm
> > @@ -626,7 +626,13 @@ (define (add-input-label input)
> > ((? package? package)
> > (list (package-name package) package))
> > (((? package? package) output) ;XXX: ugly?
> > - (list (package-name package) package output))
> > + (if (string=? output "out")
> > + ;; (package "out") => ("package" package "out")
> > + (list (package-name package) package output)
> > + ;; (package "output") => ("package:output" package "output")
> > + (list (string-append (package-name package) ":" output)
> > + package
> > + output)))
>
> Rather write it as two separate clauses, without comments:
>
> (((? package? package) "out")
> …)
> (((? package? package) output)
> …)
>
> Could you also add a test case in ‘tests/packages.scm’ that would look
> up inputs by those labels?
I have thought about this patch again recently.
First of all, I didn't describe my own trouble clearly:
I wanted to put `this-package-input' into #$gcc:lib, but didn't know how. Now I
understand that (ungexp (this-package-input "gcc") "lib") can be used and input
labels are not quite related...
And then I realised that there's too much extra work in package definitions for
the label change.
So, how about looking up inputs by specification (name + version + output), and
falling back to input labels? I think this can address the issue regarding
multiple outputs and versions, while keeping compatible with existing behavior.
I'll send v2 for the change, with a different subject. Though I haven't written
new tests for it, the existing (tests packages) passes when applied to master
and no package definition needs changing at least for building guix.
Thanks
next prev parent reply other threads:[~2023-10-03 9:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-05 2:50 [bug#65062] [PATCH core-updates 0/1] Specify output in input label when it's not "out" Hilton Chain via Guix-patches via
2023-08-05 2:53 ` [bug#65062] [PATCH core-updates 1/1] packages: " Hilton Chain via Guix-patches via
2023-08-22 16:00 ` Ludovic Courtès
2023-08-24 3:42 ` Hilton Chain via Guix-patches via
2023-08-25 11:10 ` Josselin Poiret via Guix-patches via
2023-09-08 22:03 ` Ludovic Courtès
2023-10-03 9:13 ` Hilton Chain via Guix-patches via [this message]
2023-08-05 3:01 ` [bug#65062] [PATCH core-updates 0/1] " Hilton Chain via Guix-patches via
2023-08-05 3:19 ` Hilton Chain via Guix-patches via
2023-10-03 9:15 ` [bug#65062] [PATCH v2 core-updates 0/2] packages: Lookup inputs by specification Hilton Chain via Guix-patches via
2023-10-03 9:17 ` [bug#65062] [PATCH v2 core-updates 1/2] ui: package-specification->name+version+output: Move to (guix packages) Hilton Chain via Guix-patches via
2023-10-03 9:17 ` [bug#65062] [PATCH v2 core-updates 2/2] packages: Lookup inputs by specification Hilton Chain via Guix-patches via
2023-12-20 21:26 ` [bug#65062] [PATCH core-updates] " Ludovic Courtès
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87jzs4vzk1.wl-hako@ultrarare.space \
--to=guix-patches@gnu.org \
--cc=65062@debbugs.gnu.org \
--cc=dev@jpoiret.xyz \
--cc=guix@cbaines.net \
--cc=hako@ultrarare.space \
--cc=ludo@gnu.org \
--cc=me@tobias.gr \
--cc=othacehe@gnu.org \
--cc=rekado@elephly.net \
--cc=zimon.toutoune@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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.