guix-commits
[Top][All Lists]
Advanced

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

branch master updated: Fix build products creation.


From: Mathieu Othacehe
Subject: branch master updated: Fix build products creation.
Date: Fri, 12 Mar 2021 02:36:12 -0500

This is an automated email from the git hooks/post-receive script.

mothacehe pushed a commit to branch master
in repository guix-cuirass.

The following commit(s) were added to refs/heads/master by this push:
     new 5c9003b  Fix build products creation.
5c9003b is described below

commit 5c9003b41def5edae3baf0697ae8b5e46d929d28
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Fri Mar 12 08:35:56 2021 +0100

    Fix build products creation.
---
 src/cuirass/base.scm |  4 ++--
 tests/database.scm   | 14 +++++++++++++-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index 6c09783..377b9ca 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -596,7 +596,7 @@ by BUILD-OUTPUTS."
   (define* (find-product build build-output)
     (let* ((outputs (assq-ref build #:outputs))
            (output (build-output-output build-output))
-           (path (build-output-path build-output-path))
+           (path (build-output-path build-output))
            (root (and=> (assoc-ref outputs output)
                         (cut assq-ref <> #:path))))
       (and root
@@ -615,7 +615,7 @@ by BUILD-OUTPUTS."
                   (log-message "Adding build product ~a" product)
                   (db-add-build-product
                    `((#:build . ,(assq-ref build #:id))
-                     (#:type . ,(build-output-type build-output-type))
+                     (#:type . ,(build-output-type build-output))
                      (#:file-size . ,(file-size product))
                      ;; TODO: Implement it.
                      (#:checksum . "")
diff --git a/tests/database.scm b/tests/database.scm
index c728aaa..9b3a60b 100644
--- a/tests/database.scm
+++ b/tests/database.scm
@@ -20,7 +20,8 @@
 ;;; You should have received a copy of the GNU General Public License
 ;;; along with Cuirass.  If not, see <http://www.gnu.org/licenses/>.
 
-(use-modules (cuirass database)
+(use-modules (cuirass base)
+             (cuirass database)
              (cuirass notification)
              (cuirass parameters)
              (cuirass remote)
@@ -585,6 +586,17 @@ timestamp, checkouttime, evaltime) VALUES ('guix', 0, 0, 
0, 0);")
          (and (email? notif)
               (equal? build notif-build))))))
 
+  (test-assert "set-build-successful!"
+    (let* ((name "/foo5.drv")
+           (build
+            (make-dummy-build name #:outputs `(("out" . ,(getcwd)))))
+           (drv (assq-ref build #:derivation)))
+      (db-add-build build)
+      (set-build-successful! drv)
+      (match (assq-ref (db-get-build name) #:buildproducts)
+        ((product)
+         (equal? (assq-ref product #:path) (getcwd))))))
+
   (test-assert "db-close"
     (begin
       (db-close (%db))



reply via email to

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