[core-updates] gnu: libfaketime: Support compilation with glibc 2.39 on i686-linux.

  • Done
  • quality assurance status badge
Details
3 participants
  • Ludovic Courtès
  • Christopher Baines
  • Zheng Junjie
Owner
unassigned
Submitted by
Christopher Baines
Severity
normal

Debbugs page

Christopher Baines wrote 8 months ago
[PATCH core-updates 0/2] Don't use libfaketime for key package tests on 32bit systems
(address . guix-patches@gnu.org)
87bk389sop.fsf@cbaines.net
As it fails to build and seems broken.


Christopher Baines (2):
gnu: nss: Don't use libfaketime on 32bit systems.
gnu: python-pyopenssl: Don't use libfaketime on 32bit systems.

gnu/packages/nss.scm | 15 +++++++++++++--
gnu/packages/python-crypto.scm | 10 ++++++++--
2 files changed, 21 insertions(+), 4 deletions(-)
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmaLp4ZfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XdjmA/7BpMH558zHAm5qAGciz7mGeETqe6CwulT
frVY5v5nH/+WpVJNi0YR5yx2esoOJbXHKm6lTaU2fKXf/pUJeZ4v3Kgc/Uk1u73T
P6/XRdBC0CSFMudjEzHUY5pUlcPZbUdE/VejH5nBivJnlH3L+nclTM8P3Z0hIVH+
E1WJbC36/d8BDC+7mKmikgFi9kjqEHGYB5BcvpX8tg0WJ8QagRTc6V/vde7KuFfW
QOVskTflZXoxLhyI87nwf5BftbbbuKK0S8HHE92UJJRQH3ypYJpyx8KFupvdnNqi
iqsG+qU9iFcCy79A7K7JDhKHNKT086gF5j+rV5RQDv0YKwt4kOf3F2gJThzbVSxg
gbwZkACV7hO6BEhpcB6nwrs1KT2A9GcmfzEuR2D/lVkseX2zF6rzRk6ohVLP9Yhc
uFYudF62Hf/1uhwyCRT8wzNPUwNjXZ9lBJLKwj3l2M4hYJLqZ6aB34efLNZ715Br
B/MxIqMXG6ieNW1JM4HeqImG3oGcZ5WA4JFxF52v+bYczFU7pZNvOYoYR3Qa5Yto
IacY7JuuUnVshcdR9b2PJ6LIoXb8uxx0ENIIXK//beAGMxUuBiQxEeySWnaqsrQc
HjiQO/B+8XWiu/yt/cgS1IrqBCKQa9E7U8jvlcG6JTgXBUyG//Fh6HMXs/fE5UlY
RyHnG3XmFTE=
=SuMj
-----END PGP SIGNATURE-----

Christopher Baines wrote 8 months ago
[PATCH core-updates 1/2] gnu: nss: Don't use libfaketime on 32bit systems.
(address . 71993@debbugs.gnu.org)
b9be0a44b3a7ca7e33d05ee4cefa65d8c16d871d.1720429414.git.mail@cbaines.net
As it fails to build and doesn't seem to work.

* gnu/packages/nss.scm (nss)[arguments]: Only use faketime on 64bit systems.
[native-inputs]: Only include libfaketime on 64bit systems.

Change-Id: I78bc9b7b2010e5b77f6184ffb7c87740ceae241c
---
gnu/packages/nss.scm | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

Toggle diff (37 lines)
diff --git a/gnu/packages/nss.scm b/gnu/packages/nss.scm
index 49276817ae..2162254760 100644
--- a/gnu/packages/nss.scm
+++ b/gnu/packages/nss.scm
@@ -215,7 +215,12 @@ (define-public nss
;; 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" "2024-01-23")
+ ;; libfaketime is currently broken on 32bit
+ ;; systems
+ '())
+ "./nss/tests/all.sh"))
(format #t "test suite not run~%"))))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
@@ -240,7 +245,13 @@ (define-public nss
(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
+ `(,perl
+ ,@(if (target-64bit?)
+ (list libfaketime)
+ ;; libfaketime is currently broken on 32bit systems
+ '())
+ ,which)) ;for tests
;; The NSS test suite takes around 48 hours on Loongson 3A (MIPS) when
;; another build is happening concurrently on the same machine.

base-commit: 75b4a29e12011ae3d1814932591e80dcb0b80aae
--
2.45.2
Christopher Baines wrote 8 months ago
[PATCH core-updates 2/2] gnu: python-pyopenssl: Don't use libfaketime on 32bit systems.
(address . 71993@debbugs.gnu.org)
3e6d433110b177d209127d34eb94876d10f52c51.1720429414.git.mail@cbaines.net
As it fails to build and doesn't seem to work.

* gnu/packages/python-pyopenssl.scm (python-pyopenssl)[arguments]: Only use
faketime on 64bit systems.
[native-inputs]: Only include libfaketime on 64bit systems.

Change-Id: I3a4ab85219ae71af17f43d864410fe2ac86ef214
---
gnu/packages/python-crypto.scm | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

Toggle diff (30 lines)
diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index 78f65ccf87..b001bb3e19 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -662,7 +662,10 @@ (define-public python-pyopenssl
;; PyOpenSSL runs tests against a certificate with a fixed
;; expiry time. To ensure successful builds in the future,
;; set the time to roughly the release date.
- (invoke "faketime" "2023-03-25" "pytest" "-vv" "-k"
+ (invoke #$@(if (target-64bit?)
+ '("faketime" "2023-03-25")
+ '())
+ "pytest" "-vv" "-k"
(string-append
;; This test tries to look up certificates from
;; the compiled-in default path in OpenSSL, which
@@ -676,7 +679,10 @@ (define-public python-pyopenssl
"and not test_verify_with_time"))))))))
(propagated-inputs (list python-cryptography))
(inputs (list openssl))
- (native-inputs (list libfaketime python-flaky python-pretend python-pytest))
+ (native-inputs `(,@(if (target-64bit?)
+ (list libfaketime)
+ '())
+ ,@(list python-flaky python-pretend python-pytest)))
(home-page "https://github.com/pyca/pyopenssl")
(synopsis "Python wrapper module around the OpenSSL library")
(description "PyOpenSSL is a high-level wrapper around a subset of the
--
2.45.2
Ludovic Courtès wrote 8 months ago
Re: [bug#71993] [PATCH core-updates 0/2] Don't use libfaketime for key package tests on 32bit systems
(name . Christopher Baines)(address . mail@cbaines.net)(address . 71993@debbugs.gnu.org)
87frsk9iik.fsf@gnu.org
Hello!

Christopher Baines <mail@cbaines.net> skribis:

Toggle quote (3 lines)
> gnu: nss: Don't use libfaketime on 32bit systems.
> gnu: python-pyopenssl: Don't use libfaketime on 32bit systems.

Here’s an alternate solution: getting closer to fixing libfaketime.
After this patch, there are still issues with the
‘pthread_cond_timedwait’ tests that would probably need investigation or
just plain skipping.
Toggle diff (46 lines)
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index bc341943f02..8714086be89 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -3477,6 +3477,24 @@ (define-public libfaketime
(substitute* "src/faketime.c"
(("\"date\"")
(format #f "~s" (search-input-file inputs "bin/date"))))))
+
+ #$@(if (target-64bit?)
+ #~()
+ #~((add-after 'unpack 'switch-libc-call
+ (lambda _
+ (substitute* "src/libfaketime.c"
+ (("#define _GNU_SOURCE")
+ ;; Make sure to use the 64-bit 'struct timespec' in
+ ;; replacement functions.
+ (string-append "#define _GNU_SOURCE\n"
+ "#define _FILE_OFFSET_BITS 64\n"
+ "#define _TIME_BITS 64\n"))
+ (("\"__clock_gettime\"")
+ ;; Replace '__clock_gettime64' rather than
+ ;; '__clock_gettime64' since this is what
+ ;; newly-built applications use.
+ "\"__clock_gettime64\""))))))
+
(replace 'configure
(lambda* (#:key outputs #:allow-other-keys)
(setenv "CC" #$(cc-for-target))
@@ -3495,8 +3513,14 @@ (define-public libfaketime
(add-before 'check 'pre-check
(lambda _
(substitute* "test/functests/test_exclude_mono.sh"
- (("/bin/bash") (which "bash"))))))))
- (native-inputs (list perl)) ;for tests
+ (("/bin/bash") (which "bash")))
+ #$@(if (target-64bit?)
+ #~()
+ ;; This test uses Perl to call 'clock_gettime' and fails
+ ;; for unclear reasons on i686-linux.
+ #~((delete-file
+ "test/functests/test_exclude_mono.sh"))))))))
+ (native-inputs (list perl)) ;for tests
(inputs (list coreutils-minimal))
(synopsis "Fake the system time for single applications")
(description
Another option: use ‘datefudge’ rather than ‘libfaketime’ for those
packages.

Ludo’.
Ludovic Courtès wrote 8 months ago
[PATCH v3] gnu: libfaketime: Support compilation with glibc 2.39 on i686-linux.
(address . 71993@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
64156410f93a987c3b2a9ca6e8420b8502921527.1720443180.git.ludo@gnu.org
* gnu/packages/check.scm (libfaketime)[arguments]: Add
‘switch-libc-call’ phase when not ‘target-64bit?’.
In ‘pre-check’ phase, delete ‘test_exclude_mono.sh’ on 32-bit platforms.

Change-Id: Ia4c0d1d13cdfa6028f3e11c63e76122a99a84e4d
---
gnu/packages/check.scm | 38 +++++++++++++++++++++++++++++++++++---
1 file changed, 35 insertions(+), 3 deletions(-)

This updated version of the patch works for me on i686-linux.

Toggle diff (67 lines)
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index bc341943f02..ee23406c86f 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -26,7 +26,7 @@
;;; Copyright © 2017 Nikita <nikita@n0.is>
;;; Copyright © 2015, 2017, 2018, 2020, 2021, 2023, 2024 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2016-2022 Marius Bakke <marius@gnu.org>
-;;; Copyright © 2017, 2018, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017-2018, 2020-2021, 2024 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
;;; Copyright © 2019, 2021 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2019 Chris Marusich <cmmarusich@gmail.com>
@@ -3477,6 +3477,32 @@ (define-public libfaketime
(substitute* "src/faketime.c"
(("\"date\"")
(format #f "~s" (search-input-file inputs "bin/date"))))))
+
+ #$@(if (target-64bit?)
+ #~()
+ #~((add-after 'unpack 'switch-libc-call
+ (lambda _
+ (substitute* "src/libfaketime.c"
+ (("#define _GNU_SOURCE")
+ ;; Make sure to use the 64-bit 'struct timespec' in
+ ;; replacement functions.
+ (string-append "#define _GNU_SOURCE\n"
+ "#define _FILE_OFFSET_BITS 64\n"
+ "#define _TIME_BITS 64\n"))
+ (("\"__clock_gettime\"")
+ ;; Replace '__clock_gettime64' rather than
+ ;; '__clock_gettime64' since this is what
+ ;; newly-built applications use.
+ "\"__clock_gettime64\""))
+
+ ;; XXX: Turn off 'pthread_cond_timedwait' etc.: tests
+ ;; related to this are failing and this feature is
+ ;; probably not useful for the purposes of running
+ ;; code at a fixed date.
+ (substitute* "src/Makefile"
+ (("-DFAKE_PTHREAD")
+ ""))))))
+
(replace 'configure
(lambda* (#:key outputs #:allow-other-keys)
(setenv "CC" #$(cc-for-target))
@@ -3495,8 +3521,14 @@ (define-public libfaketime
(add-before 'check 'pre-check
(lambda _
(substitute* "test/functests/test_exclude_mono.sh"
- (("/bin/bash") (which "bash"))))))))
- (native-inputs (list perl)) ;for tests
+ (("/bin/bash") (which "bash")))
+ #$@(if (target-64bit?)
+ #~()
+ ;; XXX: This test uses Perl to call 'clock_gettime' and
+ ;; fails for unclear reasons on i686-linux.
+ #~((delete-file
+ "test/functests/test_exclude_mono.sh"))))))))
+ (native-inputs (list perl)) ;for tests
(inputs (list coreutils-minimal))
(synopsis "Fake the system time for single applications")
(description

base-commit: e4da066f0029ef38f6a791f6f9d4cfdb8b39b6a3
--
2.45.2
Christopher Baines wrote 8 months ago
retitle
874j8z9cft.fsf@cbaines.net
retitle 71993 [core-updates] gnu: libfaketime: Support compilation with glibc 2.39 on i686-linux.
thanks
Zheng Junjie wrote 8 months ago
Re: [bug#71993] [PATCH core-updates 0/2] Don't use libfaketime for key package tests on 32bit systems
(name . Christopher Baines)(address . mail@cbaines.net)(address . 71993@debbugs.gnu.org)
87wmlf5zfb.fsf@iscas.ac.cn
Christopher Baines <mail@cbaines.net> writes:

Toggle quote (11 lines)
> As it fails to build and seems broken.
>
>
> Christopher Baines (2):
> gnu: nss: Don't use libfaketime on 32bit systems.
> gnu: python-pyopenssl: Don't use libfaketime on 32bit systems.
>
> gnu/packages/nss.scm | 15 +++++++++++++--
> gnu/packages/python-crypto.scm | 10 ++++++++--
> 2 files changed, 21 insertions(+), 4 deletions(-)

libfaketime is actually good, it just fails the test because coreutils
uses 64bit time_t.
gnulib will enable 64bit time_t on 32bit platforms, but we don't
currently support this, mixed abi will cause many problems[1], so turning
off 64bit time_t on coreutils can fix libfaketime's tests, and nss can
also use libfaketime because they use same time_t.

And libfaketime is not provided 64-bit time_t support on 32-bit archs,

We need to open a new branch to migrate time64 later

And see also


From 5cbb346385201fb6fce1057a13a49c7977e9dd34 Mon Sep 17 00:00:00 2001
Message-ID: <5cbb346385201fb6fce1057a13a49c7977e9dd34.1721522810.git.zhengjunjie@iscas.ac.cn>
From: Zheng Junjie <zhengjunjie@iscas.ac.cn>
Date: Sat, 20 Jul 2024 22:35:27 +0800
Subject: [PATCH 1/2] Revert "gnu: libfaketime: Support compilation with glibc
2.39 on i686-linux."

This reverts commit 127f1842fb037cc5acfc5406e373ccd723127732.
---
gnu/packages/check.scm | 38 +++-----------------------------------
1 file changed, 3 insertions(+), 35 deletions(-)

Toggle diff (67 lines)
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 70f828b2a1..0ec375069e 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -26,7 +26,7 @@
;;; Copyright © 2017 Nikita <nikita@n0.is>
;;; Copyright © 2015, 2017, 2018, 2020, 2021, 2023, 2024 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2016-2022 Marius Bakke <marius@gnu.org>
-;;; Copyright © 2017-2018, 2020-2021, 2024 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2018, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
;;; Copyright © 2019, 2021 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2019 Chris Marusich <cmmarusich@gmail.com>
@@ -3478,32 +3478,6 @@ (define-public libfaketime
(substitute* "src/faketime.c"
(("\"date\"")
(format #f "~s" (search-input-file inputs "bin/date"))))))
-
- #$@(if (target-64bit?)
- #~()
- #~((add-after 'unpack 'switch-libc-call
- (lambda _
- (substitute* "src/libfaketime.c"
- (("#define _GNU_SOURCE")
- ;; Make sure to use the 64-bit 'struct timespec' in
- ;; replacement functions.
- (string-append "#define _GNU_SOURCE\n"
- "#define _FILE_OFFSET_BITS 64\n"
- "#define _TIME_BITS 64\n"))
- (("\"__clock_gettime\"")
- ;; Replace '__clock_gettime64' rather than
- ;; '__clock_gettime64' since this is what
- ;; newly-built applications use.
- "\"__clock_gettime64\""))
-
- ;; XXX: Turn off 'pthread_cond_timedwait' etc.: tests
- ;; related to this are failing and this feature is
- ;; probably not useful for the purposes of running
- ;; code at a fixed date.
- (substitute* "src/Makefile"
- (("-DFAKE_PTHREAD")
- ""))))))
-
(replace 'configure
(lambda* (#:key outputs #:allow-other-keys)
(setenv "CC" #$(cc-for-target))
@@ -3522,14 +3496,8 @@ (define-public libfaketime
(add-before 'check 'pre-check
(lambda _
(substitute* "test/functests/test_exclude_mono.sh"
- (("/bin/bash") (which "bash")))
- #$@(if (target-64bit?)
- #~()
- ;; XXX: This test uses Perl to call 'clock_gettime' and
- ;; fails for unclear reasons on i686-linux.
- #~((delete-file
- "test/functests/test_exclude_mono.sh"))))))))
- (native-inputs (list perl)) ;for tests
+ (("/bin/bash") (which "bash"))))))))
+ (native-inputs (list perl)) ;for tests
(inputs (list coreutils-minimal))
(synopsis "Fake the system time for single applications")
(description

base-commit: 3f15785c71eb82832ac0520c762a18a51861a141
--
2.45.2
From 273c1c1189d824b86ae531bd1b5df601f0e7e838 Mon Sep 17 00:00:00 2001
Message-ID: <273c1c1189d824b86ae531bd1b5df601f0e7e838.1721522810.git.zhengjunjie@iscas.ac.cn>
In-Reply-To: <5cbb346385201fb6fce1057a13a49c7977e9dd34.1721522810.git.zhengjunjie@iscas.ac.cn>
References: <5cbb346385201fb6fce1057a13a49c7977e9dd34.1721522810.git.zhengjunjie@iscas.ac.cn>
From: Zheng Junjie <zhengjunjie@iscas.ac.cn>
Date: Sun, 21 Jul 2024 08:36:28 +0800
Subject: [PATCH 2/2] gnu: coreutils: Disable 64bit time_t on 32bit platform.

* gnu/packages/nss.scm (nss)[arguments]<#:configure-flags>: Pass
gl_cv_type_time_t_bits_macro=no on 32bit platform.

Change-Id: I3ba9e21733727a41f2070a27ccba39c9d5f2d406
---
gnu/packages/base.scm | 7 +++++++
1 file changed, 7 insertions(+)

Toggle diff (20 lines)
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index bc30d73426..47488c1603 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -471,6 +471,13 @@ (define-public coreutils
" test-renameatu"
" test-utimensat")))
'())
+ ,@(if (target-64bit?)
+ '()
+ ;; We currently do not support 64-bit time_t on 32-bit platforms,
+ ;; mixing different bits of time_t will cause a lot of problems
+ ;; so forcibly disable it.
+ ;; see https://wiki.gentoo.org/wiki/Project:Toolchain/time64_migration
+ '(#:configure-flags (list "gl_cv_type_time_t_bits_macro=no")))
#:phases (modify-phases %standard-phases
(add-before 'build 'patch-shell-references
(lambda _
--
2.45.2
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfr6klGDOXiwIdX/bO1qpk+Gi3/AFAmacXmgACgkQO1qpk+Gi
3/Dljw/+OHgA73Jqa9b1JW54Dh4emmrTsK6be/lNTKzRX+SVYLcDefRiAs56nQkA
xXDVSEntm8R59Ye4zOo/FrKhPzG9Anq/bEJ/sJJPs6jis+MIqOaubvU8dL4cuSuq
MEh6dHJUaZoCoDApX3195zLsqASFYiCj9UjUuu/U3qvx8XZnzs91uNAJZTFgm519
j+Mi5KL6zZVqsGI1F8UaZUuxg5Ig1SY+XuqSLMF2omVoN3ECcZnaiSH2PSeYncV1
qaoxOnUFxsmoC83AYDxx5w/kArvB9qn/rr+wrO8ko7kIluNBZSXSMaO4ZYy23pAM
s/jaa2rRrLbh+vOA7748vNu96wtfsihkh3ZWUV03wVPH/+RVeuDZKjmnARpdsHj0
gxj+UKXHgI9Stl+Qes1bY4J2GZ5RqfnxXgUV8ekWWurN8YbxIpiMcSqDs6FJMZNs
rUBSubxv5GwQN1U8wYlPjt59QGdsDrteoEPmLbWF16O0OGsk+C4iJUzg3Wz9ucQo
Gdyt359BWfC5QFz9HwzpLrD9FS32a7a6KxlcLf3YkKVbfjd6gVzdrS2jgpsC69ZS
yD+mO/UnW7nlnD0mhuwHIi5x02vJMnO5Ke6jFO1M1q7LoSB9dmMCjOc4CV7ORg34
CS7cOflLLUpQe9wq+Ykdjq3BIULSHKGSjT7FwXIIMuC8LDmk9mo=
=9hyP
-----END PGP SIGNATURE-----

Ludovic Courtès wrote 7 months ago
control message for bug #71993
(address . control@debbugs.gnu.org)
87h6bdsx5b.fsf@gnu.org
close 71993
quit
?
Your comment

This issue is archived.

To comment on this conversation send an email to 71993@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 71993
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help