GNU bug report logs - #54832
[patch] update glibc to 2.35

Previous Next

Package: guix-patches;

Reported by: zamfofex <zamfofex <at> twdb.moe>

Date: Sun, 10 Apr 2022 01:21:03 UTC

Severity: normal

Tags: patch

Done: Marius Bakke <marius <at> gnu.org>

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 54832 in the body.
You can then email your comments to 54832 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 guix-patches <at> gnu.org:
bug#54832; Package guix-patches. (Sun, 10 Apr 2022 01:21:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to zamfofex <zamfofex <at> twdb.moe>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 10 Apr 2022 01:21:03 GMT) Full text and rfc822 format available.

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

From: zamfofex <zamfofex <at> twdb.moe>
To: "guix-patches <at> gnu.org" <guix-patches <at> gnu.org>
Subject: [patch] update glibc to 2.35
Date: Sat, 9 Apr 2022 22:16:31 -0300 (BRT)
[Message part 1 (text/plain, inline)]
Hello! I have decided I wanted to work on updating glibc. I tested the updated glibc with the packages ‘hello’, ‘coreutils’, ‘grep’, ‘sed’ and ‘guile’, and they all built successfully!

I have attached the generated ‘git diff’ to this message, and I hope that is fine. If there are any issues, please feel free to let me know!
[glibc.diff (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#54832; Package guix-patches. (Sun, 10 Apr 2022 10:17:01 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: zamfofex <zamfofex <at> twdb.moe>, 54832 <at> debbugs.gnu.org
Subject: Re: [bug#54832] [patch] update glibc to 2.35
Date: Sun, 10 Apr 2022 12:16:30 +0200
[Message part 1 (text/plain, inline)]
zamfofex schreef op za 09-04-2022 om 22:16 [-0300]:
+                     (define empty-static-libraries '("libpthread.a"
"libdl.a" "libutil.a" "libanl.a"))
+                     (define (empty-static-library? file)
+                       (any (lambda (s) (string=? file s)) empty-
static-libraries))
+
                      (define (static-library? file)
                        ;; Return true if FILE is a static library. 
The
                        ;; "_nonshared.a" files are referred to by
libc.so,
                        ;; libpthread.so, etc., which are in fact
linker
                        ;; scripts.
                        (and (string-suffix? ".a" file)
-                            (not (string-contains file
"_nonshared"))))
+                            (not (string-contains file
"_nonshared"))
+                            (not (empty-static-library? file))))

Why are empty static libraries skipped?  Would "gcc -static -lpthread main.c" (*)
(in an environment that includes glibc:static) still work, or does it now fail?

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#54832; Package guix-patches. (Sun, 10 Apr 2022 10:18:02 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: zamfofex <zamfofex <at> twdb.moe>, 54832 <at> debbugs.gnu.org
Subject: Re: [bug#54832] [patch] update glibc to 2.35
Date: Sun, 10 Apr 2022 12:17:51 +0200
[Message part 1 (text/plain, inline)]
zamfofex schreef op za 09-04-2022 om 22:16 [-0300]:
> --- /dev/null
> +++ b/gnu/packages/patches/m4-failing-test-bug.patch
> @@ -0,0 +1,7 @@
> +--- a/tests/test-execute.sh
> ++++ b/tests/test-execute.sh
> +@@ -0,1 +0,3 @@
> +-for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ;
> do
> ++# Test case 5 is disabled because of a bug in Guix whereby
> ++# raising 'SIGINT' does not work as expected.
> ++for i in 0 1 2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ; do
> diff --git a/gnu/packages/patches/m4-shell.patch
> b/gnu/packages/patches/m4-shell.patch
> new file mode 100644
> index 0000000..f10e99f

An explanation and a link to an upstream report is mising.
(apparently upstream=Guix here?).

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#54832; Package guix-patches. (Sun, 10 Apr 2022 10:19:02 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: zamfofex <zamfofex <at> twdb.moe>, 54832 <at> debbugs.gnu.org
Subject: Re: [bug#54832] [patch] update glibc to 2.35
Date: Sun, 10 Apr 2022 12:18:28 +0200
[Message part 1 (text/plain, inline)]
zamfofex schreef op za 09-04-2022 om 22:16 [-0300]:
> diff --git a/gnu/packages/patches/m4-shell.patch
> b/gnu/packages/patches/m4-shell.patch
> new file mode 100644
> index 0000000..f10e99f
> --- /dev/null
> +++ b/gnu/packages/patches/m4-shell.patch
> @@ -0,0 +1,16 @@
> +--- a/lib/config.hin
> ++++ b/lib/config.hin
> +@@ -0,12 +0,1 @@
> +-/* File name of the Bourne shell.  */
> +-#if (defined _WIN32 && !defined __CYGWIN__) || defined __CYGWIN__
> || defined __ANDROID__
> +-/* Omit the directory part because
> +-   - For native Windows programs in a Cygwin environment, the
> Cygwin mounts
> +-     are not visible.
> +-   - For 32-bit Cygwin programs in a 64-bit Cygwin environment, the
> Cygwin
> +-     mounts are not visible.
> +-   - On Android, /bin/sh does not exist. It's /system/bin/sh
> instead.  */
> +-# define BOURNE_SHELL "sh"
> +-#else
> +-# define BOURNE_SHELL "/bin/sh"
> +-#endif
> ++# define BOURNE_SHELL "sh"

What's the reason for this patch?

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#54832; Package guix-patches. (Sun, 24 Apr 2022 16:00:03 GMT) Full text and rfc822 format available.

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

From: zamfofex <zamfofex <at> twdb.moe>
To: "54832 <at> debbugs.gnu.org" <54832 <at> debbugs.gnu.org>
Cc: "maximedevos <at> telenet.be" <maximedevos <at> telenet.be>
Subject: Fwd: Re: [bug#54832] [patch] update glibc to 2.35
Date: Sun, 24 Apr 2022 11:19:26 -0300 (BRT)
> Why are empty static libraries skipped?  Would "gcc -static -lpthread main.c" (*)
> (in an environment that includes glibc:static) still work, or does it now fail?

They are skipped from being moved, but then should be copied in the loop immediately below it.

> An explanation and a link to an upstream report is mising.
> (apparently upstream=Guix here?).

I’m not sure if there is a report yet. There is a conversation in IRC, however. See:

- <https://logs.guix.gnu.org/guix/2022-04-09.log#081848>
- <https://logs.guix.gnu.org/guix/2022-04-09.log#082442>
- <https://logs.guix.gnu.org/guix/2022-04-09.log#171259>
- <https://logs.guix.gnu.org/guix/2022-04-09.log#174339>

> What's the reason for this patch?

‘/bin/sh’ doesn’t seem available in the build environment, so tests were failing. From what I was able to see, that macro is only used in tests, so I didn’t think it would be worthwhile to make it refer to ‘/gnu/store/.../bash’.

- - - - - - -

Apologies to Maxime for the repeated messages, and to others for taking so long to reply. Apparently I hadn’t replied to the debbugs address, so my initial messages were sent only to Maxime.

I hope this can be looked into soon enough!




Information forwarded to guix-patches <at> gnu.org:
bug#54832; Package guix-patches. (Sun, 15 May 2022 21:33:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: zamfofex <zamfofex <at> twdb.moe>
Cc: Maxime Devos <maximedevos <at> telenet.be>, 54832 <at> debbugs.gnu.org
Subject: Re: bug#54832: [patch] update glibc to 2.35
Date: Sun, 15 May 2022 23:31:53 +0200
Hello!

zamfofex <zamfofex <at> twdb.moe> skribis:

> Hello! I have decided I wanted to work on updating glibc. I tested the updated glibc with the packages ‘hello’, ‘coreutils’, ‘grep’, ‘sed’ and ‘guile’, and they all built successfully!

Yay!

>               (base32
> -              "1zvp0qdfbdyqrzydz18d9zg3n5ygy8ps7cmny1bvsp8h1q05c99f"))
> -            (patches (search-patches "glibc-ldd-powerpc.patch"
> -                                     "glibc-ldd-x86_64.patch"
> -                                     "glibc-dl-cache.patch"

Could you confirm that these patches are no longer needed?

> +                     (define empty-static-libraries '("libpthread.a" "libdl.a" "libutil.a" "libanl.a"))
> +                     (define (empty-static-library? file)
> +                       (any (lambda (s) (string=? file s)) empty-static-libraries))

[...]

>                              (files  (scandir lib static-library?))
> +                            (files2 (scandir lib empty-static-library?))
>                              (static (assoc-ref outputs "static"))
>                              (slib   (string-append static "/lib")))
>                         (mkdir-p slib)
> @@ -876,6 +883,10 @@ (define (linker-script? file)
>                                     (rename-file (string-append lib "/" base)
>                                                  (string-append slib "/" base)))
>                                   files)
> +                       (for-each (lambda (base)
> +                                   (copy-file (string-append lib "/" base)
> +                                              (string-append slib "/" base)))
> +                                 files2)

Like Maxime wrote, this needs comments in the code.

Could you explain why the empty .a files need special treatment?  In the
end, it seems we’re copying them to the “static” output anyway, so why
not let them in ‘files’?

>  (define-public m4
>    (package
>     (name "m4")
> -   (version "1.4.18")
> +   (version "1.4.19")

This should be done in a separate patch.

> +++ b/gnu/packages/patches/m4-failing-test-bug.patch
> @@ -0,0 +1,7 @@
> +--- a/tests/test-execute.sh
> ++++ b/tests/test-execute.sh

Like Maxime wrote, please start the patch with a short comment
explaining what it does, and with a link to the upstream commit or bug
report.

One last thing: could you use ‘git format-patch’ and (optionally) ‘git
send-email’ to send a revised patch?

  https://guix.gnu.org/manual/devel/en/html_node/Submitting-Patches.html

Thanks in advance, and apologies for the delay!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#54832; Package guix-patches. (Mon, 06 Jun 2022 13:11:02 GMT) Full text and rfc822 format available.

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

From: zamfofex <zamfofex <at> twdb.moe>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Maxime Devos <maximedevos <at> telenet.be>, 54832 <at> debbugs.gnu.org
Subject: Re: bug#54832: [patch] update glibc to 2.35
Date: Mon, 6 Jun 2022 09:06:27 -0300 (BRT)
> Could you confirm that these patches are no longer needed?

I don’t remember exactly what my thought process was for removing the ‘glibc-dl-cache’ patch except that it wasn’t applicable anymore. At any rate, I don’t fully understand what the patch is actually doing, so it’s a bit difficult to assess whether it’s still necessary to me. (Help would be appreciated!)

Other than that, I did verify the other two patches, and it seems the regexes they were patching have already been fixed upstream!

> Could you explain why the empty .a files need special treatment?  In the end, it seems we’re copying them to the “static” output anyway, so why not let them in ‘files’?

Those files need to be present in both the ‘static’ and ‘out’ outputs, whereas without considering them specially, they would be moved to the ‘static’ output (with ‘rename-file’ as opposed to ‘copy-file’). Is a comment worthwhile? What should I write? I could explain the change in glibc that made those into empty ‘.a’ files and link to the changelog. Is that enough?

> This should be done in a separate patch.

That is fine. Though I will note that the previous version of m4 did not work with the updated glibc, so I think it would make sense to updated it *before* updating glibc in the commit history. Do I need to verify whether the newer version works with the previous glibc too?

> Like Maxime wrote, please start the patch with a short comment explaining what it does, and with a link to the upstream commit or bug report.

I’m still confused about what I should link to. I can write a comment explaining the issues and link to the IRC conversation we held, or maybe even to this thread. But I don’t think there actually is “an upstream commit or bug report” that I could link to.

> One last thing: could you use ‘git format-patch’ and (optionally) ‘git send-email’ to send a revised patch?

I definitely don’t mind investigating using those tools more carefully! I think I can prepare and send another patch once my questions are clarified.

- - -

Apologies to Maxime and Ludovic for the repeated messages once again and to others for taking so long to respond. I’m still getting familiar with sending emails properly!

At any rate, thank you for looking into it!




Information forwarded to guix-patches <at> gnu.org:
bug#54832; Package guix-patches. (Sun, 17 Jul 2022 10:07:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: zamfofex <zamfofex <at> twdb.moe>
Cc: Maxime Devos <maximedevos <at> telenet.be>, 54832 <at> debbugs.gnu.org
Subject: Re: bug#54832: [patch] update glibc to 2.35
Date: Sun, 17 Jul 2022 12:06:47 +0200
Hi!

Sorry for the long delay.

zamfofex <zamfofex <at> twdb.moe> skribis:

>> Could you confirm that these patches are no longer needed?
>
> I don’t remember exactly what my thought process was for removing the ‘glibc-dl-cache’ patch except that it wasn’t applicable anymore. At any rate, I don’t fully understand what the patch is actually doing, so it’s a bit difficult to assess whether it’s still necessary to me. (Help would be appreciated!)

There’s a comment at the top of ‘glibc-dl-cache.patch’ that explains
what it does, but see
<https://guix.gnu.org/en/blog/2021/taming-the-stat-storm-with-a-loader-cache/>
for details.  I can take a look and update it.

> Other than that, I did verify the other two patches, and it seems the regexes they were patching have already been fixed upstream!

Great.

>> Could you explain why the empty .a files need special treatment?  In the end, it seems we’re copying them to the “static” output anyway, so why not let them in ‘files’?
>
> Those files need to be present in both the ‘static’ and ‘out’ outputs,

Why?

> whereas without considering them specially, they would be moved to the
> ‘static’ output (with ‘rename-file’ as opposed to ‘copy-file’). Is a
> comment worthwhile? What should I write? I could explain the change in
> glibc that made those into empty ‘.a’ files and link to the
> changelog. Is that enough?

We’d need a comment like “Keep empty .a files in OUT in addition to
STATIC because …”.

>> This should be done in a separate patch.
>
> That is fine. Though I will note that the previous version of m4 did not work with the updated glibc, so I think it would make sense to updated it *before* updating glibc in the commit history. Do I need to verify whether the newer version works with the previous glibc too?

Ideally yes.

>> Like Maxime wrote, please start the patch with a short comment explaining what it does, and with a link to the upstream commit or bug report.
>
> I’m still confused about what I should link to. I can write a comment explaining the issues and link to the IRC conversation we held, or maybe even to this thread. But I don’t think there actually is “an upstream commit or bug report” that I could link to.

When applying a patch to a package, we seek to document the reason why
we’re doing it, to ease maintenance; usually, patches come from a bug
report or from a change upstream, so we would like to it.

>> One last thing: could you use ‘git format-patch’ and (optionally) ‘git send-email’ to send a revised patch?
>
> I definitely don’t mind investigating using those tools more carefully! I think I can prepare and send another patch once my questions are clarified.

Perfect.  I realize upgrading glibc is a rather tricky task, so thanks
for giving it a try!  Surely we can team up to get it past the finish
line.

Thanks!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#54832; Package guix-patches. (Tue, 19 Jul 2022 16:13:01 GMT) Full text and rfc822 format available.

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

From: zamfofex <zamfofex <at> twdb.moe>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Maxime Devos <maximedevos <at> telenet.be>, 54832 <at> debbugs.gnu.org
Subject: Re: bug#54832: [patch] update glibc to 2.35
Date: Tue, 19 Jul 2022 11:12:51 -0300 (BRT)
[Message part 1 (text/plain, inline)]
> There’s a comment at the top of ‘glibc-dl-cache.patch’ that explains
> what it does, but see
> <https://guix.gnu.org/en/blog/2021/taming-the-stat-storm-with-a-loader-cache/>
> for details.  I can take a look and update it.

It seems we both misinterpreted the diff I had sent originally, as that patch has not actually been removed, but rather its line was changed (it was moved upwards). So good news, no need for changes or further investigation!

> We’d need a comment like “Keep empty .a files in OUT in addition to
> STATIC because …”.

I added a comment explaining the change! I hope it is enough.

> [conversation about M4 changes]

Apparently M4 has already been updated in core-updates by now! So that all of that has already been resolved.

> Perfect.  I realize upgrading glibc is a rather tricky task, so thanks
> for giving it a try!  Surely we can team up to get it past the finish
> line.

Thanks for the encouragement! However, since glibc 2.36 releases a few weeks from now, do you feel like it would make sense to wait until then to update it? I suppose it could always be updated again later, but I don’t know if that’s ideal.

- - -

Also, I could not figure out how to use ‘git prepare-patch’ or ‘git send-email’ properly, so I hope a ‘git diff’ attachment is enough.
[glibc.diff (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#54832; Package guix-patches. (Tue, 19 Jul 2022 19:17:02 GMT) Full text and rfc822 format available.

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

From: Greg Hogan <code <at> greghogan.com>
To: zamfofex <zamfofex <at> twdb.moe>
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Maxime Devos <maximedevos <at> telenet.be>, 54832 <at> debbugs.gnu.org
Subject: Re: [bug#54832] [patch] update glibc to 2.35
Date: Tue, 19 Jul 2022 15:16:12 -0400
On Tue, Jul 19, 2022 at 12:14 PM zamfofex <zamfofex <at> twdb.moe> wrote:
>
> > There’s a comment at the top of ‘glibc-dl-cache.patch’ that explains
> > what it does, but see
> > <https://guix.gnu.org/en/blog/2021/taming-the-stat-storm-with-a-loader-cache/>
> > for details.  I can take a look and update it.
>
> It seems we both misinterpreted the diff I had sent originally, as that patch has not actually been removed, but rather its line was changed (it was moved upwards). So good news, no need for changes or further investigation!

I have used your patch to bootstrap with GCC 12 (in order to use both
gcc-12 and llvm-14 in the same profile) and I have found that without
"glibc-ldd-x86_64.patch", sometimes ldd will throw a "not a dynamic
executable" error. I assume the powerpc patch is likewise still
required.

> Thanks for the encouragement! However, since glibc 2.36 releases a few weeks from now, do you feel like it would make sense to wait until then to update it? I suppose it could always be updated again later, but I don’t know if that’s ideal.

I would like to see the 2.35 upgrade since others may benefit before
the 2.36 release and in case of a core-updates merge to master.

Greg




Reply sent to Marius Bakke <marius <at> gnu.org>:
You have taken responsibility. (Thu, 01 Sep 2022 22:34:01 GMT) Full text and rfc822 format available.

Notification sent to zamfofex <zamfofex <at> twdb.moe>:
bug acknowledged by developer. (Thu, 01 Sep 2022 22:34:02 GMT) Full text and rfc822 format available.

Message #37 received at 54832-close <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <marius <at> gnu.org>
To: Greg Hogan <code <at> greghogan.com>, zamfofex <zamfofex <at> twdb.moe>
Cc: 54832-close <at> debbugs.gnu.org,
 Ludovic Courtès <ludo <at> gnu.org>,
 Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: [bug#54832] [patch] update glibc to 2.35
Date: Fri, 02 Sep 2022 00:32:56 +0200
[Message part 1 (text/plain, inline)]
Greg Hogan <code <at> greghogan.com> skriver:

> On Tue, Jul 19, 2022 at 12:14 PM zamfofex <zamfofex <at> twdb.moe> wrote:
>>
>> > There’s a comment at the top of ‘glibc-dl-cache.patch’ that explains
>> > what it does, but see
>> > <https://guix.gnu.org/en/blog/2021/taming-the-stat-storm-with-a-loader-cache/>
>> > for details.  I can take a look and update it.
>>
>> It seems we both misinterpreted the diff I had sent originally, as that patch has not actually been removed, but rather its line was changed (it was moved upwards). So good news, no need for changes or further investigation!
>
> I have used your patch to bootstrap with GCC 12 (in order to use both
> gcc-12 and llvm-14 in the same profile) and I have found that without
> "glibc-ldd-x86_64.patch", sometimes ldd will throw a "not a dynamic
> executable" error. I assume the powerpc patch is likewise still
> required.

I submitted a variant of this patch to #57533 that preserves
glibc-ldd-x86_64.patch.

Closing this issue, as it has been superseded by #57533.

Thanks zamfofex!
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 30 Sep 2022 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 209 days ago.

Previous Next


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