Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 'develop' into t/29570/diff_form_bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Jung committed Apr 28, 2020
2 parents 85e7970 + 50c5ac8 commit 730046c
Show file tree
Hide file tree
Showing 74 changed files with 3,579 additions and 622 deletions.
675 changes: 667 additions & 8 deletions .github/workflows/ci-cygwin.yml

Large diffs are not rendered by default.

118 changes: 118 additions & 0 deletions .github/workflows/tox-optional.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Run SAGE_ROOT/tox.ini TARGETS_OPTIONAL

## This GitHub Actions workflow runs SAGE_ROOT/tox.ini with select environments,
## whenever a GitHub pull request is opened or synchronized in a repository
## where GitHub Actions are enabled.
##
## It builds and checks some sage spkgs as defined in TARGETS.
##
## A job succeeds if there is no error.
##
## The build is run with "make V=0", so the build logs of individual packages are suppressed.
##
## At the end, all package build logs that contain an error are printed out.
##
## After all jobs have finished (or are canceled) and a short delay,
## tar files of all logs are made available as "build artifacts".

#on: [push, pull_request]

on:
pull_request:
types: [opened, synchronize]
push:
tags:
- '*'

env:
TARGETS_PRE: build/make/Makefile
TARGETS: build/make/Makefile
TARGETS_OPTIONAL: 4ti2 pynormaliz qepcad lrslib latte_int topcom barvinok isl qhull sage_numerical_backends_coin primecount plantri polymake jupymake kenzo libsemigroups mcqd meataxe mpfrcx openssl p_group_cohomology rst2ipynb sirocco tdlib tides

jobs:
docker:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
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, centos-7, centos-8, archlinux-latest, slackware-14.2, ubuntu-bionic-i386, ubuntu-eoan-i386, debian-buster-i386, centos-7-i386]
tox_packages_factor: [maximal]
env:
TOX_ENV: docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}
LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}
DOCKER_TARGETS: with-targets-optional
steps:
- uses: actions/checkout@v2
- name: free disk space
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
docker rmi $(docker image ls -aq)
df -h
- name: Install test prerequisites
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install python-tox
- run: |
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::|;"
- name: Copy logs from the build container
run: |
mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"
cp -r .tox/$TOX_ENV/Dockerfile .tox/$TOX_ENV/log "artifacts/$LOGS_ARTIFACT_NAME"
if [ -f .tox/$TOX_ENV/Dockertags ]; then CONTAINERS=$(docker create $(tail -1 .tox/$TOX_ENV/Dockertags)); else CONTAINERS=$(docker ps -q -a); fi
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
if: always()
- uses: actions/upload-artifact@v1
with:
path: artifacts
name: ${{ env.LOGS_ARTIFACT_NAME }}
if: always()
- name: Print out logs for immediate inspection
# and markup the output with GitHub Actions logging commands
run: |
.github/workflows/scan-logs.sh "artifacts/$LOGS_ARTIFACT_NAME"
if: always()

local-macos:

runs-on: macos-latest
strategy:
fail-fast: false
matrix:
tox_system_factor: [homebrew-macos-python2, homebrew-macos, homebrew-macos-python3_xcode, homebrew-macos-python3_xcode-nokegonly, homebrew-macos-python3_pythonorg, conda-forge-macos]
tox_packages_factor: [maximal]
env:
TOX_ENV: local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}
LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}
steps:
- uses: actions/checkout@v2
- name: Install test prerequisites
run: |
brew install tox
- name: Install python3 from python.org
# As of 2020-03-30 (https://github.com/actions/virtual-environments/blob/master/images/macos/macos-10.15-Readme.md),
# Python 3.7.7 is installed on GitHub Actions runners. But we install our own copy from the python.org binary package.
run: |
curl -o python3.pkg https://www.python.org/ftp/python/3.7.7/python-3.7.7-macosx10.9.pkg
sudo installer -verbose -pkg python3.pkg -target /
if: contains(matrix.tox_system_factor, 'python3_pythonorg')
- name: Build and test with tox
# We use a high parallelization on purpose in order to catch possible parallelization bugs in the build scripts.
# For doctesting, we use a lower parallelization to avoid timeouts.
run: |
MAKE="make -j12" tox -e $TOX_ENV -- SAGE_NUM_THREADS=4 $TARGETS
- name: Prepare logs artifact
run: |
mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; cp -r .tox/*/log "artifacts/$LOGS_ARTIFACT_NAME"
if: always()
- uses: actions/upload-artifact@v1
with:
path: artifacts
name: ${{ env.LOGS_ARTIFACT_NAME }}
if: always()
- name: Print out logs for immediate inspection
# and markup the output with GitHub Actions logging commands
run: |
.github/workflows/scan-logs.sh "artifacts/$LOGS_ARTIFACT_NAME"
if: always()
3 changes: 3 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ name: Run SAGE_ROOT/tox.ini
on:
pull_request:
types: [opened, synchronize]
push:
tags:
- '*'

env:
TARGETS_PRE: sagelib-build-deps
Expand Down
9 changes: 1 addition & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,7 @@ build/make/Makefile: configure build/make/deps $(SPKG_COLLECT_FILES) $(CONFIG_FI
./config.status --recheck && ./config.status; \
else \
./configure $$PREREQ_OPTIONS; \
fi || ( \
if [ "x$$SAGE_PORT" = x ]; then \
echo "If you would like to try to build Sage anyway (to help porting),"; \
echo "export the variable 'SAGE_PORT' to something non-empty."; \
exit 1; \
else \
echo "Since 'SAGE_PORT' is set, we will try to build anyway."; \
fi; )
fi

# This is used to monitor progress towards Python 3 and prevent
# regressions. Should be removed after the full switch to python3.
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SageMath version 9.1.rc1, Release Date: 2020-04-22
SageMath version 9.1.rc2, Release Date: 2020-04-25
109 changes: 71 additions & 38 deletions build/bin/sage-print-system-package-command
Original file line number Diff line number Diff line change
@@ -1,52 +1,85 @@
#!/usr/bin/env bash
#
system=$1
command=$2
if [ -z "$system" -o -z "$command" ]; then
echo >&2 "usage: $0 {debian|arch|conda|...} {install|remove|...} PACKAGES..."
exit 1
fi
shift 2
system_packages="$*"
shopt -s extglob
if [ -n "$system_packages" ]; then
# No command needed to install nothing
case $system:$command in
debian*|ubuntu*)
echo "sudo apt-get $command $system_packages"
;;
@(fedora*|redhat*|centos*):install)
echo "sudo yum install $system_packages"
;;
arch*:install)
echo "sudo pacman -S $system_packages"
shift
IF_VERBOSE=:
SUDO=
PROMPT=
while :
do
case "$1" in
--verbose)
IF_VERBOSE=
;;
*conda*:install)
echo "conda install $system_packages"
--sudo)
# Whether to print sudo for package managers that need sudo for non-root users
SUDO="sudo "
;;
homebrew*:install)
echo "brew install $system_packages"
echo "# Afterwards: "
--prompt)
PROMPT=' $ '
;;
slackware*:install)
echo "sudo slackpkg install $system_packages"
;;
cygwin*:install)
echo "# first install apt-cyg from https://github.com/transcode-open/apt-cyg"
echo "apt-cyg install $system_packages"
-*)
echo >&2 "$0: unknown option $2"
exit 1
;;
*)
echo "# $command the following packages: $system_packages"
;;
break
esac
shift
done
command=$1
shift
if [ -z "$system" -o -z "$command" ]; then
echo >&2 "usage: $0 {debian|arch|conda|...} [--verbose] [--sudo] [--prompt] {update|install|setup-build-env|remove|...} PACKAGES..."
exit 1
fi
# Messages that should go out even if not packages need to be installed
system_packages="$*"
shopt -s extglob
case $system:$command in
homebrew*:install)
echo "# To automatically take care of homebrew messages regarding "
echo "# keg-only packages for the current shell session:"
homebrew*:setup-build-env)
$IF_VERBOSE echo "# To automatically take care of homebrew messages regarding "
$IF_VERBOSE echo "# keg-only packages for the current shell session:"
[ -n "$SAGE_ROOT" ] || SAGE_ROOT=.
echo "# $ source $SAGE_ROOT/.homebrew-build-env"
echo "# Add this to your shell profile if you want it to persist between shell sessions."
echo "${PROMPT}source $SAGE_ROOT/.homebrew-build-env"
$IF_VERBOSE echo "# Add this to your shell profile if you want it to persist between shell sessions."
;;
*:setup-build-env)
# Nothing needed
;;
#
# Verbs handled above are our own inventions. Verbs handled below are apt-get verbs.
#
@(debian*|ubuntu*):update)
echo "${PROMPT}${SUDO}apt-get $command $system_packages"
;;
@(debian*|ubuntu*):*)
[ -n "$system_packages" ] && echo "${PROMPT}${SUDO}apt-get $command $system_packages"
;;
@(fedora*|redhat*|centos*):install)
[ -n "$system_packages" ] && echo "${PROMPT}${SUDO}yum install $system_packages"
;;
arch*:install)
[ -n "$system_packages" ] && echo "${PROMPT}${SUDO}pacman -S $system_packages"
;;
*conda*:install)
[ -n "$system_packages" ] && echo "${PROMPT}conda install $system_packages"
;;
homebrew*:install)
[ -n "$system_packages" ] && echo "${PROMPT}brew install $system_packages"
;;
slackware*:install)
[ -n "$system_packages" ] && echo "${PROMPT}${SUDO}slackpkg install $system_packages"
;;
cygwin*:update)
echo "# first install apt-cyg from https://github.com/transcode-open/apt-cyg"
;;
cygwin*:install)
[ -n "$system_packages" ] && echo "${PROMPT}apt-cyg install $system_packages"
;;
*:update)
# Nothing needed
;;
*)
echo "# $command the following packages: $system_packages"
;;
esac
2 changes: 1 addition & 1 deletion build/bin/sage-spkg
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ if [ $INFO -ne 0 -a "$USE_LOCAL_SCRIPTS" = yes ]; then
;;
esac
echo -n " "
sage-print-system-package-command $system install $system_packages
sage-print-system-package-command $system --prompt --sudo install $system_packages
fi
done
if [ -z "$system" ]; then
Expand Down
16 changes: 11 additions & 5 deletions build/bin/write-dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ case $SYSTEM in
ARG BASE_IMAGE=ubuntu:latest
FROM \${BASE_IMAGE} as with-system-packages
EOF
EXISTS="2>/dev/null >/dev/null apt-cache show"
UPDATE="apt-get update &&"
INSTALL="DEBIAN_FRONTEND=noninteractive apt-get install -qqq --no-install-recommends --yes"
CLEAN="&& apt-get clean"
Expand All @@ -52,6 +53,7 @@ EOF
ARG BASE_IMAGE=fedora:latest
FROM \${BASE_IMAGE} as with-system-packages
EOF
EXISTS="2>/dev/null >/dev/null yum install -y --downloadonly"
INSTALL="yum install -y"
;;
slackware*)
Expand All @@ -60,6 +62,8 @@ EOF
ARG BASE_IMAGE=vbatts/slackware:latest
FROM \${BASE_IMAGE} as with-system-packages
EOF
# slackpkg install ignores packages that it does not know, so we do not have to filter
EXISTS="true"
UPDATE="slackpkg update &&"
INSTALL="slackpkg install"
;;
Expand All @@ -69,7 +73,9 @@ EOF
ARG BASE_IMAGE=archlinux:latest
FROM \${BASE_IMAGE} as with-system-packages
EOF
INSTALL="pacman -Syu --noconfirm"
UPDATE="pacman -Sy &&"
EXISTS="pacman -Si"
INSTALL="pacman -Su --noconfirm"
;;
conda*)
cat <<EOF
Expand Down Expand Up @@ -173,7 +179,7 @@ ARG NUMPROC=8
ENV MAKE="make -j\${NUMPROC}"
ARG USE_MAKEFLAGS="-k V=0"
ENV SAGE_CHECK=warn
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl"
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl,!cmake"
#:toolchain:
$RUN make \${USE_MAKEFLAGS} base-toolchain
Expand All @@ -182,7 +188,7 @@ ARG NUMPROC=8
ENV MAKE="make -j\${NUMPROC}"
ARG USE_MAKEFLAGS="-k V=0"
ENV SAGE_CHECK=warn
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl"
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl,!cmake"
#:make:
ARG TARGETS_PRE="sagelib-build-deps"
$RUN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS_PRE}
Expand All @@ -192,7 +198,7 @@ ARG NUMPROC=8
ENV MAKE="make -j\${NUMPROC}"
ARG USE_MAKEFLAGS="-k V=0"
ENV SAGE_CHECK=warn
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl"
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl,!cmake"
ADD src src
ARG TARGETS="build"
$RUN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS}
Expand All @@ -202,7 +208,7 @@ ARG NUMPROC=8
ENV MAKE="make -j\${NUMPROC}"
ARG USE_MAKEFLAGS="-k V=0"
ENV SAGE_CHECK=warn
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl"
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl,!cmake"
ARG TARGETS_OPTIONAL="ptest"
$RUN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS_OPTIONAL} || echo "(error ignored)"
Expand Down
Loading

0 comments on commit 730046c

Please sign in to comment.