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

Commit

Permalink
tox.ini: New - test spkg-configure on ubuntu docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jan 25, 2020
1 parent 221c344 commit 46957b4
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 1 deletion.
44 changes: 44 additions & 0 deletions build/bin/write-dockerfile-debian.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#! /usr/bin/env bash
## Write a Dockerfile to stdout that tests that the packages listed in the debian.txt files of standard spkg exist
## and satisfy the requirements tested by spkg-configure.m4
set -e
STRIP_COMMENTS="sed s/#.*//;"
SAGE_ROOT=.
SYSTEM_PACKAGES=$(echo $(${STRIP_COMMENTS} $SAGE_ROOT/build/pkgs/debian.txt))
# needed for bootstrap:
SYSTEM_PACKAGES+=" gettext autoconf automake libtool"
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/debian.txt
PKG_TYPE=$(cat $PKG_SCRIPTS/type)
if [ -f $SYSTEM_PACKAGES_FILE -a "$PKG_TYPE" = "standard" ]; then
SYSTEM_PACKAGES+=" "$(echo $(${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE))
if [ -f $PKG_SCRIPTS/spkg-configure.m4 ]; then
CONFIGURE_ARGS+="--with-system-$PKG_BASE=force "
fi
fi
fi
done
cat <<EOF
ARG BASE_IMAGE=ubuntu:latest
FROM \${BASE_IMAGE}
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes $SYSTEM_PACKAGES
# Bootstrapping
RUN mkdir -p /sage
WORKDIR /sage
ADD Makefile VERSION.txt README.md bootstrap configure.ac sage ./
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
RUN ./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)
RUN make toolchain V=0
RUN make -j4 scipy
EOF
1 change: 1 addition & 0 deletions build/pkgs/debian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ binutils
make
m4
perl
python3-minimal # system python for bootstrapping the build
tar
bc
2 changes: 2 additions & 0 deletions build/pkgs/pari/debian.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
pari-gp2c libpari-dev
# We add these data packages because they are checked by spkg-configure.m4
pari-elldata pari-galdata pari-galpol pari-seadata
2 changes: 1 addition & 1 deletion build/pkgs/pari/spkg-configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SAGE_SPKG_CONFIGURE([pari], [
if test x$gp_gal_check = x16; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no; cannot use system pari/GP without gapdata package])
AC_MSG_RESULT([no; cannot use system pari/GP without galdata package])
AC_MSG_NOTICE([Install galdata package and reconfigure.])
AC_MSG_NOTICE([Otherwise Sage will build its own pari/GP.])
sage_spkg_install_pari=yes
Expand Down
34 changes: 34 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Run all in parallel:
# tox -p auto
# with local squid:
# EXTRA_DOCKER_BUILD_ARGS="--build-arg http_proxy=http://host.docker.internal:3128" tox -p auto
[tox]
#
# https://hub.docker.com/_/ubuntu?tab=description
# as of 2020-01, latest=bionic=18.04, eoan=rolling=19.10, focal=devel=20.04
envlist = docker-ubuntu_{trusty,xenial,bionic,latest,eoan,rolling,focal,devel}
skipsdist = true

[testenv]
envdir =
{toxworkdir}/docker
# Can't use any system m4ri/m4rie apparently
passenv =
EXTRA_DOCKER_BUILD_ARGS
setenv =
EXTRA_CONFIGURE_ARGS=--with-system-m4ri=no --with-system-m4rie=no --with-system-givaro=no
ubuntu_trusty: BASE_IMAGE=ubuntu:trusty
ubuntu_xenial: BASE_IMAGE=ubuntu:xenial
ubuntu_bionic: BASE_IMAGE=ubuntu:bionic
ubuntu_latest: BASE_IMAGE=ubuntu:latest
ubuntu_eoan: BASE_IMAGE=ubuntu:eoan
ubuntu_rolling: BASE_IMAGE=ubuntu:rolling
ubuntu_focal: BASE_IMAGE=ubuntu:focal
ubuntu_devel: BASE_IMAGE=ubuntu:devel

whitelist_externals =
bash
docker
commands =
bash -c 'build/bin/write-dockerfile-debian.sh > Dockerfile-debian'
docker build . -f Dockerfile-debian --build-arg BASE_IMAGE={env:BASE_IMAGE} --build-arg EXTRA_CONFIGURE_ARGS="{env:EXTRA_CONFIGURE_ARGS}" {env:EXTRA_DOCKER_BUILD_ARGS:}

0 comments on commit 46957b4

Please sign in to comment.