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

Commit

Permalink
Merge branch 't/30580/sage_setup__remove_import_time_dependency___set…
Browse files Browse the repository at this point in the history
…up_requires___on__pkgconfig____numpy_' into t/30581/pyproject_toml
  • Loading branch information
Matthias Koeppe committed Nov 15, 2020
2 parents a05a537 + bb32e80 commit 15a6c2b
Show file tree
Hide file tree
Showing 518 changed files with 15,775 additions and 13,770 deletions.
2 changes: 1 addition & 1 deletion .ci/build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ docker_build() {
# Docker's --cache-from does not really work with multi-stage builds: https://github.com/moby/moby/issues/34715
# So we just have to rely on the local cache.
time docker build -f docker/Dockerfile \
--build-arg "WITH_PYTHON=${WITH_PYTHON}" --build-arg "MAKEFLAGS=${MAKEFLAGS}" --build-arg "SAGE_NUM_THREADS=${SAGE_NUM_THREADS}" --build-arg "MAKEFLAGS_DOCBUILD=${MAKEFLAGS}" --build-arg "SAGE_NUM_THREADS_DOCBUILD=${SAGE_NUM_THREADS_DOCBUILD}" --build-arg ARTIFACT_BASE=$ARTIFACT_BASE $@
--build-arg "--build-arg "MAKEFLAGS=${MAKEFLAGS}" --build-arg "SAGE_NUM_THREADS=${SAGE_NUM_THREADS}" --build-arg "MAKEFLAGS_DOCBUILD=${MAKEFLAGS}" --build-arg "SAGE_NUM_THREADS_DOCBUILD=${SAGE_NUM_THREADS_DOCBUILD}" --build-arg ARTIFACT_BASE=$ARTIFACT_BASE $@
}
# We use a multi-stage build /docker/Dockerfile. For the caching to be
Expand Down
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
* text=auto eol=lf
# except for Windows batch files
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
*.diff_bin binary
59 changes: 59 additions & 0 deletions .github/workflows/ci-wsl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build & Test WSL

on: [push, pull_request]

jobs:
windows:
runs-on: windows-latest
name: Windows (using WSL)
# Following https://trac.sagemath.org/ticket/25206#comment:63
steps:
- name: Configure git
run: git config --global core.symlinks true
- uses: actions/checkout@v2
- name: Install Ubuntu 20.04 (in WSL)
run: |
(New-Object System.Net.WebClient).DownloadFile("https://aka.ms/wslubuntu2004", "Ubuntu.appx")
Expand-Archive Ubuntu.appx
Ubuntu\ubuntu2004.exe install --root
- name: Install dependencies
run: |
Function ExtractPackages
{
param($path)
@(Get-Content $path | Where-Object { !$_.StartsWith("#") })
}
$packages = Get-ChildItem build/pkgs -recurse -Include debian.txt, debian-bootstrap.txt | foreach-object { ExtractPackages $_.FullName } | sort -Unique
# Add tox which is use to build
$packages += 'tox'
echo "Install the following packages:" @packages
# Add deadsnakes so that libpython3.7-dev is found
& wsl sudo add-apt-repository ppa:deadsnakes/ppa
# Install
& wsl sudo apt-get update -y
& wsl sudo apt-get install -y @packages
- name: Build
run: wsl tox -e local -- SAGE_NUM_THREADS=4 build
env:
# WSL runs everything as root, so we have to enable build as root user
EXTRA_CONFIGURE_ARGS: "--enable-build-as-root"
# If make is invoked in parellel (i.e. with -jN where N > 1), then we sometimes run into errors for some reason
# So keep N small in order to minimize the risk
MAKE: "make -j2"
WSLENV: EXTRA_CONFIGURE_ARGS:MAKE
- name: Test
run: wsl tox -e local -- SAGE_NUM_THREADS=4 ptest
- name: Prepare logs artifact
run: mkdir -p "artifacts/logs"; cp -r .tox/*/log "artifacts/logs"
shell: bash
if: always()
- uses: actions/upload-artifact@v1
with:
path: artifacts
name: logs
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"
shell: bash
if: always()
2 changes: 1 addition & 1 deletion .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ jobs:
run: |
git config --global user.email "[email protected]"
git config --global user.name "Sage GitHub CI"
SAGE_ROOT=. SAGE_SRC=./src src/bin/sage-update-version $(git describe)
SAGE_ROOT=. SAGE_SRC=./src src/bin/sage-update-version $(git describe) || echo "(ignoring error)"
- name: make dist
run: |
./configure && make dist
Expand Down
7 changes: 4 additions & 3 deletions .homebrew-build-env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# that activate keg-only homebrew package installations

HOMEBREW=`brew --prefix` || return 1
for l in gettext; do
for l in gettext bzip2; do
if [ -d "$HOMEBREW/opt/$l/bin" ]; then
PATH="$HOMEBREW/opt/$l/bin:$PATH"
fi
Expand All @@ -23,17 +23,18 @@ export PKG_CONFIG_PATH
LIBRARY_PATH="$HOMEBREW/lib$LIBRARY_PATH"
[ -z "$CPATH" ] || CPATH=":${CPATH}"
CPATH="$HOMEBREW/include$CPATH"
for l in readline ; do
for l in readline bzip2; do
if [ -d "$HOMEBREW/opt/$l/lib" ]; then
LIBRARY_PATH="$HOMEBREW/opt/$l/lib:$LIBRARY_PATH"
fi
if [ -d "$HOMEBREW/opt/$l/include" ]; then
CPATH="$HOMEBREW/opt/$l/include:$CPATH"
fi
done
for l in "gcc@9/lib/gcc/9"; do
for l in "gcc/lib/gcc/10 gcc/lib/gcc/9"; do
if [ -d "$HOMEBREW/opt/$l" ]; then
LIBRARY_PATH="$HOMEBREW/opt/$l:$LIBRARY_PATH"
break
fi
done
export LIBRARY_PATH
Expand Down
27 changes: 27 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"description": "Mirror of the Sage https://sagemath.org/ source tree",
"license": "other-open",
"title": "sagemath/sage: 9.2.rc2",
"version": "9.2.rc2",
"upload_type": "software",
"publication_date": "2020-10-12",
"creators": [
{
"affiliation": "SageMath.org",
"name": "The SageMath Developers"
}
],
"access_right": "open",
"related_identifiers": [
{
"scheme": "url",
"identifier": "https://github.com/sagemath/sage/tree/9.2.rc2",
"relation": "isSupplementTo"
},
{
"scheme": "doi",
"identifier": "10.5281/zenodo.593563",
"relation": "isVersionOf"
}
]
}
27 changes: 27 additions & 0 deletions .zenodo.json.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"description": "Mirror of the Sage https://sagemath.org/ source tree",
"license": "other-open",
"title": "sagemath/sage: ${SAGE_VERSION}",
"version": "${SAGE_VERSION}",
"upload_type": "software",
"publication_date": "${SAGE_RELEASE_DATE}",
"creators": [
{
"affiliation": "SageMath.org",
"name": "The SageMath Developers"
}
],
"access_right": "open",
"related_identifiers": [
{
"scheme": "url",
"identifier": "https://github.com/sagemath/sage/tree/${SAGE_VERSION}",
"relation": "isSupplementTo"
},
{
"scheme": "doi",
"identifier": "10.5281/zenodo.593563",
"relation": "isVersionOf"
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ Guide](https://doc.sagemath.org/html/en/installation).
``ExtUtils::MakeMaker``), `ranlib`, `git`, `tar`, `bc`

* Any version of `python` (full installation including `urllib`),
but ideally version 3.7.x, which will avoid having to build Sage's
but ideally version 3.7.x or 3.8.x, which will avoid having to build Sage's
own copy of Python 3.

We have collected lists of system packages that provide these build
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.2.beta12, Release Date: 2020-09-06
SageMath version 9.2.rc2, Release Date: 2020-10-12
108 changes: 82 additions & 26 deletions bootstrap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh

########################################################################
# Regenerate auto-generated files (e.g. configure)
Expand All @@ -17,6 +17,9 @@
# will download http://host/path/configure-$CONFVERSION.tar.gz to
# upstream/configure-$CONFVERSION.tar.gz. This is used by the buildbot
# to download tarballs that are not published.
#
# The -q (quiet) flag hides all "informational" output.
#
########################################################################

# Set SAGE_ROOT to the path to this file and then cd into it
Expand All @@ -42,12 +45,12 @@ install_config_rpath() {
echo >&2 "your PATH. E.g. Homebrew installs them in /usr/local/opt/gettext/bin."
return 179
fi
eval `sed -n '/^prefix=.*$/p' $gettextize`
eval `sed -n '/^datarootdir=.*$/p' $gettextize`
eval `sed -n '/^: \${gettext_datadir=.*$/p' $gettextize`
eval `sed -n '/^prefix=.*$/p' "$gettextize"`
eval `sed -n '/^datarootdir=.*$/p' "$gettextize"`
eval `sed -n '/^: \${gettext_datadir=.*$/p' "$gettextize"`

if [ -z "$gettext_datadir" ]; then
eval `sed -n '/^gettext_dir=.*$/p' $gettextize`
eval `sed -n '/^gettext_dir=.*$/p' "$gettextize"`
# In older versions (before 2014) this is spelled gettext_dir
# See https://github.com/autotools-mirror/gettext/commit/ff18897068486560e2bb421004cfbd42b7cdd0f8
gettext_datadir="$gettext_dir"
Expand All @@ -66,7 +69,9 @@ install_config_rpath() {
return 179
fi

echo "bootstrap:$LINENO: installing 'config/config.rpath'"
if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
echo "bootstrap:$LINENO: installing 'config/config.rpath'"
fi
cp "$config_rpath" config/
}

Expand Down Expand Up @@ -97,10 +102,24 @@ SAGE_SPKG_CONFIGURE_$(echo ${pkgname} | tr '[a-z]' '[A-Z]')"
done
echo "$spkg_configures" >> m4/sage_spkg_configures.m4

SAGE_ROOT="$SAGE_ROOT" src/doc/bootstrap && \
# Default to no filter if "-q" was not passed.
QUIET_SED_FILTER=""
if [ "${BOOTSTRAP_QUIET}" = "yes" ]; then
# Otherwise, this filters the expected output from automake.
QUIET_SED_FILTER='/configure\.ac:[0-9][0-9]*: installing /d'
fi

# The insanity with automake's descriptors is intended to filter
# ONLY stderr, and to re-output the results back to stderr leaving
# stdout alone. Basically we swap the two descriptors using a
# third, filter, and then swap them back.
BOOTSTRAP_QUIET="${BOOTSTRAP_QUIET}" \
SAGE_ROOT="$SAGE_ROOT" \
src/doc/bootstrap && \
install_config_rpath && \
aclocal -I m4 && \
automake --add-missing --copy build/make/Makefile-auto && \
automake --add-missing --copy build/make/Makefile-auto 3>&1 1>&2 2>&3 \
| sed "${QUIET_SED_FILTER}" 3>&1 1>&2 2>&3 && \
autoconf

st=$?
Expand All @@ -110,7 +129,7 @@ SAGE_SPKG_CONFIGURE_$(echo ${pkgname} | tr '[a-z]' '[A-Z]')"
179|16|63|127) # install_config_rpath failed|no m4 for pkg-config|autotools not installed|or version too old
if [ $DOWNLOAD = yes ]; then
echo >&2 "Bootstrap failed, downloading required files instead."
bootstrap-download || exit $?
bootstrap_download || exit $?
else
if [ $st -eq 127 ]; then
verb="install"
Expand All @@ -129,8 +148,11 @@ SAGE_SPKG_CONFIGURE_$(echo ${pkgname} | tr '[a-z]' '[A-Z]')"
}

# Bootstrap by downloading the auto-generated files
bootstrap-download () {
sage-download-file configure-$CONFVERSION.tar.gz
bootstrap_download () {
SAGE_DL_LOGLEVEL=""
[ "${BOOTSTRAP_QUIET}" = "yes" ] && SAGE_DL_LOGLEVEL="--log=WARNING"
sage-download-file ${SAGE_DL_LOGLEVEL} configure-$CONFVERSION.tar.gz

if [ $? -ne 0 ]; then
echo >&2 "Error: downloading configure-$CONFVERSION.tar.gz failed"
exit 1
Expand All @@ -156,22 +178,46 @@ save () {

NEWCONFVERSION=`git rev-parse HEAD`
NEWCONFBALL="upstream/configure-$NEWCONFVERSION.tar.gz"

# Create configure tarball
echo "Creating $NEWCONFBALL..."
if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
echo "Creating $NEWCONFBALL..."
fi
mkdir -p upstream
tar zcf "$NEWCONFBALL" configure config/* build/make/Makefile-auto.in src/doc/en/installation/*.txt src/doc/en/reference/spkg/*.rst src/doc/en/reference/repl/*.txt

tar zcf "$NEWCONFBALL" \
configure \
config/* \
build/make/Makefile-auto.in \
src/doc/en/installation/*.txt \
src/doc/en/reference/spkg/*.rst \
src/doc/en/reference/repl/*.txt

# Update version
echo "$NEWCONFVERSION" >$PKG/package-version.txt

# Compute checksum
./sage --package fix-checksum configure
if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
./sage --package fix-checksum configure
else
# Hide the "Updating checksum..." message
./sage --package fix-checksum configure > /dev/null
fi
}


usage () {
echo >&2 "Usage: $0 [-d|-D|-s] [-u <URL>] [-h]"
echo >&2 "Usage: $0 [-d|-D|-s] [-u <URL>] [-h] [-q]"
echo >&2 ""
echo >&2 "Options:"
echo >&2 " -d fall back to downloading (released versions only)"
echo >&2 " or using a pre-generated configure script"
echo >&2 " -D download and use a pre-generated configure script"
echo >&2 " (released versions only); overrides -d"
echo >&2 " -s save the generated configure script under upstream/"
echo >&2 " for later use with -d or -D"
echo >&2 " -u <URL> like -D, but downloads from the specified base URL"
echo >&2 " -h display this help and exit"
echo >&2 " -q hide informational output (be quiet)"
}


Expand All @@ -180,14 +226,16 @@ SAVE=no
DOWNLOAD=no
ALWAYSDOWNLOAD=no
CONFTARBALL_URL=""
while getopts "Ddshu:" OPTION
BOOTSTRAP_QUIET=no
while getopts "Ddsu:hq" OPTION
do
case "$OPTION" in
D) ALWAYSDOWNLOAD=yes; DOWNLOAD=yes;;
d) DOWNLOAD=yes;;
s) SAVE=yes;;
u) CONFTARBALL_URL="$OPTARG"; ALWAYSDOWNLOAD=yes; DOWNLOAD=yes;;
h) usage; exit 0;;
q) BOOTSTRAP_QUIET=yes;;
?) usage; exit 2;;
esac
done
Expand All @@ -200,26 +248,34 @@ if [ $DOWNLOAD$SAVE = yesyes ]; then
fi

# Start cleanly (it's not a problem if this fails)
$MAKE bootstrap-clean 2>/dev/null
# POSIX supports two separate incompatible formats for the MAKEFLAGS
# variable, so instead of guessing, we simply define our own variable
# to optionally pass an "-s" (silent) flag to Make.
MAKE_SILENT=""
[ "${BOOTSTRAP_QUIET}" = "yes" ] && MAKE_SILENT="-s"
$MAKE ${MAKE_SILENT} bootstrap-clean 2>/dev/null
mkdir config 2>/dev/null

# If Sage has not been built yet, this will fail due to a missing
# sage-env-config. We just ignore that error.
source src/bin/sage-env-config 2>/dev/null
source src/bin/sage-env 2>/dev/null

# sage-env-config.
if [ -f src/bin/sage-env-config ]; then
. src/bin/sage-env-config
. src/bin/sage-env
fi

if [ $ALWAYSDOWNLOAD = yes ]; then
if [ -n "$CONFTARBALL_URL" ]; then
URL="$CONFTARBALL_URL"/configure-$CONFVERSION.tar.gz
sage-download-file "$URL" upstream/configure-$CONFVERSION.tar.gz
SAGE_DL_LOGLEVEL=""
[ "${BOOTSTRAP_QUIET}" = "yes" ] && SAGE_DL_LOGLEVEL="--log=WARNING"
sage-download-file ${SAGE_DL_LOGLEVEL} "$URL" upstream/configure-$CONFVERSION.tar.gz
if [ $? -ne 0 ]; then
echo >&2 "Error: downloading configure-$CONFVERSION.tar.gz from $CONFTARBALL_URL failed"
exit 1
fi
echo >&2 "Downloaded configure-$CONFVERSION.tar.gz from $CONFTARBALL_URL "
else
bootstrap-download || exit $?
bootstrap_download || exit $?
fi
else
bootstrap
Expand Down
Loading

0 comments on commit 15a6c2b

Please sign in to comment.