all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: "Simon Tournier" <zimon.toutoune@gmail.com>,
	"Ludovic Courtès" <ludo@gnu.org>
Cc: maxim.cournoyer@gmail.com, 73073@debbugs.gnu.org
Subject: [bug#73073] [PATCH 0/6] Allow origin with label as inputs.
Date: Sat, 07 Sep 2024 16:49:36 +0200	[thread overview]
Message-ID: <be90ee374740f7fe6d06f3a31d559e5d11240143.camel@gmail.com> (raw)
In-Reply-To: <875xr7r38x.fsf@gmail.com>

Hi Simon,

since you pointed me here, I will chime in a little :)

Am Samstag, dem 07.09.2024 um 15:40 +0200 schrieb Simon Tournier:
> Hi Ludo,
> 
> On Fri, 06 Sep 2024 at 23:45, Ludovic Courtès <ludo@gnu.org> wrote:
> 
> > This is one reason why I’d rather avoid the change you’re
> > suggesting.
> > But more importantly: I think we should avoid polymorphic lists for
> > clarity (the principle is followed in most of the code), and
> > reintroducing labels would be a step backwards.
> 
> This is inaccurate: inputs are already polymorphic lists.  For
> example,
> 
>     (native-inputs (list desktop-file-utils ;for update-desktop-
> database
>                          gettext-minimal
>                          `(,glib "bin")
>                          itstool
>                          pkg-config
>                          python))
> 
> And “bin” is a label, AFAIU.  That’s said…
Not in the sense that you are addressing inputs with it, no.  "bin" is
an output selector (output "label" if you will) – its purpose it to
choose an output that isn't "out".

> > To be clear, I understand the current situation is not perfect, but
> > I would rather look for solutions that do not involve undoing
> > what’s taken this long to do.
> 
> …I agree: my aim is not to revive the “old style”.  Aside, from my
> perspective, the main issue with the “old style” is not the labels
> but instead it’s the redundancy.
> 
> In other words, labels are not the evil since they are still used for
> dealing with “outputs”.
> 
> Anyway, let avoid the Walder’s law trap [1]. ;-)
> 
> So let do not rely on explicit labels.
But you are adding explicit labels here.  A solution that doesn't would
be much preferred.

> > The main issue we want to address here is origins being hidden from
> > ‘package-direct-sources’, right?
> 
> Yes…  And also I think that’s a bad pattern to not have all “inputs“
> in the same place. From my point of view, the current situation
> defeats my understanding of declarative programming.
I agree with you that inputs outside of inputs should be avoided, but I
disagree with your point on declarative programming.  Packages, even
written in that style, are still declarative.

> > diff --git a/guix/packages.scm b/guix/packages.scm
> > index f373136d22..8b08f0d379 100644
> > --- a/guix/packages.scm
> > +++ b/guix/packages.scm
> > @@ -676,6 +676,8 @@ (define (add-input-label input)
> >                "_")
> >           ,obj
> >           ,@(if (string=? output "out") '() (list output)))))
> > +    ((? origin? origin)
> > +     (list (or (origin-actual-file-name origin) "_") origin))
> >      (x
> >       `("_" ,x))))
> >  
> > 
> > … meaning we could write (this-package-input "git-manpages.tar.gz")
> > or similar.  (This particular change would need tweaks in a few
> > packages such as ‘tzdata’ to avoid a full rebuild.)
> 
> This solution appears to me the best approach.  Somehow, it uses
> ’file-name’ as internal “label”.  When internal “labels” will
> completely removed, e.g., using package name or else, we will adapt.
> 
> Well, ’origin-actual-file-name’ returns for example
> "libgd-2.0.4-checkout", i.e. the version would be required when
> calling ’this-package-input’.  Therefore, it would mean something
> like:
> 
>     #$(this-package-native-input (git-file-name "libgd" version))
> 
> This appears to me a good solution.
It doesn't to me.  What do you do if the libgd version changes?  To
arrive at a proper label, you would have to strip the versioning and
packaging metadata – otherwise you're left with a situation, where you
can't replace the package by tweaking inputs anyway.

> However, how is it possible to avoid a full rebuild because ’tzdata’
> or else?  It means the package definition cannot be modified, right?
> Therefore, the only way would to special case ’maybe-add-input-
> labels’, e.g.,
> 
> --8<---------------cut here---------------start------------->8---
> @@ -441,6 +441,9 @@ (define (maybe-add-input-labels inputs)
>    "Add labels to INPUTS unless it already has them."
>    (cond ((null? inputs)
>           inputs)
> +        ((and (pair? (car inputs))
> +              (origin? (cdar inputs)) )
> +         inputs)
>          ((and (pair? (car inputs))
>                (string? (caar inputs)))
>           inputs)
> --8<---------------cut here---------------end--------------->8---
> 
> Would it be ok performance-wise?  Or what could the another option?
I don't think this does what you think it does.
It returns inputs as-is if the tail of the first input is an origin…
which I don't think would be the case even if we do implement your v1.


Cheers




  reply	other threads:[~2024-09-07 14:51 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-06 15:51 [bug#73073] [PATCH 0/6] Allow origin with label as inputs Simon Tournier
2024-09-06 15:54 ` [bug#73073] [PATCH 1/6] guix: packages: " Simon Tournier
2024-09-06 15:54 ` [bug#73073] [PATCH 2/6] gnu: dmd-bootstrap: Move phobos origin from phases to native-inputs Simon Tournier
2024-09-06 15:54 ` [bug#73073] [PATCH 3/6] gnu: smithforth: Move system.fs " Simon Tournier
2024-09-06 15:54 ` [bug#73073] [PATCH 4/6] gnu: gnome-recipes: Move libgd " Simon Tournier
2024-09-06 17:33   ` Liliana Marie Prikler
2024-09-06 18:11     ` Simon Tournier
2024-09-06 20:14       ` Liliana Marie Prikler
2024-09-07 11:37         ` Simon Tournier
2024-09-06 15:54 ` [bug#73073] [PATCH 5/6] gnu: farstream: Move common " Simon Tournier
2024-09-06 15:54 ` [bug#73073] [PATCH 6/6] gnu: gnulib: Move phobos " Simon Tournier
2024-09-06 21:45 ` [bug#73073] [PATCH 0/6] Allow origin with label as inputs Ludovic Courtès
2024-09-07 13:40   ` Simon Tournier
2024-09-07 14:49     ` Liliana Marie Prikler [this message]
2024-09-16 20:13     ` Ludovic Courtès
2024-09-10  1:27 ` [bug#73073] [PATCH v2 0/8] Allow origin inside inputs with "new style" Simon Tournier
2024-09-10  1:27   ` [bug#73073] [PATCH v2 1/8] guix: packages: " Simon Tournier
2024-09-16 20:19     ` Ludovic Courtès
2024-09-16 20:42       ` Simon Tournier
2024-09-26 13:30         ` Maxim Cournoyer
2024-09-10  1:27   ` [bug#73073] [PATCH v2 2/8] gnu: gnome-recipes: Move libgd origin from phases to native-inputs Simon Tournier
2024-09-10  4:30     ` Liliana Marie Prikler
2024-09-10  7:58       ` Simon Tournier
2024-09-10  1:27   ` [bug#73073] [PATCH v2 3/8] gnu: dmd-bootstrap: Move phobos " Simon Tournier
2024-09-10  1:27   ` [bug#73073] [PATCH v2 4/8] gnu: smithforth: Move system.fs " Simon Tournier
2024-09-10  1:27   ` [bug#73073] [PATCH v2 5/8] gnu: farstream: Move common " Simon Tournier
2024-09-10  1:27   ` [bug#73073] [PATCH v2 6/8] gnu: gnulib: Move phobos " Simon Tournier
2024-09-10  1:27   ` [bug#73073] [PATCH v2 7/8] gnu: git: Move git-manpages " Simon Tournier
2024-09-10  1:27   ` [bug#73073] [PATCH v2 8/8] gnu: cgit: Remove input labels Simon Tournier

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=be90ee374740f7fe6d06f3a31d559e5d11240143.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=73073@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    --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.