Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit d15ac82

Browse files
author
Release Manager
committed
Trac #29674: fedora-32: If gcc 10 is found, install gcc spkg; fix building gcc (9.2.0) spkg with gcc 10
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/sani tizer_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: - https://bugzilla.redhat.com/show_bug.cgi?id=1774798 URL: https://trac.sagemath.org/29674 Reported by: mkoeppe Ticket author(s): Matthias Koeppe Reviewer(s): Michael Orlitzky
2 parents c5c78af + ca0d8a4 commit d15ac82

File tree

4 files changed

+255
-0
lines changed

4 files changed

+255
-0
lines changed

.github/workflows/tox-gcc_spkg.yml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: Run SAGE_ROOT/tox.ini
2+
3+
## This GitHub Actions workflow runs SAGE_ROOT/tox.ini with select environments,
4+
## whenever a GitHub pull request is opened or synchronized in a repository
5+
## where GitHub Actions are enabled.
6+
##
7+
## It builds and checks some sage spkgs as defined in TARGETS.
8+
##
9+
## A job succeeds if there is no error.
10+
##
11+
## The build is run with "make V=0", so the build logs of individual packages are suppressed.
12+
##
13+
## At the end, all package build logs that contain an error are printed out.
14+
##
15+
## After all jobs have finished (or are canceled) and a short delay,
16+
## tar files of all logs are made available as "build artifacts".
17+
18+
#on: [push, pull_request]
19+
20+
on:
21+
pull_request:
22+
types: [opened, synchronize]
23+
push:
24+
tags:
25+
- '*'
26+
27+
env:
28+
TARGETS_PRE: sagelib-build-deps
29+
TARGETS: build doc-html
30+
TARGETS_OPTIONAL: ptest
31+
32+
jobs:
33+
docker:
34+
runs-on: ubuntu-latest
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
tox_system_factor: [ubuntu-trusty, ubuntu-xenial, ubuntu-bionic, ubuntu-eoan, ubuntu-focal, debian-jessie, debian-stretch, debian-buster, debian-bullseye, debian-sid, linuxmint-17, linuxmint-18, linuxmint-19, linuxmint-19.3, fedora-26, fedora-27, fedora-28, fedora-29, fedora-30, fedora-31, fedora-32, centos-7, centos-8, archlinux-latest, slackware-14.2, conda-forge, ubuntu-bionic-i386, ubuntu-eoan-i386, debian-buster-i386, centos-7-i386]
39+
tox_packages_factor: [minimal-gcc_spkg, standard-gcc_spkg, standard-python2-gcc_spkg]
40+
env:
41+
TOX_ENV: docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}
42+
LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}
43+
DOCKER_TARGETS: configured with-targets with-targets-optional
44+
steps:
45+
- uses: actions/checkout@v2
46+
with:
47+
fetch-depth: 500
48+
- name: fetch tags
49+
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
50+
- name: free disk space
51+
run: |
52+
sudo swapoff -a
53+
sudo rm -f /swapfile
54+
sudo apt clean
55+
docker rmi $(docker image ls -aq)
56+
df -h
57+
- name: Install test prerequisites
58+
run: |
59+
sudo DEBIAN_FRONTEND=noninteractive apt-get update
60+
sudo DEBIAN_FRONTEND=noninteractive apt-get install python-tox
61+
- run: |
62+
set -o pipefail; EXTRA_DOCKER_BUILD_ARGS="--build-arg USE_MAKEFLAGS=\"-k V=0 SAGE_NUM_THREADS=3\"" tox -e $TOX_ENV -- $TARGETS 2>&1 | sed "/^configure: notice:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: warning:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: error:/s|^|::error file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;"
63+
- name: Copy logs from the docker image or build container
64+
run: |
65+
mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"
66+
cp -r .tox/$TOX_ENV/Dockerfile .tox/$TOX_ENV/log "artifacts/$LOGS_ARTIFACT_NAME"
67+
if [ -f .tox/$TOX_ENV/Dockertags ]; then CONTAINERS=$(docker create $(tail -1 .tox/$TOX_ENV/Dockertags) /bin/bash || true); fi
68+
if [ -n "$CONTAINERS" ]; then for CONTAINER in $CONTAINERS; do for ARTIFACT in /sage/logs; do docker cp $CONTAINER:$ARTIFACT artifacts/$LOGS_ARTIFACT_NAME && HAVE_LOG=1; done; if [ -n "$HAVE_LOG" ]; then break; fi; done; fi
69+
if: always()
70+
- uses: actions/upload-artifact@v1
71+
with:
72+
path: artifacts
73+
name: ${{ env.LOGS_ARTIFACT_NAME }}
74+
if: always()
75+
- name: Print out logs for immediate inspection
76+
# and markup the output with GitHub Actions logging commands
77+
run: |
78+
.github/workflows/scan-logs.sh "artifacts/$LOGS_ARTIFACT_NAME"
79+
if: always()
80+
- name: Push docker images
81+
run: |
82+
if [ -f .tox/$TOX_ENV/Dockertags ]; then
83+
TOKEN="${{ secrets.DOCKER_PKG_GITHUB_TOKEN }}"
84+
if [ -z "$TOKEN" ]; then
85+
TOKEN="${{ secrets.GITHUB_TOKEN }}"
86+
fi
87+
echo "$TOKEN" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
88+
for a in $(cat .tox/$TOX_ENV/Dockertags); do
89+
FULL_TAG=docker.pkg.github.com/${{ github.repository }}/$a
90+
docker tag $a $FULL_TAG
91+
echo Pushing $FULL_TAG
92+
docker push $FULL_TAG
93+
done || echo "(Ignoring errors)"
94+
fi
95+
if: always()
96+
97+
local-ubuntu:
98+
99+
runs-on: ubuntu-latest
100+
strategy:
101+
fail-fast: false
102+
matrix:
103+
tox_system_factor: [conda-forge-ubuntu]
104+
tox_packages_factor: [minimal-gcc_spkg, standard-gcc_spkg, standard-python2-gcc_spkg]
105+
env:
106+
TOX_ENV: local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}
107+
LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}
108+
steps:
109+
- uses: actions/checkout@v2
110+
- name: Install test prerequisites
111+
run: |
112+
sudo DEBIAN_FRONTEND=noninteractive apt-get update
113+
sudo DEBIAN_FRONTEND=noninteractive apt-get install python-tox
114+
- name: Build and test with tox
115+
# We use a high parallelization on purpose in order to catch possible parallelization bugs in the build scripts.
116+
# For doctesting, we use a lower parallelization to avoid timeouts.
117+
run: |
118+
MAKE="make -j12" tox -e $TOX_ENV -- SAGE_NUM_THREADS=4 $TARGETS
119+
- name: Prepare logs artifact
120+
run: |
121+
mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; cp -r .tox/*/log "artifacts/$LOGS_ARTIFACT_NAME"
122+
if: always()
123+
- uses: actions/upload-artifact@v1
124+
with:
125+
path: artifacts
126+
name: ${{ env.LOGS_ARTIFACT_NAME }}
127+
if: always()
128+
- name: Print out logs for immediate inspection
129+
# and markup the output with GitHub Actions logging commands
130+
run: |
131+
.github/workflows/scan-logs.sh "artifacts/$LOGS_ARTIFACT_NAME"
132+
if: always()
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
https://bugs.gentoo.org/708346
2+
3+
From ce9568e9e9cf6094be30e748821421e703754ffc Mon Sep 17 00:00:00 2001
4+
From: Jakub Jelinek <[email protected]>
5+
Date: Fri, 8 Nov 2019 19:53:18 +0100
6+
Subject: [PATCH] backport: re PR sanitizer/92154 (new glibc breaks arm
7+
bootstrap due to libsanitizer)
8+
9+
Backported from mainline
10+
2019-10-22 Tamar Christina <[email protected]>
11+
12+
PR sanitizer/92154
13+
* sanitizer_common/sanitizer_platform_limits_posix.cc:
14+
Cherry-pick compiler-rt revision r375220.
15+
16+
From-SVN: r277981
17+
---
18+
libsanitizer/ChangeLog | 9 +++++++++
19+
.../sanitizer_common/sanitizer_platform_limits_posix.cc | 6 +++++-
20+
2 files changed, 14 insertions(+), 1 deletion(-)
21+
22+
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
23+
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
24+
@@ -1156,8 +1156,12 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
25+
CHECK_SIZE_AND_OFFSET(ipc_perm, gid);
26+
CHECK_SIZE_AND_OFFSET(ipc_perm, cuid);
27+
CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
28+
-#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)
29+
+#if (!defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)) && \
30+
+ !defined(__arm__)
31+
/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */
32+
+/* On Arm glibc 2.31 and later provide a different mode field, this field is
33+
+ never used by libsanitizer so we can simply ignore this assert for all glibc
34+
+ versions. */
35+
CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
36+
#endif
37+
38+
--
39+
2.25.0
40+
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
https://bugs.gentoo.org/708346
2+
3+
From 75003cdd23c310ec385344e8040d490e8dd6d2be Mon Sep 17 00:00:00 2001
4+
From: Jakub Jelinek <[email protected]>
5+
Date: Fri, 20 Dec 2019 17:58:35 +0100
6+
Subject: [PATCH] backport: re PR sanitizer/92154 (new glibc breaks arm
7+
bootstrap due to libsanitizer)
8+
9+
Backported from mainline
10+
2019-11-26 Jakub Jelinek <[email protected]>
11+
12+
PR sanitizer/92154
13+
* sanitizer_common/sanitizer_platform_limits_posix.h: Cherry-pick
14+
llvm-project revision 947f9692440836dcb8d88b74b69dd379d85974ce.
15+
* sanitizer_common/sanitizer_platform_limits_posix.cc: Likewise.
16+
17+
From-SVN: r279653
18+
---
19+
libsanitizer/ChangeLog | 10 ++++++++++
20+
.../sanitizer_platform_limits_posix.cc | 9 +++------
21+
.../sanitizer_platform_limits_posix.h | 15 +--------------
22+
3 files changed, 14 insertions(+), 20 deletions(-)
23+
24+
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
25+
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
26+
@@ -1156,12 +1156,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
27+
CHECK_SIZE_AND_OFFSET(ipc_perm, gid);
28+
CHECK_SIZE_AND_OFFSET(ipc_perm, cuid);
29+
CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
30+
-#if (!defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)) && \
31+
- !defined(__arm__)
32+
-/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */
33+
-/* On Arm glibc 2.31 and later provide a different mode field, this field is
34+
- never used by libsanitizer so we can simply ignore this assert for all glibc
35+
- versions. */
36+
+#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31)
37+
+/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit
38+
+ on many architectures. */
39+
CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
40+
#endif
41+
42+
diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
43+
index 73af92af1e8..6a673a7c995 100644
44+
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
45+
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
46+
@@ -211,26 +211,13 @@ namespace __sanitizer {
47+
u64 __unused1;
48+
u64 __unused2;
49+
#elif defined(__sparc__)
50+
-#if defined(__arch64__)
51+
unsigned mode;
52+
- unsigned short __pad1;
53+
-#else
54+
- unsigned short __pad1;
55+
- unsigned short mode;
56+
unsigned short __pad2;
57+
-#endif
58+
unsigned short __seq;
59+
unsigned long long __unused1;
60+
unsigned long long __unused2;
61+
-#elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__)
62+
- unsigned int mode;
63+
- unsigned short __seq;
64+
- unsigned short __pad1;
65+
- unsigned long __unused1;
66+
- unsigned long __unused2;
67+
#else
68+
- unsigned short mode;
69+
- unsigned short __pad1;
70+
+ unsigned int mode;
71+
unsigned short __seq;
72+
unsigned short __pad2;
73+
#if defined(__x86_64__) && !defined(_LP64)
74+
--
75+
2.25.0
76+

build/pkgs/gcc/spkg-configure.m4

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,13 @@ SAGE_SPKG_CONFIGURE_BASE([gcc], [
8888
fi
8989
9090
# Figuring out if we are using clang instead of gcc.
91+
AC_LANG_PUSH(C)
9192
AX_COMPILER_VENDOR()
9293
IS_REALLY_GCC=no
9394
if test "x$ax_cv_c_compiler_vendor" = xgnu ; then
9495
IS_REALLY_GCC=yes
9596
fi
97+
AC_LANG_POP()
9698
9799
# Save the value of CXX without special flags to enable C++11 support
98100
AS_VAR_SET([SAGE_CXX_WITHOUT_STD], [$CXX])
@@ -144,6 +146,11 @@ SAGE_SPKG_CONFIGURE_BASE([gcc], [
144146
[[[0-3]].*|4.[[0-7]].*], [
145147
# Install our own GCC if the system-provided one is older than gcc-4.8.
146148
SAGE_SHOULD_INSTALL_GCC([you have $CXX version $GXX_VERSION, which is quite old])
149+
],
150+
[1?.*], [
151+
# Install our own GCC if the system-provided one is newer than 9.x.
152+
# See https://trac.sagemath.org/ticket/29456
153+
SAGE_SHOULD_INSTALL_GCC([$CXX is g++ version $GXX_VERSION, which is too recent for this version of Sage])
147154
])
148155
fi
149156

0 commit comments

Comments
 (0)