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>, 73073@debbugs.gnu.org
Cc: Vivien Kraus <vivien@planete-kraus.eu>,
	Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: [bug#73073] [PATCH 4/6] gnu: gnome-recipes: Move libgd origin from phases to native-inputs.
Date: Fri, 06 Sep 2024 22:14:02 +0200	[thread overview]
Message-ID: <7618cf89ae284480e97374a13b288a6dc209fb81.camel@gmail.com> (raw)
In-Reply-To: <8734mcire8.fsf@gmail.com>

Am Freitag, dem 06.09.2024 um 20:11 +0200 schrieb Simon Tournier:
> Hi Liliana,
> 
> My aim is not to mix, under ’inputs’ record field, the old style
> (label) with the new style (no label) but to have the ’origin’ inside
> ’inputs’ and not inside ’arguments’.
Sure, but you do introduce a label to make that work is what I'm
saying.

> As I wrote in the cover letter:
> 
>         This is annoying because these origins are hidden from
>         ’package-direct-sources’; see module (guix packages).
> 
> So it helps the package. ;-)
> 
> Please note that the docstring of ’package-direct-sources’ is
> currently lying. ;-)  Well, the situation is a bug, IMHO.
I think we should fix ‘package-direct-sources’ then.  The derivation
obviously knows about this input, otherwise the package wouldn't be
built, so the information is there.  I'd also hazard a guess that Rust
being Rust, no useful information for Rust packages comes with package-
direct-inputs if arguments aren't being handled.

> --8<---------------cut here---------------start------------->8---
>   "Return all source origins associated with PACKAGE; including
> origins in PACKAGE's inputs and patches."
> --8<---------------cut here---------------end--------------->8---
> 
> 
> > IMHO, G-Expressions in phases serve in part to facilitate uses like
> > this.
> 
> I agree that G-exps facilitate manipulation of store paths.  But
> using ’origin’ inside arguments appears to me as an abuse of the
> feature.  As I wrote in the cover letter:
> 
>         Moreover and tangentially, it appears to me an anti-pattern
> of the
>         functional paradigm: The data from the impure outside should
> be handled
>         by the ’source’ record field, or otherwise by ’inputs’,
> ’native-inputs’
>         or ’propagated-inputs’ record fields; let say only ’inputs’
> for
>         simplicity.
> 
> Therefore, I strongly think ’origin’ should not be inside arguments.
We could handle it in source at the cost of similar anti-patterns, or
in inputs at the cost of the anti-pattern you suggest.  The Right
Thing™ would be to unbundle these dependencies correctly.

Also note that your argument would apply to #$this-package-input just
as well: it still is magic that pulls in data from the impure outside
world, and you can trivially trick it into doing silly things.  (Just
add inheritance.)

> Somehow, my submission is a proposal for dealing with the case.  And
> it’s not really if it needs to, or should, be done. :-)
You are working on the implicit assumption that everyone agrees that it
needs to be done, then.  

> >               Particularly, we're now even adding a labeled input,
> > which makes for a cursed situation where all but one inputs are
> > unlabeled¹.
> 
> Please note it’s a specific inputs: it’s an ’origin’.  This can be
> checked by the pattern matching, e.g.,
> 
>     (((? string? label) (? origin? o) ;Allow old style as sometimes
> requires by origin in inputs
>      `(,label ,o))
> 
> Other said, it would not be a “cursed situation”; only a situation
> using a locally defined input.
It *is* a cursed situation for the person reading the inputs field. 
Apart from proper unbundling, some other workarounds would be:
- hacking around search-input-file
- making dummy data packages
- named origins (this one requires similar support code to be written
  and has already been rejected once IIRC)
- computed origins
And yes, I label them as workarounds, since they don't address the root
cause of why origins are introduced in arguments.

Sometimes, practicality beats purity: Consider the ungoogled-chromium
recipe if you hadn't had a good scare today.  The fact that this
pattern shows up as rarely as it does is a testament to how well Guix
functions otherwise – but there might still be a need for it in some
fringe circumstances.  I'd rather we don't change code unless the
result is clearly better™, and I don't see that here.

Cheers




  reply	other threads:[~2024-09-06 20:16 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 [this message]
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
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=7618cf89ae284480e97374a13b288a6dc209fb81.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=73073@debbugs.gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    --cc=vivien@planete-kraus.eu \
    --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.