Try to address the issue of missing derivation outputs
This commit is contained in:
parent
1181b13ffe
commit
b904fdb161
2 changed files with 80 additions and 40 deletions
|
|
@ -21,6 +21,7 @@
|
|||
#:use-module (ice-9 vlist)
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (ice-9 format)
|
||||
#:use-module (ice-9 exceptions)
|
||||
#:use-module (ice-9 binary-ports)
|
||||
#:use-module (rnrs bytevectors)
|
||||
#:use-module (squee)
|
||||
|
|
@ -73,7 +74,12 @@
|
|||
update-derivation-inputs-statistics
|
||||
vacuum-derivation-inputs-table
|
||||
update-derivation-outputs-statistics
|
||||
vacuum-derivation-outputs-table))
|
||||
vacuum-derivation-outputs-table
|
||||
|
||||
&missing-derivation-output-error
|
||||
missing-derivation-output-error?
|
||||
missing-derivation-output-error-name
|
||||
missing-derivation-output-error-path))
|
||||
|
||||
(define (valid-targets conn)
|
||||
'("arm-linux-gnueabihf"
|
||||
|
|
@ -1128,12 +1134,19 @@ ON CONFLICT DO NOTHING"
|
|||
(vector->list (json-string->scm env_vars)))
|
||||
system))))
|
||||
|
||||
(define-exception-type &missing-derivation-output-error &error
|
||||
make-derivation-output-error
|
||||
missing-derivation-output-error?
|
||||
(name missing-derivation-output-error-name)
|
||||
(path missing-derivation-output-error-path))
|
||||
|
||||
(define select-derivation-output-id
|
||||
(mlambda (conn name path)
|
||||
(match (exec-query
|
||||
conn
|
||||
"
|
||||
SELECT derivation_outputs.id FROM derivation_outputs
|
||||
SELECT derivation_outputs.id
|
||||
FROM derivation_outputs
|
||||
INNER JOIN derivations
|
||||
ON derivation_outputs.derivation_id = derivations.id
|
||||
WHERE derivations.file_name = $1
|
||||
|
|
@ -1143,9 +1156,8 @@ WHERE derivations.file_name = $1
|
|||
(((id))
|
||||
id)
|
||||
(()
|
||||
(error (simple-format
|
||||
#f "cannot find derivation-output with name ~A and path ~A"
|
||||
name path))))))
|
||||
(raise-exception
|
||||
(make-derivation-output-error name path))))))
|
||||
|
||||
(define (select-derivation-outputs-by-derivation-id conn id)
|
||||
(define query
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue