Opened 3 years ago

Closed 3 years ago

#29674 closed defect (fixed)

fedora-32: If gcc 10 is found, install gcc spkg; fix building gcc (9.2.0) spkg with gcc 10

Reported by: Matthias Köppe Owned by:
Priority: blocker Milestone: sage-9.1
Component: packages: standard Keywords:
Cc: Dima Pasechnik, François Bissey, Michael Orlitzky, Volker Braun, Enrique Artal Bartolo Merged in:
Authors: Matthias Koeppe Reviewers: Michael Orlitzky
Report Upstream: N/A Work issues:
Branch: ca0d8a4 (Commits, GitHub, GitLab) Commit: ca0d8a4198517a8d6e019a8704a8de48f8e45ef8
Dependencies: Stopgaps:

Status badges

Description (last modified by Matthias Köppe)

To work around build failures of some SPKGs with gcc 10, in particular on fedora-32 (#29456), we reject system gcc 10 and build the gcc spkg instead.

That itself requires patches, which we get from https://bugs.gentoo.org/708346, for the following error:

libtool: compile:  /sage/local/var/tmp/sage/build/gcc-9.2.0/gcc-build/./gcc/xgcc -shared-libgcc -B/sage/local/var/tmp/sage/build/gcc-9.2.0/gcc-build/./gcc -nostdinc++ -L/sage/local/var/tmp/sage/build/gcc-9.2.0/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src -L/sage/local/var/tmp/sage/build/gcc-9.2.0/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/sage/local/var/tmp/sage/build/gcc-9.2.0/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -B/sage/local/x86_64-pc-linux-gnu/bin/ -B/sage/local/x86_64-pc-linux-gnu/lib/ -isystem /sage/local/x86_64-pc-linux-gnu/include -isystem /sage/local/x86_64-pc-linux-gnu/sys-include -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DHAVE_RPC_XDR_H=0 -DHAVE_TIRPC_RPC_XDR_H=0 -I. -I../../../../src/libsanitizer/sanitizer_common -I.. -I ../../../../src/libsanitizer/include -isystem ../../../../src/libsanitizer/include/system -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -I../../libstdc++-v3/include -I../../libstdc++-v3/include/x86_64-pc-linux-gnu -I../../../../src/libsanitizer/../libstdc++-v3/libsupc++ -std=gnu++11 -DSANITIZER_LIBBACKTRACE -DSANITIZER_CP_DEMANGLE -I ../../../../src/libsanitizer/../libbacktrace -I ../libbacktrace -I ../../../../src/libsanitizer/../include -include ../../../../src/libsanitizer/libbacktrace/backtrace-rename.h -g -O2 -D_GNU_SOURCE -MT sanitizer_posix.lo -MD -MP -MF .deps/sanitizer_posix.Tpo -c ../../../../src/libsanitizer/sanitizer_common/sanitizer_posix.cc  -fPIC -DPIC -o .libs/sanitizer_posix.o
In file included from ../../../../src/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:193:
../../../../src/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:339:72: error: narrowing conversion of '-1' from 'int' to 'long unsigned int' [-Wnarrowing]
  339 |     typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
      |                                                                        ^

To reproduce:

  tox -e docker-fedora-32-standard-gcc_spkg

See also:

Change History (23)

comment:1 Changed 3 years ago by Matthias Köppe

Cc: François Bissey Michael Orlitzky Volker Braun added
Description: modified (diff)

comment:2 Changed 3 years ago by Matthias Köppe

Let's add the patches from gentoo

comment:3 Changed 3 years ago by Matthias Köppe

Priority: criticalblocker

comment:4 Changed 3 years ago by Matthias Köppe

Authors: Matthias Koeppe

comment:5 Changed 3 years ago by Matthias Köppe

Branch: u/mkoeppe/fedora_32__building_gcc__9_2_0__spkg_fails_with_gcc_10

comment:6 Changed 3 years ago by Matthias Köppe

Commit: fb71dc08e9cbaaf2f841da8c23d1dd623c61ea22

Tests of -gcc_spkg run at https://github.com/mkoeppe/sage/actions/runs/100892171


New commits:

790d1b6build/pkgs/gcc: Add gentoo patch
fb71dc0build/pkgs/gcc: Remove gentoo-specific part of gentoo patch

comment:7 Changed 3 years ago by git

Commit: fb71dc08e9cbaaf2f841da8c23d1dd623c61ea22d5033ef989e54c89b4e5484900f283bd4246b892

Branch pushed to git repo; I updated commit sha1. New commits:

5214641.github/workflows/tox-gcc_spkg.yml: New
d5033efbuild/pkgs/gcc/spkg-configure.m4: Reject gcc (gnu) >= 10

comment:8 Changed 3 years ago by Matthias Köppe

Description: modified (diff)
Summary: fedora-32: Building gcc (9.2.0) spkg fails with gcc 10fedora-32: If gcc 10 is found, install gcc spkg; fix building gcc (9.2.0) spkg with gcc 10

comment:9 Changed 3 years ago by Matthias Köppe

Status: newneeds_review

comment:10 Changed 3 years ago by Matthias Köppe

Cc: Enrique Artal Bartolo added

comment:11 Changed 3 years ago by Matthias Köppe

The test for IS_REALLY_GCC had bitrotted away and as a result the version check actually didn't run. Fixed.

comment:12 Changed 3 years ago by Matthias Köppe

Status: needs_reviewneeds_work

comment:13 Changed 3 years ago by git

Commit: d5033ef989e54c89b4e5484900f283bd4246b892ca0d8a4198517a8d6e019a8704a8de48f8e45ef8

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

76dcef3build/pkgs/gcc: Add gentoo patch
a13e5e9.github/workflows/tox-gcc_spkg.yml: New
ca0d8a4build/pkgs/gcc/spkg-configure.m4: Reject gcc (gnu) >= 10

comment:14 Changed 3 years ago by Matthias Köppe

comment:15 Changed 3 years ago by Matthias Köppe

Status: needs_workneeds_review

comment:16 Changed 3 years ago by Matthias Köppe

Description: modified (diff)

comment:17 Changed 3 years ago by Matthias Köppe

Some of the new tests for -gcc_spkg at https://github.com/mkoeppe/sage/runs/661787493?check_suite_focus=true have unrelated failures, for which I have opened #29675. These are not important to fix.

comment:18 Changed 3 years ago by Matthias Köppe

fedora-32-standard-gcc_spkg (https://github.com/mkoeppe/sage/runs/661787882), fedora-32-standard-python2-gcc_spkg (https://github.com/mkoeppe/sage/runs/661787887) work correctly with this fix.

fedora-32-minimal-gcc_spkg (https://github.com/mkoeppe/sage/runs/661787878) is clean too but times out.

comment:19 Changed 3 years ago by Matthias Köppe

And fedora-32-standard (https://github.com/mkoeppe/sage/runs/661788407) shows the changes to the spkg-configure:

hecking whether SageMath should install SPKG gcc...
checking for C compiler vendor... gnu
checking whether g++ supports C++11 features with -std=gnu++11... yes
checking for gcc option to accept ISO C99... none needed
checking if gcc accepts -dumpversion option... yes
checking gcc version... 10
checking if g++ accepts -dumpversion option... yes
checking g++ version... 10
configure: Installing GCC because g++ -std=gnu++11 is g++ version 10, which is too recent for this version of Sage
configure: no suitable system package found for SPKG gcc

The runs on systems other than fedora-32 are unchanged (https://github.com/mkoeppe/sage/actions/runs/100987613).

Ready for review

comment:20 in reply to:  11 ; Changed 3 years ago by Michael Orlitzky

Reviewers: Michael Orlitzky
Status: needs_reviewpositive_review

Replying to mkoeppe:

The test for IS_REALLY_GCC had bitrotted away and as a result the version check actually didn't run. Fixed.

I'm skeptical that this worked in the first place (that's a shell pipe, not a regex):

AS_CASE(["$GXX_VERSION.0"],
                [[[0-3]].*|4.[[0-7]].*], [

I can't really test this but the changes are reasonable. The main risk with something like this is that the patches would break something with older glibc, but the fact that upstream backported these two patches to the 9.3 branch suggests that they wouldn't. The CI checks confirm that, and everyone else will be using their system GCC anyway, so let's try it.

comment:21 in reply to:  20 Changed 3 years ago by Michael Orlitzky

Replying to mjo:

I'm skeptical that this worked in the first place (that's a shell pipe, not a regex):

AS_CASE(["$GXX_VERSION.0"],
                [[[0-3]].*|4.[[0-7]].*], [

Apparently it does, even without bash's extglob. TIL.

comment:22 Changed 3 years ago by Matthias Köppe

Thanks!

comment:23 Changed 3 years ago by Volker Braun

Branch: u/mkoeppe/fedora_32__building_gcc__9_2_0__spkg_fails_with_gcc_10ca0d8a4198517a8d6e019a8704a8de48f8e45ef8
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.