GNU bug report logs - #65456
[PATCH 0/2] Split guix build into more steps for 32bit hosts.

Previous Next

Package: guix;

Reported by: Janneke Nieuwenhuizen <janneke <at> gnu.org>

Date: Tue, 22 Aug 2023 17:19:02 UTC

Severity: normal

Done: Janneke Nieuwenhuizen <janneke <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 65456 <at> debbugs.gnu.org (full text, mbox):

From: Janneke Nieuwenhuizen <janneke <at> gnu.org>
To: 65456 <at> debbugs.gnu.org
Subject: [PATCH 2/2] self: Build gnu/packages/*.go in 26 steps on 32bit.
Date: Tue, 22 Aug 2023 19:19:42 +0200
Similar to the Makefile.am change, this breaks-up packages into 26 chunks
when building on 32bit.  Also force garbage collection.

* guix/self.scm (compiled-modules)[process-directory/32bit]: New inner define.
Use it when building on a "i586" or "i686" cpu.
---
 guix/self.scm | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/guix/self.scm b/guix/self.scm
index 81a36e007f..474715fe7a 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017-2023 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2020 Martin Becze <mjbecze <at> riseup.net>
+;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke <at> gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1210,9 +1211,12 @@ (define* (compiled-modules name module-tree module-files
                             '((guix build compile)
                               (guix build utils)))
       #~(begin
-          (use-modules (srfi srfi-26)
+          (use-modules (srfi srfi-1)
+                       (srfi srfi-26)
+                       (srfi srfi-71)
                        (ice-9 match)
                        (ice-9 format)
+                       (ice-9 regex)
                        (ice-9 threads)
                        (guix build compile)
                        (guix build utils))
@@ -1251,6 +1255,26 @@ (define* (compiled-modules name module-tree module-files
                              #:report-load report-load
                              #:report-compilation report-compilation)))
 
+          (define (process-directory/32bit directory files output)
+            (let* ((chunks (map (compose
+                                 (cute partition <> files)
+                                 (lambda (regex)
+                                   (cute string-match regex <>))
+                                 (cute string-append "^gnu/packages/" <>)
+                                 (cute make-string 1 <>)
+                                 integer->char
+                                 (cute + (char->integer #\a) <>))
+                                (iota 26)))
+                   (chunks (filter pair? chunks)))
+              (for-each
+               (lambda (chunck)
+                 (compile-files directory #$output chunck
+                                #:workers (parallel-job-count)
+                                #:report-load report-load
+                                #:report-compilation report-compilation)
+                 (gc))
+               chunks)))
+
           (setvbuf (current-output-port) 'line)
           (setvbuf (current-error-port) 'line)
 
@@ -1277,7 +1301,10 @@ (define* (compiled-modules name module-tree module-files
 
           (mkdir #$output)
           (chdir #+module-tree)
-          (process-directory "." '#+module-files #$output)
+          (match (string-split %host-type #\-)
+            (((or "i586" "i686") rest ...)
+             (process-directory/32bit "." '#+module-files #$output))
+            (_ (process-directory "." '#+module-files #$output)))
           (newline))))
 
   (computed-file name build
-- 
2.41.0





This bug report was last modified 1 year and 304 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.