GNU bug report logs - #61879
[core-updates] libstdc++ fails to build on powerpc64le-linux

Previous Next

Package: guix;

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

Date: Tue, 28 Feb 2023 23:17:02 UTC

Severity: important

Done: Andreas Enge <andreas <at> enge.fr>

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 61879 in the body.
You can then email your comments to 61879 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#61879; Package guix. (Tue, 28 Feb 2023 23:17:03 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. (Tue, 28 Feb 2023 23:17:03 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] libstdc++ fails to build on powerpc64le-linux
Date: Wed, 01 Mar 2023 00:16:54 +0100
From <https://ci.guix.gnu.org/build/440447/details> (commit
0825162a35362640b47d3cabe278fd7ea49140bd and later):

--8<---------------cut here---------------start------------->8---
libtool: compile:  g++ -I/tmp/guix-build-libstdc++-11.3.0.drv-0/gcc-11.3.0/libstdc++-v3/../libgcc -I/tmp/guix-build-libstdc++-11.3.0.drv-0/gcc-11.3.0/build/include/ -I/tmp/guix-build-libstdc++-11.3.0.drv-0/gcc-11.3.0/build/include -I/tmp/guix-build-libstdc++-11.3.0.drv-0/gcc-11.3.0/libstdc++-v3/libsupc++ -std=gnu++17 -nostdinc++ -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=fs_path.lo -mno-gnu-attribute -fimplicit-templates -c ../../../libstdc++-v3/src/c++17/fs_path.cc
../../../libstdc++-v3/src/c++17/floating_from_chars.cc: In function 'std::from_chars_result std::from_chars(const char*, const char*, __ieee128&, std::chars_format)':
../../../libstdc++-v3/src/c++17/floating_from_chars.cc:499:8: error: 'string' is not a member of 'std::pmr'; did you mean 'std::string'?
  499 |   pmr::string buf(&mr);
      |        ^~~~~~
In file included from /tmp/guix-build-libstdc++-11.3.0.drv-0/gcc-11.3.0/build/include/string:39,
                 from ../../../libstdc++-v3/src/c++17/floating_from_chars.cc:34:
/tmp/guix-build-libstdc++-11.3.0.drv-0/gcc-11.3.0/build/include/bits/stringfwd.h:79:33: note: 'std::string' declared here
   79 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
../../../libstdc++-v3/src/c++17/floating_from_chars.cc:504:55: error: 'buf' was not declared in this scope
  504 |       if (const char* pat = pattern(first, last, fmt, buf)) [[likely]]
      |                                                       ^~~
make[3]: *** [Makefile:762: floating_from_chars.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from ../../../libstdc++-v3/src/c++17/fs_ops.cc:58:
../../../libstdc++-v3/src/c++17/../filesystem/ops-common.h: In function 'std::filesystem::file_type std::filesystem::make_file_type(const stat_type&)':
../../../libstdc++-v3/src/c++17/../filesystem/ops-common.h:269:35: warning: unused parameter 'st' [-Wunused-parameter]
  269 |   make_file_type(const stat_type& st) noexcept
      |                  ~~~~~~~~~~~~~~~~~^~
make[3]: Leaving directory '/tmp/guix-build-libstdc++-11.3.0.drv-0/gcc-11.3.0/build/src/c++17'
make[2]: *** [Makefile:765: all-recursive] Error 1
make[2]: Leaving directory '/tmp/guix-build-libstdc++-11.3.0.drv-0/gcc-11.3.0/build/src'
make[1]: *** [Makefile:568: all-recursive] Error 1
make[1]: Leaving directory '/tmp/guix-build-libstdc++-11.3.0.drv-0/gcc-11.3.0/build'
make: *** [Makefile:493: all] Error 2
error: in phase 'build': uncaught exception:
srfi-34 #<condition &invoke-error [program: "make" arguments: ("-j" "32") exit-status: 2 term-signal: #f stop-signal: #f] 7fffefc213c0> 
phase `build' failed after 6.0 seconds
command "make" "-j" "32" failed with status 2
builder for `/gnu/store/bpx8ar4qq4bkskhhj25l5phxxji0ljf8-libstdc++-11.3.0.drv' failed with exit code 1
@ build-failed /gnu/store/bpx8ar4qq4bkskhhj25l5phxxji0ljf8-libstdc++-11.3.0.drv - 1 builder for `/gnu/store/bpx8ar4qq4bkskhhj25l5phxxji0ljf8-libstdc++-11.3.0.drv' failed with exit code 1
--8<---------------cut here---------------end--------------->8---

Ludo’.




Severity set to 'important' from 'normal' Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 01 Mar 2023 15:32:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#61879; Package guix. (Thu, 13 Apr 2023 09:33:02 GMT) Full text and rfc822 format available.

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

From: Andreas Enge <andreas <at> enge.fr>
To: guix-devel <at> gnu.org
Cc: 61879 <at> debbugs.gnu.org, Efraim Flashner <efraim <at> flashner.co.il>
Subject: Powerpc on core-updates
Date: Thu, 13 Apr 2023 11:32:22 +0200
Hello,

recently I claimed that powerpc was repaired, but I must have made a mistake.
It is still completely broken:
   https://ci.guix.gnu.org/eval/391720/dashboard?system=powerpc64le-linux
due to this:
   https://issues.guix.gnu.org/61879
 
It does not look easy to fix, but might be *the* blocker for a core-updates
merge...

The error is this:
../../../libstdc++-v3/src/c++17/floating_from_chars.cc: In function 'std::from_chars_result std::from_chars(const char*, const char*, __ieee128&, std::chars_format)':
../../../libstdc++-v3/src/c++17/floating_from_chars.cc:499:8: error: 'string' is not a member of 'std::pmr'; did you mean 'std::string'?
  499 |   pmr::string buf(&mr);
      |        ^~~~~~
In file included from /tmp/guix-build-libstdc++-11.3.0.drv-0/gcc-11.3.0/build/include/string:39,
                 from ../../../libstdc++-v3/src/c++17/floating_from_chars.cc:34:
/tmp/guix-build-libstdc++-11.3.0.drv-0/gcc-11.3.0/build/include/bits/stringfwd.h:79:33: note: 'std::string' declared here
   79 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
../../../libstdc++-v3/src/c++17/floating_from_chars.cc:504:55: error: 'buf' was not declared in this scope
  504 |       if (const char* pat = pattern(first, last, fmt, buf)) [[likely]]

In the file
   libstdc++-v3/src/c++17/floating_from_chars.cc
previous functions have code like this:
#if _GLIBCXX_USE_CXX11_ABI
  buffer_resource mr;
  pmr::string buf(&mr);
#else
  string buf;
  if (!reserve_string(buf))
    return make_result(first, 0, {}, ec);
#endif

while here we only have:
  buffer_resource mr;
  pmr::string buf(&mr);

So my guess would be that we should simply replace this snippet with the
one above.

Could someone with access to a powerpc machine try out this change?

Andreas





Information forwarded to bug-guix <at> gnu.org:
bug#61879; Package guix. (Thu, 13 Apr 2023 09:53:01 GMT) Full text and rfc822 format available.

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

From: Andreas Enge <andreas <at> enge.fr>
To: guix-devel <at> gnu.org
Cc: 61879 <at> debbugs.gnu.org, Efraim Flashner <efraim <at> flashner.co.il>
Subject: Re: Powerpc on core-updates
Date: Thu, 13 Apr 2023 11:51:51 +0200
[Message part 1 (text/plain, inline)]
I may as well try to provide a patch. It is untested even on x86_64,
since it requires quite a few rebuilds. If it works on powerpc, it should
probably be made conditional on the architecture to avoid a world rebuild.
I do not know whether this is possible in the patches field in an origin.

Andreas

[0001-gnu-gcc-11-Fix-build-on-powerpc64le.patch (text/plain, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#61879; Package guix. (Thu, 13 Apr 2023 13:50:02 GMT) Full text and rfc822 format available.

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

From: Christopher Baines <mail <at> cbaines.net>
To: Andreas Enge <andreas <at> enge.fr>
Cc: guix-devel <at> gnu.org, 61879 <at> debbugs.gnu.org,
 Efraim Flashner <efraim <at> flashner.co.il>
Subject: Re: bug#61879: Powerpc on core-updates
Date: Thu, 13 Apr 2023 14:46:00 +0100
[Message part 1 (text/plain, inline)]
Andreas Enge <andreas <at> enge.fr> writes:

> In the file
>    libstdc++-v3/src/c++17/floating_from_chars.cc
> previous functions have code like this:
> #if _GLIBCXX_USE_CXX11_ABI
>   buffer_resource mr;
>   pmr::string buf(&mr);
> #else
>   string buf;
>   if (!reserve_string(buf))
>     return make_result(first, 0, {}, ec);
> #endif
>
> while here we only have:
>   buffer_resource mr;
>   pmr::string buf(&mr);
>
> So my guess would be that we should simply replace this snippet with the
> one above.
>
> Could someone with access to a powerpc machine try out this change?

Thanks for figuring this out Andreas! I've managed to apply this change
in the relevant place, and it appears to work.

I tried to apply it in a way that only affected powerpc64le-linux, but
I'm not sure I was successful. I've got no idea where it's best to apply
this patch, or how describe it, but at least this is a step forward.

[0001-WIP.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#61879; Package guix. (Thu, 13 Apr 2023 14:07:01 GMT) Full text and rfc822 format available.

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

From: Andreas Enge <andreas <at> enge.fr>
To: Christopher Baines <mail <at> cbaines.net>
Cc: guix-devel <at> gnu.org, 61879 <at> debbugs.gnu.org
Subject: Re: bug#61879: Powerpc on core-updates
Date: Thu, 13 Apr 2023 16:06:16 +0200
Am Thu, Apr 13, 2023 at 02:46:00PM +0100 schrieb Christopher Baines:
> Thanks for figuring this out Andreas! I've managed to apply this change
> in the relevant place, and it appears to work.

Good news, thanks!

> +          #$@(if (and (target-ppc64le?)
> +                      (version>=? (package-version gcc) "11"))

The file changed a lot on master, and the patch will not apply and
should not be needed there. I did not check, but I think it is already
not needed for gcc <at> 12 any more. So we should probably check for the
major version being equal to 11.

It should be easy to check that it does not cause any rebuilds on the
other architectures, and we cannot break powerpc more than it already
is, so feel free to push something along these lines to core-updates.

Andreas





Information forwarded to bug-guix <at> gnu.org:
bug#61879; Package guix. (Thu, 13 Apr 2023 16:58:02 GMT) Full text and rfc822 format available.

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

From: Andreas Enge <andreas <at> enge.fr>
To: 61879 <at> debbugs.gnu.org, Christopher Baines <mail <at> cbaines.net>
Subject: Patch
Date: Thu, 13 Apr 2023 18:57:41 +0200
[Message part 1 (text/plain, inline)]
Hello,

attached is a new commit in old syntax, mixing both our commits.
I have confirmed that it does not change the gcc-11 build on x86_64 and i686.
But do we need "--force" for patching?

Could you maybe check again whether this builds gcc-11 on powerpc?

If yes, we can push it, and feel free to gexpify it in a separate commit.

Andreas

[0001-gnu-gcc-11-Fix-build-on-powerpc64le.patch (text/plain, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#61879; Package guix. (Fri, 14 Apr 2023 08:17:02 GMT) Full text and rfc822 format available.

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

From: Andreas Enge <andreas <at> enge.fr>
To: 61879 <at> debbugs.gnu.org, Christopher Baines <mail <at> cbaines.net>
Subject: Re: Patch
Date: Fri, 14 Apr 2023 10:15:52 +0200
Am Thu, Apr 13, 2023 at 06:57:41PM +0200 schrieb Andreas Enge:
> attached is a new commit in old syntax, mixing both our commits.
> I have confirmed that it does not change the gcc-11 build on x86_64 and i686.
> But do we need "--force" for patching?
> Could you maybe check again whether this builds gcc-11 on powerpc?

I just pushed it, since it cannot break much... If CI shows it does not
work, we can still revert it.

Andreas





Information forwarded to bug-guix <at> gnu.org:
bug#61879; Package guix. (Fri, 14 Apr 2023 08:23:02 GMT) Full text and rfc822 format available.

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

From: Christopher Baines <mail <at> cbaines.net>
To: Andreas Enge <andreas <at> enge.fr>
Cc: 61879 <at> debbugs.gnu.org
Subject: Re: Patch
Date: Fri, 14 Apr 2023 09:20:03 +0100
[Message part 1 (text/plain, inline)]
Andreas Enge <andreas <at> enge.fr> writes:

> Am Thu, Apr 13, 2023 at 06:57:41PM +0200 schrieb Andreas Enge:
>> attached is a new commit in old syntax, mixing both our commits.
>> I have confirmed that it does not change the gcc-11 build on x86_64 and i686.
>> But do we need "--force" for patching?
>> Could you maybe check again whether this builds gcc-11 on powerpc?
>
> I just pushed it, since it cannot break much... If CI shows it does not
> work, we can still revert it.

I haven't tried this yet, but I've had a quick look. I'm not sure
search-patches will work where it is, since that'll be running in the
build environment, without any access to the patches in the Guix git
repository.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#61879; Package guix. (Fri, 14 Apr 2023 09:44:02 GMT) Full text and rfc822 format available.

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

From: Andreas Enge <andreas <at> enge.fr>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 61879 <at> debbugs.gnu.org
Subject: Re: Patch
Date: Fri, 14 Apr 2023 11:42:56 +0200
Am Fri, Apr 14, 2023 at 09:20:03AM +0100 schrieb Christopher Baines:
> I haven't tried this yet, but I've had a quick look. I'm not sure
> search-patches will work where it is, since that'll be running in the
> build environment, without any access to the patches in the Guix git
> repository.

Good point. But is this not exactly like your previous commit, which
I understood you had tested? But you are right:
   https://ci.guix.gnu.org/build/909454/log/raw
error: in phase 'patch-powerpc': uncaught exception:
unbound-variable #f "Unbound variable: ~S" (search-patch) #f 
phase `patch-powerpc' failed after 0.0 seconds
I will revert (the good news: it indeed did not break any other
architecture).

If we do not have access to the patch during build, we would need to
replace it by an invocation of substitute*, with a lot of escaping of
special characters like line ends, which would be annoying to test
(well, one could test on x86_64 on a dummy package with the same source
as gcc-11).

Andreas





Information forwarded to bug-guix <at> gnu.org:
bug#61879; Package guix. (Fri, 14 Apr 2023 10:46:02 GMT) Full text and rfc822 format available.

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

From: Christopher Baines <mail <at> cbaines.net>
To: Andreas Enge <andreas <at> enge.fr>
Cc: 61879 <at> debbugs.gnu.org
Subject: Re: Patch
Date: Fri, 14 Apr 2023 11:37:05 +0100
[Message part 1 (text/plain, inline)]
Andreas Enge <andreas <at> enge.fr> writes:

> Am Fri, Apr 14, 2023 at 09:20:03AM +0100 schrieb Christopher Baines:
>> I haven't tried this yet, but I've had a quick look. I'm not sure
>> search-patches will work where it is, since that'll be running in the
>> build environment, without any access to the patches in the Guix git
>> repository.
>
> Good point. But is this not exactly like your previous commit, which
> I understood you had tested? But you are right:
>    https://ci.guix.gnu.org/build/909454/log/raw
> error: in phase 'patch-powerpc': uncaught exception:
> unbound-variable #f "Unbound variable: ~S" (search-patch) #f 
> phase `patch-powerpc' failed after 0.0 seconds
> I will revert (the good news: it indeed did not break any other
> architecture).
>
> If we do not have access to the patch during build, we would need to
> replace it by an invocation of substitute*, with a lot of escaping of
> special characters like line ends, which would be annoying to test
> (well, one could test on x86_64 on a dummy package with the same source
> as gcc-11).

The changes I muddled together differed in that the search-patches bit
was ungexp'ed, so the patch file was handled through that mechanism. The
other important change is the actual patch itself differed as well (ec
needs moving up a bit).

I've made those changes to the commit you pushed earlier and pushed to
core-updates now.
[signature.asc (application/pgp-signature, inline)]

Reply sent to Andreas Enge <andreas <at> enge.fr>:
You have taken responsibility. (Fri, 14 Apr 2023 12:11:02 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Fri, 14 Apr 2023 12:11:02 GMT) Full text and rfc822 format available.

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

From: Andreas Enge <andreas <at> enge.fr>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 61879-done <at> debbugs.gnu.org
Subject: Re: Patch
Date: Fri, 14 Apr 2023 14:10:42 +0200
Am Fri, Apr 14, 2023 at 11:37:05AM +0100 schrieb Christopher Baines:
> I've made those changes to the commit you pushed earlier and pushed to
> core-updates now.

That did it, lots of green dots in the dashboard. Thanks!

Closing the bug now.

Andreas





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 13 May 2023 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years ago.

Previous Next


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