2
0
Fork 0
mirror of git://git.savannah.gnu.org/guix/guix-cuirass.git synced 2023-12-14 06:03:04 +01:00

Fix build products creation.

This commit is contained in:
Mathieu Othacehe 2021-03-12 08:35:56 +01:00
parent b24d55e368
commit 5c9003b41d
No known key found for this signature in database
GPG key ID: 8354763531769CA6
2 changed files with 15 additions and 3 deletions

View file

@ -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 . "")

View file

@ -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))