From 1181b13ffe3666bba040739f9aba7ae1c96e7661 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 11 Mar 2025 19:47:14 +0000 Subject: [PATCH] Add a procedure to fix derivation source files I don't know how, but there are a couple in the data.guix.gnu.org database that are placeholders. --- .../jobs/load-new-guix-revision.scm | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm index 9638db0..4ba7d5e 100644 --- a/guix-data-service/jobs/load-new-guix-revision.scm +++ b/guix-data-service/jobs/load-new-guix-revision.scm @@ -97,7 +97,8 @@ enqueue-load-new-guix-revision-job most-recent-n-load-new-guix-revision-jobs - fix-derivation)) + fix-derivation + fix-derivation-source-file-nar)) (define inferior-package-id (@@ (guix inferior) inferior-package-id)) @@ -1310,6 +1311,30 @@ SELECT 1 FROM derivation_source_file_nars WHERE derivation_source_file_id = $1" #:hz 0 #:parallelism 1)) +(define (fix-derivation-source-file-nar id) + (run-fibers + (lambda () + (with-postgresql-connection + "fix" + (lambda (conn) + (let ((postgresql-connection-pool + (make-resource-pool + (const conn) + 1 + #:name "postgres"))) + (match (exec-query + conn + " +SELECT store_path FROM derivation_source_files WHERE id = $1" + (list (number->string id))) + (((store-path)) + (compute-and-update-derivation-source-file-nar + postgresql-connection-pool + id + store-path))))))) + #:hz 0 + #:parallelism 1)) + (define* (derivation-file-names->derivation-ids postgresql-connection-pool call-with-utility-thread read-derivations/fiberized