diff mbox series

[bug#42146,3/3] build: bootstrap-configure: Allow lack of matches in substitute.

Message ID 28fd2bd2039b4a4c0fe8fdaf1adbfb5956f683d5.1697747385.git.maxim.cournoyer@gmail.com
State New
Headers show
Series [bug#42146,1/3] build: Relocate <regexp*> record and associated procedures here. | expand

Commit Message

Maxim Cournoyer Oct. 19, 2023, 8:33 p.m. UTC
From: Jakub Kądziołka <kuba@kadziolka.net>

Matches are not required here, as not every file will use every
variable.

* guix/build/gnu-bootstrap.scm (bootstrap-configure): Pass
  #:require-matches? #f to substitute*.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
---
 guix/build/gnu-bootstrap.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Ludovic Courtès Oct. 19, 2023, 8:51 p.m. UTC | #1
Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

> From: Jakub Kądziołka <kuba@kadziolka.net>
>
> Matches are not required here, as not every file will use every
> variable.
>
> * guix/build/gnu-bootstrap.scm (bootstrap-configure): Pass
>   #:require-matches? #f to substitute*.
>
> Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>

To me these two special cases suggest we may discover other more cases
where it’s okay to not match and we’d think.  We’ll need a dedicated
branch built on ci.guix to assess that.

Thanks for working on it!

Ludo’.
diff mbox series

Patch

diff --git a/guix/build/gnu-bootstrap.scm b/guix/build/gnu-bootstrap.scm
index b4257a3717..d044c8acd9 100644
--- a/guix/build/gnu-bootstrap.scm
+++ b/guix/build/gnu-bootstrap.scm
@@ -1,5 +1,6 @@ 
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2020, 2022 Timothy Sample <samplet@ngyro.com>
+;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -51,6 +52,7 @@  (define (bootstrap-configure name version modules scripts)
                   (let ((target (string-drop-right template 3)))
                     (copy-file template target)
                     (substitute* target
+                      #:require-matches? #f
                       (("@PACKAGE_NAME@") name)
                       (("@VERSION@") version))))
                 (append-map (lambda (dir) (find-files dir "\\.in$"))
@@ -60,14 +62,14 @@  (define (bootstrap-configure name version modules scripts)
                   (let ((target (string-drop-right template 3)))
                     (copy-file template target)
                     (substitute* target
+                      #:require-matches? #f
                       (("@GUILE@") guile)
                       (("@MODDIR@") moddir)
                       (("@GODIR@") godir))
                     (chmod target #o755)))
                 (find-files scripts
                             (lambda (fn st)
-                              (string-suffix? ".in" fn))))
-      #t)))
+                              (string-suffix? ".in" fn)))))))
 
 (define (bootstrap-build modules)
   "Create a procedure that builds an early bootstrap package.  The