public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Zac Medico <zmedico@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [RFC] DIGESTS metadata variable for cache validation
Date: Sun, 15 Feb 2009 14:51:10 -0800	[thread overview]
Message-ID: <49989C5E.3020307@gentoo.org> (raw)
In-Reply-To: <498E17E6.8060407@gentoo.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Zac Medico wrote:
> Tiziano Müller wrote:
>> I'd recommend to prefix the digest with a "{TYPE}" (like for hashed
>> passwords) to be able to change the digest algorithm as needed
>> (especially in regards to the current SHA successor competition).
>> This allows a future package manager which might use SHA-3 for hashing
>> (once it's released) to still check old digests. Furthermore it would
>> allow for easier transition and only needs a definition of allowed
>> hashes instead of a specific one.
> 
> I like that idea. That way it's not necessary to bump the EAPI in
> order to change the hash function. So, a typical DIGESTS value might
> look like this:
> 
> SHA1 02021be38b a28b191904 3992945426 6ec21b29a3

While thinking about the implementation details, I realized that it
would be very useful to give the DIGESTS data a version identifier
that is independent of the EAPI. This will allow a package manager
to validate a cache entry that has been generated for an unsupported
EAPI, and allows it to trust that there's no point in regenerating
the cache entry (to see if the EAPI has changed since the last time
that it was generated). For example, suppose that we introduce EAPI
3 and a package manager that does not support EAPI 3 encounters a
cache entry for an EAPI 3 ebuild. If the package manager recognizes
the DIGESTS data version and it's able to validate the cache entry,
then it can avoid the cost of regenerating metadata for that ebuild.
If the user modifies the ebuild locally to change the EAPI to a
supported EAPI (from 3 to 2, for example), the DIGESTS data will
allow the package manager to recognize that the cache entry has been
invalidated and needs to be regenerated (and it will discover that
the EAPI has changed to a supported value).

So, if a "0" version identifier at the beginning of the DIGESTS
data, a typical entry could look like this:

0 SHA1 02021be38b a28b191904 3992945426 6ec21b29a3

Regardless of what the EAPI value happens to be, the package manager
should be able to trust that the version identifier is a reliable
indicator of the mechanism which should be used to validate the
integrity of the cache entry.
- --
Thanks,
Zac
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEARECAAYFAkmYnFwACgkQ/ejvha5XGaNTzQCdFyZpEBZhftEISVrBBT+DsOHv
JXEAn2KtO/g0KjQtQu8fuB8KGF9Krr/d
=TxtX
-----END PGP SIGNATURE-----



  parent reply	other threads:[~2009-02-15 22:50 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-02 20:34 [gentoo-dev] [RFC] DIGESTS metadata variable for cache validation Zac Medico
2009-02-06  9:55 ` [gentoo-dev] " Markus Ullmann
2009-02-07  1:13   ` Zac Medico
2009-02-07 22:31 ` [gentoo-dev] " Tiziano Müller
2009-02-07 23:23   ` Zac Medico
2009-02-08  8:07     ` Tiziano Müller
2009-02-08  8:59       ` Zac Medico
2009-02-08 11:51         ` Tiziano Müller
2009-02-08 20:36           ` Zac Medico
2009-02-08 21:48             ` Tiziano Müller
2009-02-08 22:14               ` Zac Medico
2009-02-08 22:18     ` Ciaran McCreesh
2009-02-08 22:43       ` Zac Medico
2009-02-08 22:47         ` Ciaran McCreesh
2009-02-08 23:03           ` Zac Medico
2009-02-08 23:10             ` Ciaran McCreesh
2009-02-08 23:27               ` Zac Medico
2009-02-08 23:30                 ` Ciaran McCreesh
2009-02-08 23:40                   ` Zac Medico
2009-02-09 12:30                     ` Petteri Räty
2009-02-09 13:59                       ` Ciaran McCreesh
2009-02-09 14:15                         ` Petteri Räty
2009-02-09 14:18                           ` Ciaran McCreesh
2009-02-09 14:21                           ` Rémi Cardona
2009-02-09 20:19                       ` Zac Medico
2009-02-09 18:43         ` Ciaran McCreesh
2009-02-09 20:02           ` Zac Medico
2009-02-09 15:22     ` Tiziano Müller
2009-02-09 19:55       ` Zac Medico
2009-02-10 12:20         ` Brian Harring
2009-02-10 12:52           ` Nirbheek Chauhan
2009-02-10 20:55           ` Zac Medico
2009-02-11  9:00             ` Brian Harring
2009-02-11 10:01               ` Zac Medico
2009-02-14 13:18                 ` Brian Harring
2009-02-14 20:16                   ` Zac Medico
2009-02-15 22:51     ` Zac Medico [this message]
2009-02-15 23:15       ` Ciaran McCreesh
2009-02-15 23:26         ` Zac Medico
2009-02-15 23:30           ` Ciaran McCreesh
2009-02-15 23:56             ` Zac Medico
2009-02-16  0:06               ` Ciaran McCreesh
2009-02-16  0:48                 ` Zac Medico
2009-02-16  0:53                   ` Ciaran McCreesh
2009-02-16  0:54                   ` Zac Medico

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=49989C5E.3020307@gentoo.org \
    --to=zmedico@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox