diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-12-13 22:46:03 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-12-19 23:25:00 +0100 |
commit | 9dfa20a22ae0be3d3b01a7b3d422af97428c627e (patch) | |
tree | 2ea3e2af7685f0f0b496434841dffba3368d69c7 /gnu/artwork.scm | |
parent | 6d955f1731dc593a51625b455882102a67d95e1a (diff) | |
download | guix-9dfa20a22ae0be3d3b01a7b3d422af97428c627e.tar.gz |
daemon: Let 'guix substitute' perform hash checks.
This way, the hash of the store item can be computed as it is restored, thereby avoiding an additional file tree traversal ('hashPath' call) later on in the daemon. Consequently, it should reduce latency between subsequent substitute downloads. This is a followup to 5ff521452b9ec2aae9ed8e4bb7bdc250a581f203. * guix/scripts/substitute.scm (narinfo-hash-algorithm+value): New procedure. (process-substitution): Wrap INPUT into a hash input port, 'hashed', and read from it. Compare the actual and expected hashes, and print a "hash-mismatch" status line when they differ. When they match, print not just "success" but also the nar hash and size. * nix/libstore/build.cc (class SubstitutionGoal)[expectedHashStr]: Remove. (SubstitutionGoal::finished): Tokenize 'status'. Parse it and handle "success" and "hash-mismatch" accordingly. Call 'hashPath' only when the returned hash is not SHA256. (SubstitutionGoal::handleChildOutput): Remove 'expectedHashStr' handling. * tests/substitute.scm ("substitute, invalid hash"): Rename to... ("substitute, invalid narinfo hash"): ... this. ("substitute, invalid hash"): New test.
Diffstat (limited to 'gnu/artwork.scm')
0 files changed, 0 insertions, 0 deletions