From: ludo@gnu.org (Ludovic Courtès)
To: Ricardo Wurmus <rekado@elephly.net>
Cc: 20428-done@debbugs.gnu.org
Subject: bug#20428: git-fetch does not always validate hash
Date: Fri, 01 May 2015 22:21:52 +0200 [thread overview]
Message-ID: <87lhh89hgf.fsf@gnu.org> (raw)
In-Reply-To: <87lhhfyqvn.fsf@mango.localdomain> (Ricardo Wurmus's message of "Sun, 26 Apr 2015 15:13:16 +0200")
Ricardo Wurmus <rekado@elephly.net> skribis:
> Upon rebuilding the package from a new commit I would expect the build
> to fail with a hash validation error as I have not updated the hash yet.
> However, the build procedure just continues. I noticed that the git
> checkout is still the very same as before I updated the value of
> "commit". I cannot seem to reliably force a new git checkout.
Indeed, origins compile to fixed-output derivations, meaning that these
are special derivations whose output is known in advance (rather, the
SHA256 is the output is known in advance.) Thus, it doesn’t matter how
the derivation produces its result as long as its output has the correct
hash.
When you leave the ‘sha256’ unchanged, the daemon notices that there’s
already an item with this name and hash in the store, so it does
nothing.
This is expected behavior, though I understand this can be error-prone
here.
To avoid that, you could add a ‘file-name’ field to the origin that
includes the commit:
(file-name (string-append name "-checkout-" commit))
Thus, if you change the commit without changing the hash, the daemon
will still want to build the origin (because of the changed name) and
will eventually complain about the hash mismatch.
Thanks,
Ludo’.
prev parent reply other threads:[~2015-05-01 20:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-26 13:13 bug#20428: git-fetch does not always validate hash Ricardo Wurmus
2015-05-01 20:21 ` Ludovic Courtès [this message]
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=87lhh89hgf.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=20428-done@debbugs.gnu.org \
--cc=rekado@elephly.net \
/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.