[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/02: hydra: bayfront: Alter how the build coordinator publishes nars.
From: |
Christopher Baines |
Subject: |
01/02: hydra: bayfront: Alter how the build coordinator publishes nars. |
Date: |
Thu, 13 Apr 2023 13:59:11 -0400 (EDT) |
cbaines pushed a commit to branch master
in repository maintenance.
commit 1e428e8fd6945f5c9f13a14e9cd97c81f3f4d945
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Thu Apr 13 18:49:13 2023 +0100
hydra: bayfront: Alter how the build coordinator publishes nars.
Switch to the combined post publish hook as I'd like to get the
nar-herder to validate references for imported nars, and this means
processing related nars together.
* hydra/bayfront.scm (%guix-build-coordinator-configuration): Use the
#:combined-post-publish-hook in place of the #:post-publish-hook.
---
hydra/bayfront.scm | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/hydra/bayfront.scm b/hydra/bayfront.scm
index 3a1e6fa..4c38897 100644
--- a/hydra/bayfront.scm
+++ b/hydra/bayfront.scm
@@ -876,17 +876,20 @@ add_header Content-Type text/plain;")))
(string-append
"http://localhost:8734/"
narinfo-filename))))))
- #:post-publish-hook
- (lambda (directory narinfo-filename nar-filename)
- (let* ((narinfo
- (string-append directory "/"
narinfo-filename))
+ #:combined-post-publish-hook
+ (lambda (directory narinfos-and-nars)
+ (let* ((narinfos
+ (map
+ (lambda (narinfo-filename)
+ (string-append directory "/"
narinfo-filename))
+ (map car narinfos-and-nars)))
(command
- (list #$(file-append nar-herder
"/bin/nar-herder")
- "import"
- "--tag=unknown-if-for-master=true"
- ;;"--ensure-references-exist"
-
"--database=/var/lib/nar-herder/nar_herder.db"
- narinfo)))
+ (cons* #$(file-append nar-herder
"/bin/nar-herder")
+ "import"
+ "--tag=unknown-if-for-master=true"
+ ;; "--ensure-references-exist"
+
"--database=/var/lib/nar-herder/nar_herder.db"
+ narinfos)))
(let ((exit-code
(status:exit-val
(apply system* command))))
@@ -897,10 +900,13 @@ add_header Content-Type text/plain;")))
"error: command failed (~A): ~A\n"
exit-code
command))))
- (simple-format (current-error-port)
- "deleting ~A\n"
- narinfo)
- (delete-file narinfo)))
+ (for-each
+ (lambda (narinfo)
+ (simple-format (current-error-port)
+ "deleting ~A\n"
+ narinfo)
+ (delete-file narinfo))
+ narinfos)))
#:derivation-substitute-urls
'("https://data.guix.gnu.org"
"https://data.qa.guix.gnu.org"))
args)