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

Commit 380c718

Browse files
author
Matthias Koeppe
committed
Merge branch 't/30944/tox__improve_local_sudo_ubuntu_standard' into t/31062/tox___gh_actions__disable_testsuites_of_packages_depending_on_pip_packages__pytest_______if_there_is_no_ssl
2 parents 48657d2 + e9ca2c1 commit 380c718

37 files changed

+67
-31
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ ptestoptional: all
208208
ptestoptionallong: all
209209
$(PTESTALL) --long --logfile=logs/ptestoptionallong.log
210210

211-
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
211+
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
212212
./bootstrap -d
213213

214214
install: all

bootstrap

+6-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,12 @@ bootstrap () {
8585
# --enable-SPKG options for installing pip packages
8686
if [ ! -f build/pkgs/$pkgname/requirements.txt ]; then
8787
pkgtype="$(cat build/pkgs/$pkgname/type)"
88-
spkg_configures="$spkg_configures
89-
SAGE_SPKG_ENABLE([$pkgname], [$pkgtype])"
88+
# Trac #29124: Do not provide --enable-_recommended and similar
89+
case "$pkgname" in
90+
_*) ;;
91+
*) spkg_configures="$spkg_configures
92+
SAGE_SPKG_ENABLE([$pkgname], [$pkgtype])" ;;
93+
esac
9094
fi
9195
done
9296
for pkgname in $(./sage --package list --has-file spkg-configure.m4 | sort); do

build/bin/sage-print-system-package-command

+3-2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ if [ -z "$system" -o -z "$command" ]; then
4949
fi
5050
system_packages="$*"
5151
options=
52+
env=
5253
shopt -s extglob
5354
case $system:$command in
5455
homebrew*:setup-build-env)
@@ -73,8 +74,8 @@ case $system:$command in
7374
;;
7475
@(debian*|ubuntu*):*)
7576
[ "$NO_INSTALL_RECOMMENDS" = yes ] && options="$options --no-install-recommends"
76-
[ "$YES" = yes ] && options="$options --yes"
77-
[ -n "$system_packages" ] && echo "${PROMPT}${SUDO}apt-get $command $options $system_packages"
77+
[ "$YES" = yes ] && options="$options --yes" env="DEBIAN_FRONTEND=noninteractive "
78+
[ -n "$system_packages" ] && echo "${PROMPT}${SUDO}${env}apt-get $command $options $system_packages"
7879
;;
7980
@(fedora*|redhat*|centos*):install)
8081
[ "$YES" = yes ] && options="$options -y"

build/bin/write-dockerfile.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ IGNORE_MISSING_SYSTEM_PACKAGES="${4:-no}"
1212
STRIP_COMMENTS="sed s/#.*//;"
1313
SAGE_ROOT=.
1414
export PATH="$SAGE_ROOT"/build/bin:$PATH
15-
SYSTEM_PACKAGES=$(echo $(${STRIP_COMMENTS} "$SAGE_ROOT"/build/pkgs/$SYSTEM{,-bootstrap}.txt))
15+
SYSTEM_PACKAGES=
1616
CONFIGURE_ARGS="--enable-option-checking "
17-
for PKG_BASE in $($SAGE_ROOT/sage -package list --has-file=distros/$SYSTEM.txt $SAGE_PACKAGE_LIST_ARGS); do
17+
for PKG_BASE in $($SAGE_ROOT/sage -package list --has-file=distros/$SYSTEM.txt $SAGE_PACKAGE_LIST_ARGS) _bootstrap; do
1818
PKG_SCRIPTS="$SAGE_ROOT"/build/pkgs/$PKG_BASE
1919
if [ -d $PKG_SCRIPTS ]; then
2020
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/distros/$SYSTEM.txt

build/pkgs/_bootstrap/SPKG.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
_bootstrap
2+
==========
3+
4+
This optional script package represents the requirements (system packages)
5+
that are needed in addition to those represented by the ``_prereq`` package
6+
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.

build/pkgs/_bootstrap/spkg-install

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#! /usr/bin/env bash
2+
# Nothing to do

build/pkgs/_bootstrap/type

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
optional

build/pkgs/_prereq/SPKG.rst

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
_prereq
2+
=======
3+
4+
This script package represents the minimal requirements (system packages)
5+
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.

build/pkgs/_prereq/spkg-configure.m4

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dnl We cannot check prerequisites because they are required
2+
dnl already for running the configure script.
3+
SAGE_SPKG_CONFIGURE([_prereq], [
4+
dnl Just assume that they are present.
5+
sage_spkg_install__prereq=no
6+
])

build/pkgs/_prereq/spkg-install

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#! /usr/bin/env bash
2+
# Nothing to do

build/pkgs/_prereq/type

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
standard

m4/sage_spkg_collect.m4

+8
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,16 @@ for DIR in $SAGE_ROOT/build/pkgs/*; do
230230
message="does not support check for system package; $message"
231231
])
232232
])
233+
234+
dnl Trac #29124: Do not talk about underscore club
235+
case "$SPKG_NAME" in
236+
_*)
237+
;;
238+
*)
233239
formatted_message=$(printf '%-45s%s' "$SPKG_NAME-$SPKG_VERSION:" "$message")
234240
AC_MSG_RESULT([$formatted_message])
241+
;;
242+
esac
235243
236244
AS_VAR_POPDEF([sage_use_system])dnl
237245
AS_VAR_POPDEF([sage_require])dnl

src/doc/bootstrap

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ mkdir -p "$OUTPUT_DIR"
2626
shopt -s extglob
2727

2828
for SYSTEM in arch debian fedora cygwin homebrew conda; do
29-
SYSTEM_PACKAGES=$(echo $(${STRIP_COMMENTS} build/pkgs/$SYSTEM.txt))
29+
SYSTEM_PACKAGES=
3030
OPTIONAL_SYSTEM_PACKAGES=
3131
SAGELIB_SYSTEM_PACKAGES=
3232
SAGELIB_OPTIONAL_SYSTEM_PACKAGES=

src/doc/en/developer/portability_testing.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,14 @@ Using Sage's database of distribution prerequisites
155155

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

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

706706
We start by creating a fresh (distclean) git worktree.

tox.ini

+18-18
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,8 @@ setenv =
349349
local: SETENV=:
350350
local-nobootstrap: BOOTSTRAP=:
351351
local-!direct: PATH=/usr/bin:/bin:/usr/sbin:/sbin
352+
local-sudo: __SUDO=--sudo
353+
local-root: CONFIG_CONFIGURE_ARGS_ROOT=--enable-build-as-root
352354
# brew caches downloaded files in ${HOME}/Library/Caches. We share it between different toxenvs.
353355
local-homebrew: HOMEBREW={envdir}/homebrew
354356
local-homebrew-usrlocal: HOMEBREW=/usr/local
@@ -387,7 +389,7 @@ setenv =
387389
#
388390
# Resulting full configuration args, including EXTRA_CONFIGURE_ARGS from the user environment
389391
#
390-
CONFIGURE_ARGS={env:CONFIG_CONFIGURE_ARGS_1:} {env:CONFIG_CONFIGURE_ARGS_2:} {env:EXTRA_CONFIGURE_ARGS:}
392+
CONFIGURE_ARGS={env:CONFIG_CONFIGURE_ARGS_ROOT:} {env:CONFIG_CONFIGURE_ARGS_1:} {env:CONFIG_CONFIGURE_ARGS_2:} {env:EXTRA_CONFIGURE_ARGS:}
391393

392394
# environment will be skipped if regular expression does not match against the sys.platform string
393395
platform =
@@ -410,12 +412,7 @@ commands =
410412
#
411413
# https://docs.brew.sh/Installation
412414
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'
413-
# homebrew-minimal: Minimal for bootstrapping and build.
414-
# gettext and pkg-config are needed so that their aclocal macros are available.
415-
homebrew: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/homebrew*.txt`; {env:HOMEBREW}/bin/brew install $PACKAGES; {env:HOMEBREW}/bin/brew upgrade $PACKAGES'
416-
# -standard and -maximal are for now the same. This should be fixed when refactoring write-dockerfile.
417-
homebrew-standard: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/homebrew.txt`; {env:HOMEBREW}/bin/brew install $PACKAGES; {env:HOMEBREW}/bin/brew upgrade $PACKAGES'
418-
homebrew-maximal: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/homebrew.txt`; {env:HOMEBREW}/bin/brew install $PACKAGES; {env:HOMEBREW}/bin/brew upgrade $PACKAGES'
415+
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'
419416
#
420417
# local-conda
421418
#
@@ -428,18 +425,13 @@ commands =
428425
local-conda: bash -c 'cat {env:CONDARC} >> {env:CONDA_PREFIX}/.condarc'
429426
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'
430427
local-conda: bash -c '{env:SETENV} && {env:CONDA_PREFIX}/bin/conda update -n base --yes conda'
431-
local-conda: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/conda*.txt`; {env:SETENV} && {env:CONDA_PREFIX}/bin/conda install --yes --quiet $PACKAGES'
432-
# -standard and -maximal are for now the same. This should be fixed when refactoring write-dockerfile.
433-
local-conda-standard: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/conda.txt`; {env:SETENV} && {env:CONDA_PREFIX}/bin/conda install --yes --quiet $PACKAGES'
434-
local-conda-maximal: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/conda.txt`; {env:SETENV} && {env:CONDA_PREFIX}/bin/conda install --yes --quiet $PACKAGES'
428+
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'
435429
#
436-
# local-sudo
430+
# local-root: Assume we are root, run the system package commands
431+
# local-sudo: Use sudo to run the system package commands as root
437432
#
438-
local-sudo: bash -c '$(build/bin/sage-print-system-package-command {env:SYSTEM} update) #'
439-
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)" '
440-
# -standard and -maximal are for now the same. This should be fixed when refactoring write-dockerfile.
441-
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)" '
442-
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)" '
433+
local-{root,sudo}: bash -c 'eval $(build/bin/sage-print-system-package-command {env:SYSTEM} {env:__SUDO:} update) #'
434+
local-{root,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); eval $(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)" '
443435
#
444436
# All "local" environments
445437
#
@@ -473,7 +465,15 @@ commands =
473465
docker: done'
474466
# #28728: gap fails its test suite.
475467
# linbox/cysignals testsuites fail. ppl takes very long.
476-
local: bash -c 'export PATH={env:PATH} && {env:SETENV} && {env:BOOTSTRAP} && ./configure --prefix={envdir}/local {env:CONFIGURE_ARGS} && make -k V=0 base-toolchain && make -k V=0 SAGE_SPKG="sage-spkg -y -o" SAGE_CHECK=warn SAGE_CHECK_PACKAGES="!cython,!r,!python3,!nose,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!networkx,!rpy2,!symengine_py,!sage_sws2rst" {env:TARGETS_PRE:} {posargs:build} && (make -k V=0 SAGE_SPKG="sage-spkg -y -o" SAGE_CHECK=warn SAGE_CHECK_PACKAGES="!cython,!r,!python3,!nose,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!networkx,!rpy2,!symengine_py,!sage_sws2rst" {env:TARGETS_OPTIONAL:} || echo "(error ignored)" ) '
468+
local: bash -c 'export PATH={env:PATH} && {env:SETENV} && \
469+
local: {env:BOOTSTRAP} && \
470+
local: ./configure --prefix={envdir}/local {env:CONFIGURE_ARGS} && \
471+
local: case "{posargs:}" in \
472+
local: config*) ;; \
473+
local: *) make -k V=0 base-toolchain ;; \
474+
local: esac && \
475+
local: make -k V=0 SAGE_SPKG="sage-spkg -y -o" SAGE_CHECK=warn SAGE_CHECK_PACKAGES="!cython,!r,!python3,!nose,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!networkx,!rpy2,!symengine_py,!sage_sws2rst" {env:TARGETS_PRE:} {posargs:build} && \
476+
local: ([ -z "{env:TARGETS_OPTIONAL:}" ] || make -k V=0 SAGE_SPKG="sage-spkg -y -o" SAGE_CHECK=warn SAGE_CHECK_PACKAGES="!cython,!r,!python3,!nose,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!networkx,!rpy2,!symengine_py,!sage_sws2rst" {env:TARGETS_OPTIONAL:} || echo "(error ignored)" ) '
477477

478478
[testenv:check_configure]
479479
## Test that configure behaves properly

0 commit comments

Comments
 (0)