unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Mark H Weaver <mhw@netris.org>,
	50620@debbugs.gnu.org, zimoun <zimon.toutoune@gmail.com>
Subject: [bug#50620] [PATCH 0/2] Unify 'computed-origin-method' (linux, icecat)
Date: Thu, 30 Sep 2021 01:44:37 +0200	[thread overview]
Message-ID: <09c009ec61b8f9c1746f98916f492b8953b16dcc.camel@gmail.com> (raw)
In-Reply-To: <87pmsr5a0z.fsf_-_@gnu.org>

Hi Ludo,

Am Mittwoch, den 29.09.2021, 23:47 +0200 schrieb Ludovic Courtès:
> [...]
> 
> > but zimoun and I still disagree on the target.  zimoun says (guix
> > packages) for reasons unknown to me, whereas I say (gnu packages),
> > because it's closer to where it's used and doesn't imply that this
> > is
> > going to be a part of the (guix) download schemes anytime soon.
> 
> (gnu packages) is higher-level: it’s part of the distro and includes
> CLI helpers such as ‘specification->package’.  So I think (guix …) is
> somewhat more appropriate.
> 
> (That said, what matters more to me is how we’re going to replace it
> with a proper solution.)
(gnu packages) being high-level is part of the reason I want it there. 
Stuff that's hidden quite deep inside (guix something) will be slower
to change and replace with the proper solution.  When you pull on a
lever, the outside moves faster :)

> > > A better solution IMO would be to improve the ‘snippet’ mechanism
> > > in the first place.  ‘computed-origin-method’ improves on it in
> > > two ways: (1) lazy evaluation of the gexp, and (2) allows the use
> > > of a different base name.
> > > 
> > > I would think #2 is addressed by the ‘file-name’ field (isn’t
> > > it?).
> > > 
> > > As for #1, it can be addressed by making the ‘snippet’ field
> > > delayed or thunked.  It’s a one line change; the only thing we
> > > need is to measure, or attempt to measure, the impact it has on
> > > module load time.
> > > 
> > > Thoughts?
> > This would work for packages, whose source are some base source
> > with patches or snippets applied, as is indeed the case for linux
> > and icecat.  However, there are also other potential uses for
> > computed origins.
> 
> It’s hard for me to talk about potential uses in the abstract.  :-)
> 
> There might be cases where an origin simply isn’t the right tool and
> one would prefer ‘computed-file’ or something else.  It really
> depends on the context.
> 
> [...]
> 
> > I think that some version of `computed-origin-method' will
> > eventually need to become public API as such packages may not
> > always be best described as "a base package with a snippet".  If we
> > had recursive origins – i.e. origins, that can take origins as
> > inputs – we might be able to do some of that, but I don't think it
> > would necessarily work for linux-libre or icecat, as with those you
> > don't want the tainted versions to be kept around.  Perhaps this
> > could be worked around by not interning the intermediate origins,
> > but only using their file-names inside the temporary directory in
> > which the snippet is applied?
> 
> “Recursive origins” are a bit of a stretch as a concept IMO; what you
> describe is a case where I’d probably use ‘computed-file’ instead.
In other words, we could/should use computed-file for linux-libre and
icecat?  If we reasonably can, would it make sense to use that in lieu
of computed-origin-method to actually advertise the existence of
computed-file to Guix users/packagers?

> > Another thing is that the final act of the linux-libre promise is
> > not the packing of the tarball, but the deblob-check.  Guix
> > currently lacks a way of modeling such checks in their origin, but
> > I'd argue it would need one if we wanted to do computed origins via
> > snippets.  This is not required by icecat and so one
> > "simplification" could be that computed-origin-method would not
> > require the user to create a tarball, but instead simply provide a
> > name for the tarball and a directory to create it from (via a
> > promise again).
> 
> Ah, I had overlooked that ‘deblob-check’ bit.  It could be that
> allowing for custom pack-and-repack procedures would be enough to
> address it.
I think asking users to supply their own implementation of a 200 line
long function to be a bit much to only do part of the job.  On the
other hand, the promise for linux-libre takes 400 lines and for icecat
more than 600, but I think there are some things we ought to factor
out.  Particularly, looking up tools like tar or gzip and even the
actual packing are always the same.

What we can't currently control is the top directory name and the
output name.  Both of that could be customized by supplying a "repack-
name" field, which is used as basis for the directory name and the
tarball name.
Another thing we can't easily control are extraneous inputs to the
patches, although the patch-inputs field *does* exist.

> > A combination of the above might make computed origins obsolete for
> > good, but the question remains whether that is a better
> > design.  What do y'all think?
> 
> The design goal is to have clearly identified types: <package>,
> <origin>, <operating-system>.  For each of these, we want some
> flexibility: build system, origin method, etc.  However, beyond some
> level of stretching, it may be clearer to just use the catch-all
> ‘computed-file’ or to devise a new type.  After all, that’s how
> <origin> came to be (we could have used <package> instead with a
> suitable build system).
> 
> There’s a tension between “purely declarative” and “flexible”, and
> it’s about striking a balance, subjectively.
To be fair, I did think that "computed-tarball" might be a good
abstraction in some sense, but on another hand origins are computed
tarballs with a record interface.

On a somewhat related note, origins have this weird situation going on
where some things like git or svn checkouts need to be defined through
them, whereas others may pass unhindered.  I feel that this contributes
to the equation of source = origin, that might have caused "computed-
origin-method" to exist in the first place.

What do you think?

Liliana





  reply	other threads:[~2021-09-29 23:45 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16 11:45 [bug#50620] [PATCH 0/2] Unify 'computed-origin-method' (linux, icecat) zimoun
2021-09-16 11:47 ` [bug#50620] [PATCH 1/2] guix: packages: Document 'computed-origin-method' zimoun
2021-09-16 11:47   ` [bug#50620] [PATCH 2/2] gnu: guix: Update to xxxx zimoun
2021-09-16 15:53   ` [bug#50620] [PATCH 1/2] guix: packages: Document 'computed-origin-method' Liliana Marie Prikler
2021-09-16 23:38   ` Mark H Weaver
2021-09-17  8:41     ` zimoun
2021-09-28  9:36       ` Mark H Weaver
2021-09-28 16:01         ` Liliana Marie Prikler
2021-09-28 16:37           ` zimoun
2021-09-28 17:24             ` Liliana Marie Prikler
2021-09-29  8:32               ` zimoun
2021-09-29 10:10                 ` Liliana Marie Prikler
2021-09-29 13:17                   ` zimoun
2021-09-29 14:36                     ` Liliana Marie Prikler
2021-09-29 17:48                       ` zimoun
2021-09-29 19:10                         ` Liliana Marie Prikler
2021-09-29 20:15                           ` zimoun
2021-09-29 22:13                             ` Liliana Marie Prikler
2021-09-29 23:31                               ` zimoun
2021-09-29 21:40                         ` Mark H Weaver
2021-09-29 22:45                           ` zimoun
2021-09-30  7:11                             ` Liliana Marie Prikler
2021-09-29 13:16         ` [bug#50620] [PATCH 0/2] Unify 'computed-origin-method' (linux, icecat) Ludovic Courtès
2021-09-29 15:34           ` Liliana Marie Prikler
2021-09-29 21:47             ` Ludovic Courtès
2021-09-29 23:44               ` Liliana Marie Prikler [this message]
2021-09-30  8:28                 ` Ludovic Courtès
2021-09-30 14:17                   ` Liliana Marie Prikler
2021-09-30 20:09                     ` Ludovic Courtès
2021-09-30 21:49                       ` Liliana Marie Prikler
2021-09-29 20:42           ` Mark H Weaver
2021-09-29 21:34             ` Ludovic Courtès
2021-09-30 22:17   ` bug#50620: " 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

  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=09c009ec61b8f9c1746f98916f492b8953b16dcc.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=50620@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    --cc=mhw@netris.org \
    --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 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).