all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: John Kehayias <john.kehayias@protonmail.com>
Cc: "50830@debbugs.gnu.org" <50830@debbugs.gnu.org>
Subject: bug#50830: [core-updates-frozen] glibc looks for $sysconfdir/etc/localtime rather than /etc/localtime
Date: Mon, 27 Sep 2021 23:08:58 +0200	[thread overview]
Message-ID: <87mtnxhgk5.fsf@gnu.org> (raw)
In-Reply-To: <bXUzWJdaNKU-2XUblcVg5r8dyx8mGZUvEZUJUw-bq1cPItFBC_0hsoS5PZ-3QgqCRHoEFReHQT-TB8mj9gfCcsUvCFA2VI3ePieDxdox8Uo=@protonmail.com> (John Kehayias's message of "Sun, 26 Sep 2021 21:06:53 +0000")

[-- Attachment #1: Type: text/plain, Size: 690 bytes --]

Hi,

John Kehayias <john.kehayias@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’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-glibc-Remove-unneeded-nscd-patching.patch --]
[-- Type: text/x-patch, Size: 1520 bytes --]

From d27621e9af056c91e1419ce678614b9dfd5956d1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-glibc-Look-for-the-current-timezone-in-etc-local.patch --]
[-- Type: text/x-patch, Size: 4781 bytes --]

From 73120bc3a430b677afb3d9e0ead1567fdb961aa5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@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


  reply	other threads:[~2021-09-27 21:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-26 20:46 bug#50830: [core-updates-frozen] glibc looks for $sysconfdir/etc/localtime rather than /etc/localtime Ludovic Courtès
2021-09-26 21:06 ` John Kehayias via Bug reports for GNU Guix
2021-09-27 21:08   ` Ludovic Courtès [this message]
2021-09-27 23:09     ` Leo Famulari
2021-09-28  9:25       ` Ludovic Courtès
2021-09-29 14:35         ` Leo Famulari
2021-11-12  6:07 ` Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mtnxhgk5.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=50830@debbugs.gnu.org \
    --cc=john.kehayias@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.