guix-play/guix/scripts
Ludovic Courtès 9dfa20a22a
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 5ff521452b.

* 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.
2020-12-19 23:25:00 +01:00
..
container scripts: container: Fix typo. 2019-09-23 11:56:40 -07:00
git Add 'guix git authenticate'. 2020-07-11 12:33:01 +02:00
import import/cran: Abort with error message when recursive import fails. 2020-12-12 00:08:27 +01:00
system system: reconfigure: Use the disk-installer if provided. 2020-11-03 07:59:59 +01:00
archive.scm serialization: 'fold-archive' notifies about directory processing completion. 2020-12-15 17:32:09 +01:00
authenticate.scm authenticate: Encode strings as ISO-8859-1. 2020-09-15 14:40:20 +02:00
build.scm transformations: Show '--help-transform' only where applicable. 2020-11-21 12:39:14 +01:00
challenge.scm serialization: 'fold-archive' notifies about directory processing completion. 2020-12-15 17:32:09 +01:00
container.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
copy.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
deploy.scm deploy: Let key-and-args exceptions through. 2020-11-26 23:39:15 +01:00
describe.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
discover.scm scripts: discover: Remove file locks. 2020-12-13 13:24:17 +01:00
download.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
edit.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
environment.scm transformations: Show '--help-transform' only where applicable. 2020-11-21 12:39:14 +01:00
gc.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
git.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
graph.scm transformations: Show '--help-transform' only where applicable. 2020-11-21 12:39:14 +01:00
hash.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
import.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
install.scm transformations: Show '--help-transform' only where applicable. 2020-11-21 12:39:14 +01:00
lint.scm scripts: lint: Display result of checkers on stdout. 2020-11-21 10:23:08 +00:00
offload.scm offload: Print warning in context. 2020-12-15 15:04:06 +01:00
pack.scm database: Remove #:deduplicate? from 'register-items'. 2020-12-15 17:32:11 +01:00
package.scm transformations: Show '--help-transform' only where applicable. 2020-11-21 12:39:14 +01:00
perform-download.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
processes.scm processes: Add '--format' and the "normalized" format. 2020-11-29 23:55:57 +01:00
publish.scm Make "guile-avahi" dependency optional. 2020-11-29 19:22:05 +01:00
pull.scm pull: Accept no non-option arguments. 2020-12-05 16:47:59 +01:00
refresh.scm guix: refresh: Do not use argument jumping with ngettext. 2020-11-18 20:58:51 +01:00
remove.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
repl.scm describe: Save the original value of (program-arguments). 2020-09-19 22:52:36 +02:00
search.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
show.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
size.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
substitute.scm daemon: Let 'guix substitute' perform hash checks. 2020-12-19 23:25:00 +01:00
system.scm system: 'init' does not recompute the hash of each store item. 2020-12-15 17:32:11 +01:00
time-machine.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
upgrade.scm upgrade: Allow several regexps. 2020-12-01 11:34:10 +01:00
weather.scm weather: Fix '--substitute-urls'. 2020-11-25 11:55:07 +01:00