Subject: Re: [bug#78689] Merging of "nss-updates"

From: Andreas Enge <[email-masked]>
Date: Tue, 12 Aug 2025 15:37:44 +0200

Am Tue, Aug 12, 2025 at 02:46:30PM +0300 schrieb Efraim Flashner:
> I found [email-masked] failed in the 'check phase for i686-linux. It looks
> like there's an extra round of parenthesis around the substitute* for
> the (unless #$(target-64bit?)
>       ((substitute* ...
> I wasn't able to quickly find a way to remove the extra parenthesis
> without also causing a rebuild on x86_64.

Oh dear, that will teach us a lesson!

The attached commit solves the problem by adding a layer of wrapping.
But it is quite ugly. Since we are still early in the rebuild phase,
we could also correct the package and rebuild everything.

What do you think?

Andreas

From 10002034a66abf2a67c72f8157c052937140230a Mon Sep 17 00:00:00 2001
Message-ID: <[email-masked]>
From: Andreas Enge <[email-masked]>
Date: Tue, 12 Aug 2025 15:32:12 +0200
Subject: [PATCH] gnu: nss: Fix build on 32 bit.

Change-Id: I81279a601b9d16140fd58af4613bc8aa9573d099
---
 gnu/packages/nss.scm | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/nss.scm b/gnu/packages/nss.scm
index 40adef194b..120becd1cb 100644
--- a/gnu/packages/nss.scm
+++ b/gnu/packages/nss.scm
@@ -219,13 +219,28 @@ (define-public nss
                     (substitute* "nss/tests/dbtests/dbtests.sh"
                       ((" -lt 5") " -lt 50"))
 
-                    (unless #$(target-64bit?)
+                    ;; Workaround for an error in a previous commit that we
+                    ;; prefer to not revert.
+                    #$@(if (target-64bit?)
+                    ;; The previous faulty code, needs to be copied so as
+                    ;; not to change the derivation in 64 bit.
+                    `((unless ,(target-64bit?)
                       ;; The script fails to determine the source
                       ;; directory when running under 'datefudge' (see
                       ;; <https://issues.guix.gnu.org/72239>).  Help it.
                       ((substitute* "nss/tests/gtests/gtests.sh"
+                         (("SOURCE_DIR=.*")
+                          (string-append "SOURCE_DIR=" (getcwd) "/nss\n"))))))
+                    ;; The correct code for 32 bit. On the next run,
+                    ;; keep only this "else" branch.
+                    `((unless ,(target-64bit?)
+                      ;; The script fails to determine the source
+                      ;; directory when running under 'datefudge' (see
+                      ;; <https://issues.guix.gnu.org/72239>).  Help it.
+                      (substitute* "nss/tests/gtests/gtests.sh"
                          (("SOURCE_DIR=.*")
                           (string-append "SOURCE_DIR=" (getcwd) "/nss\n")))))
+                    )
 
                     (let ((release-date (getenv "GUIX_NSS_RELEASE_DATE")))
                       (when (string=? "" release-date)

base-commit: c20d32dc5d3f69e7bcb49951043cf7786700b72f
-- 
2.50.1

From 10002034a66abf2a67c72f8157c052937140230a Mon Sep 17 00:00:00 2001
Message-ID: <[email-masked]>
From: Andreas Enge <[email-masked]>
Date: Tue, 12 Aug 2025 15:32:12 +0200
Subject: [PATCH] gnu: nss: Fix build on 32 bit.

Change-Id: I81279a601b9d16140fd58af4613bc8aa9573d099
---
 gnu/packages/nss.scm | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/nss.scm b/gnu/packages/nss.scm
index 40adef194b..120becd1cb 100644
--- a/gnu/packages/nss.scm
+++ b/gnu/packages/nss.scm
@@ -219,13 +219,28 @@ (define-public nss
                     (substitute* "nss/tests/dbtests/dbtests.sh"
                       ((" -lt 5") " -lt 50"))
 
-                    (unless #$(target-64bit?)
+                    ;; Workaround for an error in a previous commit that we
+                    ;; prefer to not revert.
+                    #$@(if (target-64bit?)
+                    ;; The previous faulty code, needs to be copied so as
+                    ;; not to change the derivation in 64 bit.
+                    `((unless ,(target-64bit?)
                       ;; The script fails to determine the source
                       ;; directory when running under 'datefudge' (see
                       ;; <https://issues.guix.gnu.org/72239>).  Help it.
                       ((substitute* "nss/tests/gtests/gtests.sh"
+                         (("SOURCE_DIR=.*")
+                          (string-append "SOURCE_DIR=" (getcwd) "/nss\n"))))))
+                    ;; The correct code for 32 bit. On the next run,
+                    ;; keep only this "else" branch.
+                    `((unless ,(target-64bit?)
+                      ;; The script fails to determine the source
+                      ;; directory when running under 'datefudge' (see
+                      ;; <https://issues.guix.gnu.org/72239>).  Help it.
+                      (substitute* "nss/tests/gtests/gtests.sh"
                          (("SOURCE_DIR=.*")
                           (string-append "SOURCE_DIR=" (getcwd) "/nss\n")))))
+                    )
 
                     (let ((release-date (getenv "GUIX_NSS_RELEASE_DATE")))
                       (when (string=? "" release-date)

base-commit: c20d32dc5d3f69e7bcb49951043cf7786700b72f
-- 
2.50.1