GNU bug report logs - #50830
[core-updates-frozen] glibc looks for $sysconfdir/etc/localtime rather than /etc/localtime

Previous Next

Package: guix;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Sun, 26 Sep 2021 20:47:02 UTC

Severity: important

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50830 in the body.
You can then email your comments to 50830 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#50830; Package guix. (Sun, 26 Sep 2021 20:47:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 26 Sep 2021 20:47:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: bug-guix <at> gnu.org
Subject: [core-updates-frozen] glibc looks for $sysconfdir/etc/localtime
 rather than /etc/localtime
Date: Sun, 26 Sep 2021 22:46:42 +0200
As podiki reported on IRC, with ‘core-updates-frozen’
ca. 1fb75128a5202b406622da6272bc809c46d1f439, libc looks for
/gnu/store/…-glibc-2.33/etc/localtime instead of /etc/localtime.

Consequently, commands such as ‘date’ display UTC time regardless of the
configured timezone.

Fixing it will require a world rebuild that we could batch with Maxime’s
changes at <https://issues.guix.gnu.org/50358>.

Thanks,
Ludo’.




Severity set to 'important' from 'normal' Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 26 Sep 2021 20:48:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#50830; Package guix. (Sun, 26 Sep 2021 21:08:01 GMT) Full text and rfc822 format available.

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

From: John Kehayias <john.kehayias <at> protonmail.com>
To: "50830 <at> debbugs.gnu.org" <50830 <at> debbugs.gnu.org>
Subject: [core-updates-frozen] glibc looks for $sysconfdir/etc/localtime
 rather than /etc/localtime
Date: Sun, 26 Sep 2021 21:06:53 +0000
Just to followup, here is the relevant part of my `guix describe`:

  guix c6a8d6d
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: core-updates-frozen
    commit: c6a8d6db77520097bd0b2df99bfab659bfcfd64c

On a side note, nearly everything else seems to work well for me on core-updates-frozen. Will be happy to test a post-world-rebuild when that comes.




Information forwarded to bug-guix <at> gnu.org:
bug#50830; Package guix. (Mon, 27 Sep 2021 21:10:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: John Kehayias <john.kehayias <at> protonmail.com>
Cc: "50830 <at> debbugs.gnu.org" <50830 <at> debbugs.gnu.org>
Subject: Re: bug#50830: [core-updates-frozen] glibc looks for
 $sysconfdir/etc/localtime rather than /etc/localtime
Date: Mon, 27 Sep 2021 23:08:58 +0200
[Message part 1 (text/plain, inline)]
Hi,

John Kehayias <john.kehayias <at> protonmail.com> skribis:

> Just to followup, here is the relevant part of my `guix describe`:
>
>   guix c6a8d6d
>     repository URL: https://git.savannah.gnu.org/git/guix.git
>     branch: core-updates-frozen
>     commit: c6a8d6db77520097bd0b2df99bfab659bfcfd64c
>
> On a side note, nearly everything else seems to work well for me on core-updates-frozen. Will be happy to test a post-world-rebuild when that comes.

Yay, nice!

So here’s a patch to fix it, and another one to do a minor cleanup
operation.

I’ve confirmed that glibc 2.33 builds fine, as well as 2.31.

I haven’t checked cross-compilation yet.

Ludo’.

[0001-gnu-glibc-Remove-unneeded-nscd-patching.patch (text/x-patch, inline)]
From d27621e9af056c91e1419ce678614b9dfd5956d1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo <at> gnu.org>
Date: Mon, 27 Sep 2021 14:18:12 +0200
Subject: [PATCH 1/2] gnu: glibc: Remove unneeded nscd patching.

This change had no effect already in glibc 2.29, which has proper
versioning.

* gnu/packages/base.scm (glibc)[arguments]: Remove obsolete
'nscd/nscd_stat.c' 'substitute*' statement.
---
 gnu/packages/base.scm | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 174af43917..9c45f524dc 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -830,15 +830,6 @@ the store.")
                          (string-append "#define _PATH_BSHELL \""
                                         bash "/bin/sh\"\n")))
 
-                      ;; Nscd uses __DATE__ and __TIME__ to create a string to
-                      ;; make sure the client and server come from the same
-                      ;; libc.  Use something deterministic instead.
-                      (substitute* "nscd/nscd_stat.c"
-                        (("static const char compilation\\[21\\] =.*$")
-                         (string-append
-                          "static const char compilation[21] = \""
-                          (string-take (basename out) 20) "\";\n")))
-
                       ;; Make sure we don't retain a reference to the
                       ;; bootstrap Perl.
                       (substitute* "malloc/mtrace.pl"
-- 
2.33.0

[0002-gnu-glibc-Look-for-the-current-timezone-in-etc-local.patch (text/x-patch, inline)]
From 73120bc3a430b677afb3d9e0ead1567fdb961aa5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo <at> gnu.org>
Date: Mon, 27 Sep 2021 14:19:48 +0200
Subject: [PATCH 2/2] gnu: glibc: Look for the current timezone in
 /etc/localtime.

Fixes <https://issues.guix.gnu.org/50830>.
Reported by podiki on #guix.

Previously, glibc 2.33 would look for
/gnu/store/...-glibc-2.33/etc/localtime instead of /etc/localtime.

* gnu/packages/base.scm (glibc)[arguments]: Remove #:make-flags.
[phases]: In 'pre-configure', modify 'inet/Makefile' instead of
'sunrpc/Makefile' since this is where these bits are in 2.33.
(glibc-2.31)[arguments]: Add 'set-etc-rpc-installation-directory'
phase.
(glibc-2.30): Inherit from GLIBC-2.31.
* gnu/tests/base.scm (run-basic-test)["libc honors /etc/localtime"]: New
test.
---
 gnu/packages/base.scm | 25 ++++++++++++++++---------
 gnu/tests/base.scm    | 11 +++++++++++
 2 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 9c45f524dc..68f238a2fe 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -775,11 +775,6 @@ the store.")
                   '("--disable-werror")
                   '()))
 
-      ;; Arrange so that /etc/rpc & co. go to $out/etc.
-      #:make-flags (list (string-append "sysconfdir="
-                                        (assoc-ref %outputs "out")
-                                        "/etc"))
-
       #:tests? #f                                 ; XXX
       #:phases (modify-phases %standard-phases
                  (add-before
@@ -793,8 +788,7 @@ the store.")
                            (bash (or (assoc-ref inputs "static-bash")
                                      (assoc-ref native-inputs "static-bash"))))
                       ;; Install the rpc data base file under `$out/etc/rpc'.
-                      ;; FIXME: Use installFlags = [ "sysconfdir=$(out)/etc" ];
-                      (substitute* "sunrpc/Makefile"
+                      (substitute* "inet/Makefile"
                         (("^\\$\\(inst_sysconfdir\\)/rpc(.*)$" _ suffix)
                          (string-append out "/etc/rpc" suffix "\n"))
                         (("^install-others =.*$")
@@ -950,11 +944,24 @@ with the Linux kernel.")
                         "glibc-2.31-hurd-clock_gettime_monotonic.patch"
                         "glibc-hurd-signal-sa-siginfo.patch"
                         "glibc-hurd-mach-print.patch"
-                        "glibc-hurd-gettyent.patch"))))))
+                        "glibc-hurd-gettyent.patch"))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments glibc)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-before 'configure 'set-etc-rpc-installation-directory
+             (lambda* (#:key outputs #:allow-other-keys)
+               ;; Install the rpc data base file under `$out/etc/rpc'.
+               (let ((out (assoc-ref outputs "out")))
+                 (substitute* "sunrpc/Makefile"
+                   (("^\\$\\(inst_sysconfdir\\)/rpc(.*)$" _ suffix)
+                    (string-append out "/etc/rpc" suffix "\n"))
+                   (("^install-others =.*$")
+                    (string-append "install-others = " out "/etc/rpc\n"))))))))))))
 
 (define-public glibc-2.30
   (package
-    (inherit glibc)
+    (inherit glibc-2.31)
     (version "2.30")
     (native-inputs
      ;; This fails with a build error in libc-tls.c when using GCC 10.  Use an
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 4bc3598874..ce4e682200 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -87,6 +87,7 @@ Otherwise assume that there is no password for root."
           (use-modules (gnu build marionette)
                        (guix build syscalls)
                        (srfi srfi-1)
+                       (srfi srfi-19)
                        (srfi srfi-26)
                        (srfi srfi-64)
                        (ice-9 match))
@@ -196,6 +197,16 @@ info --version")
                      (pk 'services services)
                      '(root #$@(operating-system-shepherd-service-names os)))))
 
+          (test-equal "libc honors /etc/localtime"
+            -7200          ;CEST = GMT+2
+            ;; Assume OS is configured to have a CEST timezone.
+            (let* ((sept-2021 (time-second
+                               (date->time-utc
+                                (make-date 0 0 00 12 01 09 2021 7200)))))
+              (marionette-eval
+               `(tm:gmtoff (localtime ,sept-2021))
+               marionette)))
+
           (test-equal "/var/log/messages is not world-readable"
             #o640                                ;<https://bugs.gnu.org/40405>
             (begin
-- 
2.33.0


Added indication that bug 50830 blocks50358 Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 27 Sep 2021 21:27:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#50830; Package guix. (Mon, 27 Sep 2021 23:11:02 GMT) Full text and rfc822 format available.

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

From: Leo Famulari <leo <at> famulari.name>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: John Kehayias <john.kehayias <at> protonmail.com>,
 "50830 <at> debbugs.gnu.org" <50830 <at> debbugs.gnu.org>
Subject: Re: bug#50830: [core-updates-frozen] glibc looks for
 $sysconfdir/etc/localtime rather than /etc/localtime
Date: Mon, 27 Sep 2021 19:09:59 -0400
On Mon, Sep 27, 2021 at 11:08:58PM +0200, Ludovic Courtès wrote:
> So here’s a patch to fix it, and another one to do a minor cleanup
> operation.

I created a "tracking bug" to coordinate rebuilding the world:

<https://bugs.gnu.org/50860>




Added indication that bug 50830 blocks50860 Request was from Leo Famulari <leo <at> famulari.name> to control <at> debbugs.gnu.org. (Mon, 27 Sep 2021 23:12:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#50830; Package guix. (Tue, 28 Sep 2021 09:26:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Leo Famulari <leo <at> famulari.name>
Cc: John Kehayias <john.kehayias <at> protonmail.com>,
 "50830 <at> debbugs.gnu.org" <50830 <at> debbugs.gnu.org>
Subject: Re: bug#50830: [core-updates-frozen] glibc looks for
 $sysconfdir/etc/localtime rather than /etc/localtime
Date: Tue, 28 Sep 2021 11:25:45 +0200
Leo Famulari <leo <at> famulari.name> skribis:

> On Mon, Sep 27, 2021 at 11:08:58PM +0200, Ludovic Courtès wrote:
>> So here’s a patch to fix it, and another one to do a minor cleanup
>> operation.
>
> I created a "tracking bug" to coordinate rebuilding the world:
>
> <https://bugs.gnu.org/50860>

There was already <https://issues.guix.gnu.org/50358>, and I made this
bug a blocker.  I’ll email guix-devel so we can coordinate.

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#50830; Package guix. (Wed, 29 Sep 2021 14:37:02 GMT) Full text and rfc822 format available.

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

From: Leo Famulari <leo <at> famulari.name>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: John Kehayias <john.kehayias <at> protonmail.com>,
 "50830 <at> debbugs.gnu.org" <50830 <at> debbugs.gnu.org>, 50860-done <at> debbugs.gnu.org
Subject: Re: bug#50830: [core-updates-frozen] glibc looks for
 $sysconfdir/etc/localtime rather than /etc/localtime
Date: Wed, 29 Sep 2021 10:35:58 -0400
On Tue, Sep 28, 2021 at 11:25:45AM +0200, Ludovic Courtès wrote:
> Leo Famulari <leo <at> famulari.name> skribis:
> 
> > On Mon, Sep 27, 2021 at 11:08:58PM +0200, Ludovic Courtès wrote:
> >> So here’s a patch to fix it, and another one to do a minor cleanup
> >> operation.
> >
> > I created a "tracking bug" to coordinate rebuilding the world:
> >
> > <https://bugs.gnu.org/50860>
> 
> There was already <https://issues.guix.gnu.org/50358>, and I made this
> bug a blocker.  I’ll email guix-devel so we can coordinate.

Oh, my mistake. I hadn't noticed that #50358 was about more than the
Rust bootstrap. I'm closing my duplicated bug.




Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Fri, 12 Nov 2021 06:08:03 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Fri, 12 Nov 2021 06:08:03 GMT) Full text and rfc822 format available.

Message #31 received at 50830-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 50830-done <at> debbugs.gnu.org
Subject: Re: bug#50830: [core-updates-frozen] glibc looks for
 $sysconfdir/etc/localtime rather than /etc/localtime
Date: Fri, 12 Nov 2021 01:07:15 -0500
Hello,

Ludovic Courtès <ludo <at> gnu.org> writes:

> As podiki reported on IRC, with ‘core-updates-frozen’
> ca. 1fb75128a5202b406622da6272bc809c46d1f439, libc looks for
> /gnu/store/…-glibc-2.33/etc/localtime instead of /etc/localtime.
>
> Consequently, commands such as ‘date’ display UTC time regardless of the
> configured timezone.
>
> Fixing it will require a world rebuild that we could batch with Maxime’s
> changes at <https://issues.guix.gnu.org/50358>.
>
> Thanks,
> Ludo’.

That's now in core-updates-frozen with commit
8c801194b548d1f2d6f47dfcdd5611ae72e29759.

Thanks!

Closing.

Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 10 Dec 2021 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 131 days ago.

Previous Next


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