civodul pushed a commit to branch core-updates
in repository guix.

commit 21fe1e077aa77488bd413ef3255973c60d7468fe
Author: Ludovic Courtès <l...@gnu.org>
AuthorDate: Fri Jul 26 11:03:48 2024 +0200

    gnu: nss: Use ‘datefudge’ to run tests on 32-bit platforms.
    
    Fixes <https://issues.guix.gnu.org/72239>.
    
    * gnu/packages/nss.scm (nss)[arguments]: In ‘check’ phase, on 32-bit
    platforms, modify ‘SOURCE_DIR’ in ‘gtests.sh’ and use ‘datefudge’ rather
    than ‘faketime’.
    [native-inputs]: On 32-bit platforms, use ‘datefudge’ rather than 
‘libfaketime’.
    
    Change-Id: I6b35f4d979897dd2215e189c4375aa0d792530d0
---
 gnu/packages/nss.scm | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/nss.scm b/gnu/packages/nss.scm
index 49276817ae..2b4982a706 100644
--- a/gnu/packages/nss.scm
+++ b/gnu/packages/nss.scm
@@ -40,7 +40,8 @@
   #:use-module (gnu packages crates-io)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages perl)
-  #:use-module (gnu packages sqlite))
+  #:use-module (gnu packages sqlite)
+  #:use-module (gnu packages time))
 
 (define-public nspr
   (package
@@ -211,11 +212,21 @@ in the Mozilla clients.")
                     (substitute* "nss/tests/dbtests/dbtests.sh"
                       ((" -lt 5") " -lt 50"))
 
+                    #$@(if (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 "PayPalEE.cert" certificate expires every six 
months,
                     ;; leading to test failures:
                     ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=609734>.  
To
                     ;; work around that, set the time to roughly the release 
date.
-                    (invoke "faketime" "2024-01-23" "./nss/tests/all.sh"))
+                    (invoke #$(if (target-64bit?) "faketime" "datefudge")
+                            "2024-01-23" "./nss/tests/all.sh"))
                   (format #t "test suite not run~%"))))
           (replace 'install
             (lambda* (#:key outputs #:allow-other-keys)
@@ -240,7 +251,9 @@ in the Mozilla clients.")
                 (copy-recursively (string-append obj "/lib") lib)))))))
     (inputs (list sqlite zlib))
     (propagated-inputs (list nspr))               ;required by nss.pc.
-    (native-inputs (list perl libfaketime which)) ;for tests
+    (native-inputs (list perl                     ;for tests
+                         (if (target-64bit?) libfaketime datefudge)
+                         which))
 
     ;; The NSS test suite takes around 48 hours on Loongson 3A (MIPS) when
     ;; another build is happening concurrently on the same machine.

Reply via email to