This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 't/29233/bootstrap____make_distclean_broken' into t/2904…
…1/at___bootstrap_time__generate_src_requirements_txt__src_constraints_txt__src_setup_cfg__install_requires__from_build_pkgs
- Loading branch information
Showing
733 changed files
with
22,729 additions
and
5,048 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
SageMath version 9.1.beta0, Release Date: 2020-01-10 | ||
SageMath version 9.1.beta5, Release Date: 2020-02-21 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/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="$*" | ||
if [ -z "$system_packages" ]; then | ||
# No command needed to install nothing | ||
exit 0 | ||
fi | ||
shopt -s extglob | ||
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" | ||
;; | ||
*conda*:install) | ||
echo "conda install $system_packages" | ||
;; | ||
homebrew*:install) | ||
echo "brew install $system_packages" | ||
;; | ||
*) | ||
echo "# $command the following packages: $system_packages" | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
#! /usr/bin/env bash | ||
## Write a Dockerfile to stdout that tests that the packages listed in the debian.txt/fedora.txt files of standard spkg exist | ||
## and satisfy the requirements tested by spkg-configure.m4 | ||
## This is called by $SAGE_ROOT/tox.ini | ||
set -e | ||
SYSTEM="${1:-debian}" | ||
shopt -s extglob | ||
TYPE_PATTERN="${2:-standard}" | ||
WITH_SYSTEM_SPKG="${3:-yes}" | ||
IGNORE_MISSING_SYSTEM_PACKAGES="${4:-no}" | ||
# | ||
STRIP_COMMENTS="sed s/#.*//;" | ||
SAGE_ROOT=. | ||
SYSTEM_PACKAGES=$(echo $(${STRIP_COMMENTS} $SAGE_ROOT/build/pkgs/$SYSTEM{,-bootstrap}.txt)) | ||
CONFIGURE_ARGS="--enable-option-checking " | ||
for PKG_SCRIPTS in build/pkgs/*; do | ||
if [ -d $PKG_SCRIPTS ]; then | ||
PKG_BASE=$(basename $PKG_SCRIPTS) | ||
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/distros/$SYSTEM.txt | ||
PKG_TYPE=$(cat $PKG_SCRIPTS/type) | ||
if [ -f $SYSTEM_PACKAGES_FILE -a -f $PKG_SCRIPTS/spkg-configure.m4 ]; then | ||
PKG_SYSTEM_PACKAGES=$(echo $(${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE)) | ||
if [ -n "PKG_SYSTEM_PACKAGES" ]; then | ||
case "$PKG_TYPE" in | ||
$TYPE_PATTERN) | ||
SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES" | ||
if [ -f $PKG_SCRIPTS/spkg-configure.m4 ]; then | ||
CONFIGURE_ARGS+="--with-system-$PKG_BASE=${WITH_SYSTEM_SPKG} " | ||
fi | ||
;; | ||
esac | ||
fi | ||
fi | ||
fi | ||
done | ||
echo "# Automatically generated by SAGE_ROOT/build/bin/write-dockerfile.sh" | ||
echo "# the :comments: separate the generated file into sections" | ||
echo "# to simplify writing scripts that customize this file" | ||
RUN=RUN | ||
case $SYSTEM in | ||
debian*|ubuntu*) | ||
cat <<EOF | ||
ARG BASE_IMAGE=ubuntu:latest | ||
FROM \${BASE_IMAGE} | ||
EOF | ||
UPDATE="apt-get update &&" | ||
INSTALL="DEBIAN_FRONTEND=noninteractive apt-get install -qqq --no-install-recommends --yes" | ||
CLEAN="&& apt-get clean" | ||
;; | ||
fedora*|redhat*|centos*) | ||
cat <<EOF | ||
ARG BASE_IMAGE=fedora:latest | ||
FROM \${BASE_IMAGE} | ||
EOF | ||
INSTALL="yum install -y" | ||
;; | ||
arch*) | ||
# https://hub.docker.com/_/archlinux/ | ||
cat <<EOF | ||
ARG BASE_IMAGE=archlinux:latest | ||
FROM \${BASE_IMAGE} | ||
EOF | ||
INSTALL="pacman -Syu --noconfirm" | ||
;; | ||
conda*) | ||
cat <<EOF | ||
ARG BASE_IMAGE=continuumio/miniconda3:latest | ||
FROM \${BASE_IMAGE} | ||
ARG USE_CONDARC=condarc.yml | ||
ADD *condarc*.yml /tmp/ | ||
RUN echo \${CONDARC}; cd /tmp && conda config --stdin < \${USE_CONDARC} | ||
RUN conda update -n base conda | ||
RUN ln -sf /bin/bash /bin/sh | ||
EOF | ||
# On this image, /bin/sh -> /bin/dash; | ||
# but some of the scripts in /opt/conda/etc/conda/activate.d | ||
# from conda-forge (as of 2020-01-27) contain bash-isms: | ||
# /bin/sh: 5: /opt/conda/etc/conda/activate.d/activate-binutils_linux-64.sh: Syntax error: "(" unexpected | ||
# The command '/bin/sh -c . /opt/conda/etc/profile.d/conda.sh; conda activate base; ./bootstrap' returned a non-zero code | ||
# We just change the link to /bin/bash. | ||
INSTALL="conda install --update-all --quiet --yes" | ||
EXISTS="2>/dev/null >/dev/null conda search -f" | ||
#EXISTS="conda search -f" | ||
CLEAN="&& conda info; conda list" | ||
RUN="RUN . /opt/conda/etc/profile.d/conda.sh; conda activate base; " # to activate the conda env | ||
;; | ||
*) | ||
echo "Not implemented: package installation for SYSTEM=$SYSTEM" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
cat <<EOF | ||
#:packages: | ||
ENV PACKAGES="$SYSTEM_PACKAGES" | ||
EOF | ||
case "$IGNORE_MISSING_SYSTEM_PACKAGES" in | ||
no) | ||
cat <<EOF | ||
RUN $UPDATE $INSTALL $SYSTEM_PACKAGES $CLEAN | ||
EOF | ||
;; | ||
yes) | ||
if [ -n "$EXISTS" ]; then | ||
# Filter by existing packages, try to install these in one shot; fall back to one by one. | ||
cat <<EOF | ||
RUN $UPDATE EXISTING_PACKAGES=""; for pkg in \$PACKAGES; do echo -n .; if $EXISTS \$pkg; then EXISTING_PACKAGES="\$EXISTING_PACKAGES \$pkg"; echo -n "\$pkg"; fi; done; $INSTALL \$EXISTING_PACKAGES || (echo "Trying again one by one:"; for pkg in \$EXISTING_PACKAGES; do echo "Trying to install \$pkg"; $INSTALL \$pkg || echo "(ignoring error)"; done); : $CLEAN | ||
EOF | ||
else | ||
# Try in one shot, fall back to one by one. Separate "RUN" commands | ||
# for caching by docker. | ||
cat <<EOF | ||
RUN $UPDATE $INSTALL \${PACKAGES} || echo "(ignoring error)" | ||
EOF | ||
for pkg in $SYSTEM_PACKAGES; do | ||
cat <<EOF | ||
RUN $INSTALL $pkg || echo "(ignoring error)" | ||
EOF | ||
done | ||
if [ -n "$CLEAN" ]; then | ||
cat <<EOF | ||
RUN : $CLEAN | ||
EOF | ||
fi | ||
fi | ||
;; | ||
*) | ||
echo "Argument IGNORE_MISSING_SYSTEM_PACKAGES must be yes or no" | ||
;; | ||
esac | ||
cat <<EOF | ||
#:bootstrapping: | ||
RUN mkdir -p /sage | ||
WORKDIR /sage | ||
ADD Makefile VERSION.txt README.md bootstrap configure.ac sage ./ | ||
ADD src/doc/bootstrap src/doc/bootstrap | ||
ADD m4 ./m4 | ||
ADD build ./build | ||
ADD src/bin/sage-version.sh src/bin/sage-version.sh | ||
$RUN ./bootstrap | ||
#:configuring: | ||
ADD src/ext src/ext | ||
ADD src/bin src/bin | ||
ADD src/Makefile.in src/Makefile.in | ||
ARG EXTRA_CONFIGURE_ARGS="" | ||
EOF | ||
if [ ${WITH_SYSTEM_SPKG} = "force" ]; then | ||
cat <<EOF | ||
$RUN echo "****** Configuring: ./configure --enable-build-as-root $CONFIGURE_ARGS \${EXTRA_CONFIGURE_ARGS} *******"; ./configure --enable-build-as-root $CONFIGURE_ARGS \${EXTRA_CONFIGURE_ARGS} || (echo "********** configuring without forcing ***********"; cat config.log; ./configure --enable-build-as-root; cat config.log; exit 1) | ||
EOF | ||
else | ||
cat <<EOF | ||
$RUN echo "****** Configuring: ./configure --enable-build-as-root $CONFIGURE_ARGS \${EXTRA_CONFIGURE_ARGS} *******"; ./configure --enable-build-as-root $CONFIGURE_ARGS \${EXTRA_CONFIGURE_ARGS} || (cat config.log; exit 1) | ||
EOF | ||
fi | ||
cat <<EOF | ||
# We first compile base-toolchain because otherwise lots of packages are missing their dependency on 'patch' | ||
ARG NUMPROC=8 | ||
ENV MAKE="make -j\${NUMPROC}" | ||
ARG USE_MAKEFLAGS="-k" | ||
#:toolchain: | ||
$RUN make \${USE_MAKEFLAGS} base-toolchain | ||
#:make: | ||
# Avoid running the lengthy testsuite of the following. | ||
$RUN make \${USE_MAKEFLAGS} cython | ||
# By default, compile something tricky but that does not take too long. scipy uses BLAS. | ||
ARG TARGETS="scipy" | ||
$RUN SAGE_CHECK=yes SAGE_CHECK_PACKAGES="!r,!python3,!python2,!nose" make \${USE_MAKEFLAGS} \${TARGETS} | ||
#:end: | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.