From: "Gábor Boskovits" <boskovits@gmail.com>
To: Christopher Lemmer Webber <cwebber@dustycloud.org>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: Graft hooks
Date: Mon, 13 Aug 2018 09:19:47 +0200 [thread overview]
Message-ID: <CAE4v=pgpk5LiBrcrOHynaOw2n57N4unPvKw9AM2bCLMvyTFKQQ@mail.gmail.com> (raw)
In-Reply-To: <87ftzjf6un.fsf@dustycloud.org>
[-- Attachment #1: Type: text/plain, Size: 2774 bytes --]
Christopher Lemmer Webber <cwebber@dustycloud.org> ezt írta (időpont: 2018.
aug. 13., H, 2:28):
> Timothy Sample writes:
>
> > Hi Guix,
> >
> > I just submitted a patch for <https://bugs.gnu.org/30680>, but now I’m
> > wondering if there isn’t a more general way to solve the problem.
> >
> > The bug has to do with grafting and checksums. I know three bugs that
> > follow this theme: the one above (Racket), <https://bugs.gnu.org/19973>
> > (GDB), and <https://bugs.gnu.org/25752> (Go). The basic problem is that
> > these packages store checksums of files during build time. If they get
> > updated due to grafting, the files change, but the checksums do not.
> > The checksums become invalid, which causes other problems like trying to
> > update files in the store or asserting that debugging information is
> > invalid.
> >
> > The patch I submitted makes Racket assume that files in the store are
> > good. It patches Racket to skip checksum validation if it is checking a
> > file in the store. A similar approach could be taken for GDB and Go.
> >
> > It occurs to me that if we had some way to run package-specific code
> > during grafting we could solve problems like this easily and without
> > patching software that is not broken.
> >
> > The basic idea would be to add a field (or use a property) to the
> > package record. Let’s call it “graft-hook”. It would be Scheme code
> > that gets run after grafting takes place, giving us a chance to patch
> > special things like checksums. The hook would be passed the list of
> > files that were been modified during grafting. Then, in the Racket
> > package for example, I could write a graft-hook that updates the SHA-1
> > hash of each of the modified source files.
>
>
+1
I think this would be a good design choice.
We also gain back the security that the original check provides.
> This seems like a really good approach to me and seems also much nicer /
> safer in the long run than the solution in #30680 since it wouldn't just
> patch out the package in question's checks, it would correct them. That
> seems very good indeed to me.
>
> > Since grafting is done at the derivation level, the hook code would have
> > to be propagated down from the package level. I haven’t looked at all
> > the details yet, because maybe this is a bad idea and I shouldn’t waste
> > my time! :) My first impression is that it is not too tricky.
> >
> > Are these problems too specialized to deserve a general mechanism like
> > this? Let me know what you think!
> >
> >
> > -- Tim
>
> As said, it seems good to me. But I would be interested in what Mark
> would think, since he is mostly responsible for the grafts design.
>
>
[-- Attachment #2: Type: text/html, Size: 3672 bytes --]
next prev parent reply other threads:[~2018-08-13 7:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-12 19:49 Graft hooks Timothy Sample
2018-08-13 0:28 ` Christopher Lemmer Webber
2018-08-13 7:19 ` Gábor Boskovits [this message]
2018-08-20 9:12 ` Ludovic Courtès
2018-08-21 15:42 ` Timothy Sample
2018-08-22 14:21 ` Ludovic Courtès
2018-08-22 18:29 ` Timothy Sample
2018-08-24 10:09 ` Ludovic Courtès
2018-08-22 19:15 ` Christopher Lemmer Webber
2018-08-23 7:15 ` Mark H Weaver
2018-08-23 9:54 ` Gábor Boskovits
2018-08-24 10:17 ` Ludovic Courtès
2018-08-24 21:59 ` Mark H Weaver
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='CAE4v=pgpk5LiBrcrOHynaOw2n57N4unPvKw9AM2bCLMvyTFKQQ@mail.gmail.com' \
--to=boskovits@gmail.com \
--cc=cwebber@dustycloud.org \
--cc=guix-devel@gnu.org \
/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.