disarchive-manifest: Add one manifest entry per tarball.

This works around a situation where ‘cuirass remote-worker’ now builds
with max-jobs = 1 (Cuirass commit
980ef610989895be5ac2ba7f9d1901e5c7f22934).  The effect is that all
.dis.drv would be performed sequentially, on a single machine (‘cuirass
remote-server’ is unable to distribute those derivations to several
machines because it only “sees” the ‘disarchive-collection’ derivation).
This would take a lot of time and force a rebuild of all of *.dis.drv
every time because their build results would not be retrieved by the
‘remote-server’ process.

* etc/disarchive-manifest.scm (disarchive-collection): Remove.
<top level>: Define ‘disarchives’.  Append it to the entries of the
manifest.
This commit is contained in:
Ludovic Courtès 2023-10-07 23:21:41 +02:00
parent 002c5bec07
commit aa65f31ed2
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2021-2022 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2021-2023 Ludovic Courtès <ludo@gnu.org>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -94,34 +94,41 @@ an empty directory if ORIGIN could not be disassembled."
(#f "anonymous-tarball.dis")) (#f "anonymous-tarball.dis"))
build)) build))
(define (disarchive-collection origins)
"Return a directory containing all the Disarchive metadata for ORIGINS." ;; The manifest containing Disarchive data.
(directory-union "disarchive-collection" (let* ((origins (all-origins))
(disarchives
(filter-map (lambda (origin) (filter-map (lambda (origin)
(and (tarball-origin? origin) (and (tarball-origin? origin)
;; Dismiss origins with (sha256 #f) such ;; Dismiss origins with (sha256 #f) such as that of
;; as that of IceCat. ;; IceCat.
(and=> (origin-hash origin) (and=> (origin-hash origin)
content-hash-value) content-hash-value)
;; FIXME: Exclude the Chromium tarball ;; FIXME: Exclude the Chromium tarball because it's
;; because it's huge and "disarchive ;; huge and "disarchive disassemble" exceeds the
;; disassemble" exceeds the max-silent ;; max-silent timeout.
;; timeout.
(not (string-prefix? (not (string-prefix?
"chromium-" "chromium-"
(origin-actual-file-name origin))) (origin-actual-file-name origin)))
(origin->disarchive origin))) (manifest-entry
origins) (name
#:copy? #t)) (string-append (origin-actual-file-name origin)
".dis"))
(version "0")
;; The manifest containing Disarchive data. (item (origin->disarchive origin)))))
(let ((origins (all-origins))) origins)))
(manifest (manifest
(list (manifest-entry (cons (manifest-entry
(name "disarchive-collection") (name "disarchive-collection")
(version (number->string (length origins))) (version (number->string (length origins)))
(item (disarchive-collection origins)))))) (item (directory-union "disarchive-collection"
(map manifest-entry-item disarchives)
#:copy? #t)))
;; Cuirass can distribute derivation builds to build machines if and
;; only if it has one "job" per derivation. Thus, add them here in
;; addition to "disarchive-collection".
disarchives)))