guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/04: hydra: bayfront: Use a build coordinator missing inputs hook.


From: Christopher Baines
Subject: 01/04: hydra: bayfront: Use a build coordinator missing inputs hook.
Date: Mon, 10 Jun 2024 07:20:43 -0400 (EDT)

cbaines pushed a commit to branch master
in repository maintenance.

commit 1150c21a43c77572984c16a0fe82e5f93c6c15c2
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Mon Jun 10 12:12:47 2024 +0100

    hydra: bayfront: Use a build coordinator missing inputs hook.
    
    Which looks at whether the nar-herder has a substitute. This should
    deal with cases where the nar has been built previously, but then
    removed (which I'm planning to have happen for QA related
    builds/nars).
    
    * hydra/bayfront.scm (%guix-build-coordinator-configuration): Define a
    functional build-missing-inputs hook.
---
 hydra/bayfront.scm | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/hydra/bayfront.scm b/hydra/bayfront.scm
index 1bb7c7de..dcaa0984 100644
--- a/hydra/bayfront.scm
+++ b/hydra/bayfront.scm
@@ -1139,8 +1139,35 @@ add_header Content-Type text/plain;")))
         (build-success . 24)))
      (hooks
       `((build-missing-inputs
-         ;; Builds shouldn't be missing inputs, so disable this hook
-         . ,#~(const #t))
+         . ,#~(begin
+                (use-modules (web uri)
+                             (web client)
+                             (guix store))
+
+                (lambda args
+                  (apply
+                   (@ (guix-build-coordinator hooks)
+                      default-build-missing-inputs-hook)
+                   (append
+                    args
+                    (list #:submit-build?
+                          (lambda* (missing-input
+                                    #:key pending-builds
+                                    #:allow-other-keys)
+                            (and (null? pending-builds)
+                                 (let ((code
+                                        ;; There's some kind of weird
+                                        ;; syntax transformer issue
+                                        ;; with response-code
+                                        ((@ (web response) response-code)
+                                         (http-get
+                                          (string->uri
+                                           (string-append
+                                            "http://localhost:8734/";
+                                            (store-path-hash-part 
missing-input)
+                                            ".narinfo"))))))
+                                   (simple-format #t "build-missing-inputs 
hook, code ~A for ~A\n" code missing-input)
+                                   (= code 404))))))))))
         (build-submitted
          . ,#~(lambda args
                 #$(send-guix-data-service-event



reply via email to

[Prev in Thread] Current Thread [Next in Thread]