From aa65f31ed2a36a57f047651ff429eb9a7dfb0dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 7 Oct 2023 23:21:41 +0200 Subject: [PATCH] disarchive-manifest: Add one manifest entry per tarball. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. : Define ‘disarchives’. Append it to the entries of the manifest. --- etc/disarchive-manifest.scm | 61 +++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/etc/disarchive-manifest.scm b/etc/disarchive-manifest.scm index 93b5039eec..41f64eae4f 100644 --- a/etc/disarchive-manifest.scm +++ b/etc/disarchive-manifest.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2021-2022 Ludovic Courtès +;;; Copyright © 2021-2023 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -94,34 +94,41 @@ an empty directory if ORIGIN could not be disassembled." (#f "anonymous-tarball.dis")) build)) -(define (disarchive-collection origins) - "Return a directory containing all the Disarchive metadata for ORIGINS." - (directory-union "disarchive-collection" - (filter-map (lambda (origin) - (and (tarball-origin? origin) - - ;; Dismiss origins with (sha256 #f) such - ;; as that of IceCat. - (and=> (origin-hash origin) - content-hash-value) - - ;; FIXME: Exclude the Chromium tarball - ;; because it's huge and "disarchive - ;; disassemble" exceeds the max-silent - ;; timeout. - (not (string-prefix? - "chromium-" - (origin-actual-file-name origin))) - - (origin->disarchive origin))) - origins) - #:copy? #t)) - ;; The manifest containing Disarchive data. -(let ((origins (all-origins))) +(let* ((origins (all-origins)) + (disarchives + (filter-map (lambda (origin) + (and (tarball-origin? origin) + + ;; Dismiss origins with (sha256 #f) such as that of + ;; IceCat. + (and=> (origin-hash origin) + content-hash-value) + + ;; FIXME: Exclude the Chromium tarball because it's + ;; huge and "disarchive disassemble" exceeds the + ;; max-silent timeout. + (not (string-prefix? + "chromium-" + (origin-actual-file-name origin))) + + (manifest-entry + (name + (string-append (origin-actual-file-name origin) + ".dis")) + (version "0") + (item (origin->disarchive origin))))) + origins))) (manifest - (list (manifest-entry + (cons (manifest-entry (name "disarchive-collection") (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)))