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/29124/script-packages-prereq-toolchain-bootstrap' int…
Browse files Browse the repository at this point in the history
…o t/31084/makefile__add__ptest__targets_that_do_not_depend_on_the_docbuild
  • Loading branch information
Matthias Koeppe committed Dec 19, 2020
2 parents 09d1737 + b73d6f0 commit 0dca776
Show file tree
Hide file tree
Showing 36 changed files with 51 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ ptestoptional-nodoc: build
ptestoptionallong-nodoc: build
$(PTESTALL) --long --logfile=logs/ptestoptionallong.log

configure: bootstrap src/doc/bootstrap configure.ac src/bin/sage-version.sh m4/*.m4 build/pkgs/*/spkg-configure.m4 build/pkgs/*/type build/pkgs/*.txt build/pkgs/*/distros/*.txt
configure: bootstrap src/doc/bootstrap configure.ac src/bin/sage-version.sh m4/*.m4 build/pkgs/*/spkg-configure.m4 build/pkgs/*/type build/pkgs/*/distros/*.txt
./bootstrap -d

install: all
Expand Down
8 changes: 6 additions & 2 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ bootstrap () {
# --enable-SPKG options for installing pip packages
if [ ! -f build/pkgs/$pkgname/requirements.txt ]; then
pkgtype="$(cat build/pkgs/$pkgname/type)"
spkg_configures="$spkg_configures
SAGE_SPKG_ENABLE([$pkgname], [$pkgtype])"
# Trac #29124: Do not provide --enable-_recommended and similar
case "$pkgname" in
_*) ;;
*) spkg_configures="$spkg_configures
SAGE_SPKG_ENABLE([$pkgname], [$pkgtype])" ;;
esac
fi
done
for pkgname in $(./sage --package list --has-file spkg-configure.m4 | sort); do
Expand Down
4 changes: 2 additions & 2 deletions build/bin/write-dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ IGNORE_MISSING_SYSTEM_PACKAGES="${4:-no}"
STRIP_COMMENTS="sed s/#.*//;"
SAGE_ROOT=.
export PATH="$SAGE_ROOT"/build/bin:$PATH
SYSTEM_PACKAGES=$(echo $(${STRIP_COMMENTS} "$SAGE_ROOT"/build/pkgs/$SYSTEM{,-bootstrap}.txt))
SYSTEM_PACKAGES=
CONFIGURE_ARGS="--enable-option-checking "
for PKG_BASE in $($SAGE_ROOT/sage -package list --has-file=distros/$SYSTEM.txt $SAGE_PACKAGE_LIST_ARGS); do
for PKG_BASE in $($SAGE_ROOT/sage -package list --has-file=distros/$SYSTEM.txt $SAGE_PACKAGE_LIST_ARGS) _bootstrap; do
PKG_SCRIPTS="$SAGE_ROOT"/build/pkgs/$PKG_BASE
if [ -d $PKG_SCRIPTS ]; then
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/distros/$SYSTEM.txt
Expand Down
6 changes: 6 additions & 0 deletions build/pkgs/_bootstrap/SPKG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
_bootstrap
==========

This optional script package represents the requirements (system packages)
that are needed in addition to those represented by the ``_prereq`` package
in order to run the top-level ``bootstrap`` script.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions build/pkgs/_bootstrap/spkg-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#! /usr/bin/env bash
# Nothing to do
1 change: 1 addition & 0 deletions build/pkgs/_bootstrap/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
optional
5 changes: 5 additions & 0 deletions build/pkgs/_prereq/SPKG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_prereq
=======

This script package represents the minimal requirements (system packages)
for installing SageMath from source.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions build/pkgs/_prereq/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dnl We cannot check prerequisites because they are required
dnl already for running the configure script.
SAGE_SPKG_CONFIGURE([_prereq], [
dnl Just assume that they are present.
sage_spkg_install__prereq=no
])
2 changes: 2 additions & 0 deletions build/pkgs/_prereq/spkg-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#! /usr/bin/env bash
# Nothing to do
1 change: 1 addition & 0 deletions build/pkgs/_prereq/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
standard
8 changes: 8 additions & 0 deletions m4/sage_spkg_collect.m4
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,16 @@ for DIR in $SAGE_ROOT/build/pkgs/*; do
message="does not support check for system package; $message"
])
])
dnl Trac #29124: Do not talk about underscore club
case "$SPKG_NAME" in
_*)
;;
*)
formatted_message=$(printf '%-45s%s' "$SPKG_NAME-$SPKG_VERSION:" "$message")
AC_MSG_RESULT([$formatted_message])
;;
esac
AS_VAR_POPDEF([sage_use_system])dnl
AS_VAR_POPDEF([sage_require])dnl
Expand Down
2 changes: 1 addition & 1 deletion src/doc/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mkdir -p "$OUTPUT_DIR"
shopt -s extglob

for SYSTEM in arch debian fedora cygwin homebrew conda; do
SYSTEM_PACKAGES=$(echo $(${STRIP_COMMENTS} build/pkgs/$SYSTEM.txt))
SYSTEM_PACKAGES=
OPTIONAL_SYSTEM_PACKAGES=
SAGELIB_SYSTEM_PACKAGES=
SAGELIB_OPTIONAL_SYSTEM_PACKAGES=
Expand Down
10 changes: 5 additions & 5 deletions src/doc/en/developer/portability_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ Using Sage's database of distribution prerequisites

The source code of the Sage distribution contains a database of
package names in various distributions' package managers. For
example, the file ``build/pkgs/debian.txt`` contains the following
example, the file ``build/pkgs/_prereq/distros/debian.txt`` contains the following

.. code-block:: yaml
# This file, build/pkgs/debian.txt, contains names of Debian/Ubuntu packages
# needed for installation of Sage from source.
# This file, build/pkgs/_prereq/distros/debian.txt, contains names
# of Debian/Ubuntu packages needed for installation of Sage from source.
#
# In addition, the files build/pkgs/SPKG/debian.txt contain the names
# In addition, the files build/pkgs/SPKG/distros/debian.txt contain the names
# of packages that provide the equivalent of SPKG.
#
# Everything on a line after a # character is ignored.
Expand Down Expand Up @@ -700,7 +700,7 @@ Let us try a first variant of the ``local`` technology, the tox
environment called ``local-direct``. Because all builds with tox
begin by bootstrapping the source tree, you will need autotools and
other prerequisites installed in your system. See
``build/pkgs/*-bootstrap.txt`` for a list of system packages that
``build/pkgs/_bootstrap/distros/*.txt`` for a list of system packages that
provide these prerequisites.

We start by creating a fresh (distclean) git worktree.
Expand Down
20 changes: 5 additions & 15 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ setenv =
local: SETENV=:
local-nobootstrap: BOOTSTRAP=:
local-!direct: PATH=/usr/bin:/bin:/usr/sbin:/sbin
local-sudo: __SUDO=--sudo
# brew caches downloaded files in ${HOME}/Library/Caches. We share it between different toxenvs.
local-homebrew: HOMEBREW={envdir}/homebrew
local-homebrew-usrlocal: HOMEBREW=/usr/local
Expand Down Expand Up @@ -410,12 +411,7 @@ commands =
#
# https://docs.brew.sh/Installation
homebrew: bash -c 'if [ ! -x {env:HOMEBREW}/bin/brew ]; then mkdir -p {env:HOMEBREW} && cd {env:HOMEBREW} && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 ; fi'
# homebrew-minimal: Minimal for bootstrapping and build.
# gettext and pkg-config are needed so that their aclocal macros are available.
homebrew: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/homebrew*.txt`; {env:HOMEBREW}/bin/brew install $PACKAGES; {env:HOMEBREW}/bin/brew upgrade $PACKAGES'
# -standard and -maximal are for now the same. This should be fixed when refactoring write-dockerfile.
homebrew-standard: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/homebrew.txt`; {env:HOMEBREW}/bin/brew install $PACKAGES; {env:HOMEBREW}/bin/brew upgrade $PACKAGES'
homebrew-maximal: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/homebrew.txt`; {env:HOMEBREW}/bin/brew install $PACKAGES; {env:HOMEBREW}/bin/brew upgrade $PACKAGES'
homebrew: bash -c 'PACKAGES=$(build/bin/sage-get-system-packages homebrew $(PATH=build/bin:$PATH build/bin/sage-package list {env:SAGE_PACKAGE_LIST_ARGS}) _bootstrap); {env:HOMEBREW}/bin/brew install $PACKAGES; {env:HOMEBREW}/bin/brew upgrade $PACKAGES'
#
# local-conda
#
Expand All @@ -428,18 +424,12 @@ commands =
local-conda: bash -c 'cat {env:CONDARC} >> {env:CONDA_PREFIX}/.condarc'
local-conda: bash -c 'if [ ! -x {env:CONDA_PREFIX}/bin/conda ]; then curl -L {env:CONDA_INSTALLER_URL_BASE}{env:CONDA_INSTALLER_FILE} -C - -o {env:SHARED_CACHE_DIR}/{env:CONDA_INSTALLER_FILE} && bash {env:SHARED_CACHE_DIR}/{env:CONDA_INSTALLER_FILE} -b -f -p {env:CONDA_PREFIX}; fi'
local-conda: bash -c '{env:SETENV} && {env:CONDA_PREFIX}/bin/conda update -n base --yes conda'
local-conda: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/conda*.txt`; {env:SETENV} && {env:CONDA_PREFIX}/bin/conda install --yes --quiet $PACKAGES'
# -standard and -maximal are for now the same. This should be fixed when refactoring write-dockerfile.
local-conda-standard: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/conda.txt`; {env:SETENV} && {env:CONDA_PREFIX}/bin/conda install --yes --quiet $PACKAGES'
local-conda-maximal: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/conda.txt`; {env:SETENV} && {env:CONDA_PREFIX}/bin/conda install --yes --quiet $PACKAGES'
local-conda: bash -c 'PACKAGES=$(build/bin/sage-get-system-packages conda $(PATH=build/bin:$PATH build/bin/sage-package list {env:SAGE_PACKAGE_LIST_ARGS}) _bootstrap); {env:SETENV} && {env:CONDA_PREFIX}/bin/conda install --yes --quiet $PACKAGES'
#
# local-sudo
# local-sudo: Use sudo to run the system package commands as root
#
local-sudo: bash -c '$(build/bin/sage-print-system-package-command {env:SYSTEM} update) #'
local-sudo: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/{env:SYSTEM}*.txt`; $(build/bin/sage-print-system-package-command {env:SYSTEM} --sudo --yes --no-install-recommends install $PACKAGES) || [ "$IGNORE_MISSING_SYSTEM_PACKAGES" = yes ] && echo "(ignoring errors)" '
# -standard and -maximal are for now the same. This should be fixed when refactoring write-dockerfile.
local-sudo-standard: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/{env:SYSTEM}.txt`; $(build/bin/sage-print-system-package-command {env:SYSTEM} --sudo --yes --no-install-recommends install $PACKAGES) || [ "$IGNORE_MISSING_SYSTEM_PACKAGES" = yes ] && echo "(ignoring errors)" '
local-sudo-maximal: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/{env:SYSTEM}.txt`; $(build/bin/sage-print-system-package-command {env:SYSTEM} --sudo --yes --no-install-recommends install $PACKAGES) || [ "$IGNORE_MISSING_SYSTEM_PACKAGES" = yes ] && echo "(ignoring errors)" '
local-sudo: bash -c 'PACKAGES=$(build/bin/sage-get-system-packages {env:SYSTEM} $(PATH=build/bin:$PATH build/bin/sage-package list {env:SAGE_PACKAGE_LIST_ARGS}) _bootstrap); $(build/bin/sage-print-system-package-command {env:SYSTEM} {env:__SUDO:} --yes --no-install-recommends install $PACKAGES) || [ "$IGNORE_MISSING_SYSTEM_PACKAGES" = yes ] && echo "(ignoring errors)" '
#
# All "local" environments
#
Expand Down

0 comments on commit 0dca776

Please sign in to comment.