Skip to content

Commit 26696ef

Browse files
authored
Merge branch 'develop' into revert/AbelianGroup.Subgroup
2 parents 0e36fde + e5f42fa commit 26696ef

4,440 files changed

Lines changed: 43824 additions & 40148 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ci/create-changes-html.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ diffParagraphs.forEach(paragraph => {
5151
EOF
5252
echo '</head>' >> CHANGES.html
5353
echo '<body>' >> CHANGES.html
54-
(cd $DOC_REPOSITORY && git diff $BASE_DOC_COMMIT -- *.html) > diff.txt
54+
(cd $DOC_REPOSITORY && git diff $BASE_DOC_COMMIT -- "*.html") > diff.txt
5555
python3 - << EOF
5656
import os, re, html
5757
with open('diff.txt', 'r') as f:
@@ -82,7 +82,7 @@ for block in diff_blocks:
8282
if content:
8383
with open(file_path, 'w') as file:
8484
file.writelines(content)
85-
path = 'html/' + doc
85+
path = doc
8686
hunks = '&nbsp;'.join(f'<a href="{path}#hunk{i+1}" class="hunk" target="_blank">#{i + 1}</a>' for i in range(count))
8787
out_blocks.append(f'<p class="diff"><a href="{path}">{doc}</a>&nbsp;' + hunks + '&emsp;</p>'
8888
+ '\n<pre><code class="language-diff">'

.ci/docker-exec-script.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh -x
2+
if [ $# -lt 3 ]; then
3+
echo >&2 "usage: docker-exec-script.sh CONTAINER WORKDIR [VAR=VALUE...] SCRIPT"
4+
exit 1
5+
fi
6+
CONTAINER=$1
7+
WORKDIR=$2
8+
shift 2
9+
(echo "cd \"$WORKDIR\"";
10+
while [ $# -gt 1 ]; do
11+
echo "export \"$1\""
12+
shift
13+
done;
14+
cat "$1") | docker exec -i $CONTAINER bash -ex

.ci/merge-fixes.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/sh
2-
# Apply open PRs labeled "blocker" from sagemath/sage as patches.
2+
# Apply open PRs labeled "p: CI Fix" from sagemath/sage as patches.
3+
# (policy set by vote in 2024-03,
4+
# https://groups.google.com/g/sage-devel/c/OKwwUGyKveo/m/vpyCXYBqAAAJ)
5+
#
36
# This script is invoked by various workflows in .github/workflows
47
#
58
# The repository variable SAGE_CI_FIXES_FROM_REPOS can be set
@@ -20,15 +23,15 @@ for REPO in ${SAGE_CI_FIXES_FROM_REPOSITORIES:-sagemath/sage}; do
2023
echo "Nothing to do for 'none' in SAGE_CI_FIXES_FROM_REPOSITORIES"
2124
;;
2225
*/*)
23-
echo "Getting open PRs with 'blocker' status from https://github.com/$REPO/pulls?q=is%3Aopen+label%3A%22p%3A+blocker+%2F+1%22"
26+
echo "Getting open PRs with 'p: CI Fix' label from https://github.com/$REPO/pulls?q=is%3Aopen+label%3A%22p%3A+CI+Fix%22"
2427
GH="gh -R $REPO"
2528
REPO_FILE="upstream/ci-fixes-${REPO%%/*}-${REPO##*/}"
26-
PRs="$($GH pr list --label "p: blocker / 1" --json number --jq '.[].number' | tee $REPO_FILE)"
29+
PRs="$($GH pr list --label "p: CI Fix" --json number --jq '.[].number' | tee $REPO_FILE)"
2730
date -u +"%Y-%m-%dT%H:%M:%SZ" > $REPO_FILE.date # Record the date, for future reference
2831
if [ -z "$PRs" ]; then
29-
echo "Nothing to do: Found no open PRs with 'blocker' status in $REPO."
32+
echo "Nothing to do: Found no open PRs with 'p: CI Fix' label in $REPO."
3033
else
31-
echo "Found open PRs with 'blocker' status in $REPO: $(echo $PRs)"
34+
echo "Found open PRs with 'p: CI Fix' label in $REPO: $(echo $PRs)"
3235
git tag -f test_base
3336
git commit -q -m "Uncommitted changes" --no-allow-empty -a
3437
for a in $PRs; do

.ci/retrofit-worktree.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ export GIT_AUTHOR_EMAIL="ci-sage@example.com"
1212
export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
1313
export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
1414

15+
set -e
16+
1517
# Set globally for other parts of the workflow
1618
git config --global user.name "$GIT_AUTHOR_NAME"
1719
git config --global user.email "$GIT_AUTHOR_EMAIL"
1820

19-
set -ex
21+
set -x
2022

2123
# If actions/checkout downloaded our source tree using the GitHub REST API
2224
# instead of with git (because do not have git installed in our image),
@@ -30,14 +32,14 @@ git tag -f new
3032
# But $WORKTREE_DIRECTORY is not a git repository.
3133
# We make $WORKTREE_DIRECTORY a worktree whose index is at tag "new".
3234
# We then commit the current sources and set the tag "old". (This keeps all mtimes unchanged.)
33-
# Then we update worktree and index with "git reset --hard new".
35+
# Then we update worktree and index with "git checkout new".
3436
# (This keeps mtimes of unchanged files unchanged and mtimes of changed files newer than unchanged files.)
35-
# Finally we reset the index to "old". (This keeps all mtimes unchanged.)
36-
# The changed files now show up as uncommitted changes.
37-
# The final "git add -N" makes sure that files that were added in "new" do not show
38-
# as untracked files, which would be removed by "git clean -fx".
37+
if [ -L $WORKTREE_NAME ]; then
38+
rm -f $WORKTREE_NAME
39+
fi
40+
git worktree prune --verbose
3941
git worktree add --detach $WORKTREE_NAME
4042
rm -rf $WORKTREE_DIRECTORY/.git && mv $WORKTREE_NAME/.git $WORKTREE_DIRECTORY/
4143
rm -rf $WORKTREE_NAME && ln -s $WORKTREE_DIRECTORY $WORKTREE_NAME
4244
if [ ! -f $WORKTREE_NAME/.gitignore ]; then cp .gitignore $WORKTREE_NAME/; fi
43-
(cd $WORKTREE_NAME && git add -A && git commit --quiet --allow-empty -m "old" -a && git tag -f old && git reset --hard new && git reset --quiet old && git add -N . && git status)
45+
(cd $WORKTREE_NAME && git add -A && git commit --quiet --allow-empty -m "old" -a && git tag -f old && git checkout new && git status)
Lines changed: 88 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,41 @@
11
#! /usr/bin/env bash
2-
## Write a Dockerfile to stdout that tests that the packages listed in the debian.txt/fedora.txt files of standard spkg exist
3-
## and satisfy the requirements tested by spkg-configure.m4
4-
## This is called by $SAGE_ROOT/tox.ini
52
set -e
6-
SYSTEM="${1:-debian}"
73
shopt -s extglob
4+
##
5+
## Write a Dockerfile for portability testing to stdout.
6+
##
7+
## This script needs to be run from SAGE_ROOT (root of the Sage repository).
8+
## It is called by $SAGE_ROOT/tox.ini for all environments 'tox -e docker-...'
9+
##
10+
## Positional arguments:
11+
##
12+
SYSTEM="${1:-debian}"
813
SAGE_PACKAGE_LIST_ARGS="${2:-:standard:}"
914
WITH_SYSTEM_SPKG="${3:-yes}"
1015
IGNORE_MISSING_SYSTEM_PACKAGES="${4:-no}"
1116
EXTRA_SAGE_PACKAGES="${5:-_bootstrap}"
12-
#
17+
##
18+
## Environment variables that take influence:
19+
##
20+
## - BOOTSTRAP
21+
## - CONFIGURE_ARGS
22+
## - DEVTOOLSET
23+
## - DIST_UPGRADE
24+
## - DOCKER_BUILDKIT
25+
## - EXTRA_PATH
26+
## - EXTRA_REPOSITORIES
27+
## - EXTRA_SYSTEM_PACKAGES
28+
## - FULL_BASE_IMAGE_AND_TAG
29+
## - SKIP_SYSTEM_PKG_INSTALL
30+
## - USE_CONDARC
31+
## - __CHOWN
32+
## - __SUDO
33+
##
1334
STRIP_COMMENTS="sed s/#.*//;"
1435
SAGE_ROOT=.
1536
export PATH="$SAGE_ROOT"/build/bin:$PATH
1637
SYSTEM_PACKAGES=$EXTRA_SYSTEM_PACKAGES
17-
CONFIGURE_ARGS="--enable-option-checking "
38+
SYSTEM_CONFIGURE_ARGS="--enable-option-checking "
1839
for SPKG in $(sage-package list --has-file=spkg-configure.m4 $SAGE_PACKAGE_LIST_ARGS) $EXTRA_SAGE_PACKAGES; do
1940
SYSTEM_PACKAGE=$(sage-get-system-packages $SYSTEM $SPKG)
2041
if [ -n "${SYSTEM_PACKAGE}" ]; then
@@ -24,16 +45,16 @@ for SPKG in $(sage-package list --has-file=spkg-configure.m4 $SAGE_PACKAGE_LIST_
2445
# shell-quote package if necessary
2546
SYSTEM_PACKAGES+=$(printf " %q" "$a")
2647
done
27-
CONFIGURE_ARGS+="--with-system-${SPKG}=${WITH_SYSTEM_SPKG} "
48+
SYSTEM_CONFIGURE_ARGS+="--with-system-${SPKG}=${WITH_SYSTEM_SPKG} "
2849
fi
2950
done
30-
echo "# Automatically generated by SAGE_ROOT/build/bin/write-dockerfile.sh"
51+
echo "# Automatically generated by SAGE_ROOT/.ci/write-dockerfile.sh"
3152
echo "# the :comments: separate the generated file into sections"
3253
echo "# to simplify writing scripts that customize this file"
3354
ADD="ADD $__CHOWN"
3455
RUN=RUN
3556
cat <<EOF
36-
ARG BASE_IMAGE
57+
ARG BASE_IMAGE=$(eval echo "${FULL_BASE_IMAGE_AND_TAG}")
3758
FROM \${BASE_IMAGE} as with-system-packages
3859
EOF
3960
case $SYSTEM in
@@ -54,8 +75,21 @@ case $SYSTEM in
5475
1|y*|Y*)
5576
;;
5677
*)
78+
#
79+
# The Ubuntu Docker images are "minimized", meaning that some large
80+
# bits such as documentation has been removed. We have to unminimize
81+
# once (which reinstalls the full versions of some minimized packages),
82+
# or e.g. the maxima documentation (which we depend on for correct operation)
83+
# will be missing.
84+
#
85+
# But we only have to do this once. To save time in incremental builds,
86+
# we remove the unminimize binary here after it has done its job.
87+
#
5788
cat <<EOF
58-
RUN (yes | unminimize) || echo "(ignored)"
89+
RUN if command -v unminimize > /dev/null; then \
90+
(yes | unminimize) || echo "(ignored)"; \
91+
rm -f "\$(command -v unminimize)"; \
92+
fi
5993
EOF
6094
if [ -n "$DIST_UPGRADE" ]; then
6195
cat <<EOF
@@ -143,7 +177,7 @@ EOF
143177
;;
144178
*)
145179
cat <<EOF
146-
ARG USE_CONDARC=condarc.yml
180+
ARG USE_CONDARC=${USE_CONDARC-condarc.yml}
147181
ADD *condarc*.yml /tmp/
148182
RUN echo \${CONDARC}; cd /tmp && conda config --stdin < \${USE_CONDARC}
149183
RUN conda update -n base conda
@@ -230,32 +264,48 @@ cat <<EOF
230264
231265
FROM with-system-packages as bootstrapped
232266
#:bootstrapping:
233-
RUN if [ -d /sage ]; then echo "### Incremental build from \$(cat /sage/VERSION.txt)" && mv /sage /sage-old && mkdir /sage && for a in local logs; do if [ -d /sage-old/\$a ]; then mv /sage-old/\$a /sage; fi; done; rm -rf /sage-old; else mkdir -p /sage; fi
267+
$ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap bootstrap-conda configure.ac sage .homebrew-build-env tox.ini Pipfile.m4 .gitignore /new/
268+
$ADD config/config.rpath /new/config/config.rpath
269+
$ADD src/doc/bootstrap /new/src/doc/bootstrap
270+
$ADD src/bin /new/src/bin
271+
$ADD src/Pipfile.m4 src/pyproject.toml src/requirements.txt.m4 src/setup.cfg.m4 src/VERSION.txt /new/src/
272+
$ADD m4 /new/m4
273+
$ADD pkgs /new/pkgs
274+
$ADD build /new/build
275+
$ADD .upstream.d /new/.upstream.d
276+
ADD .ci /.ci
277+
RUN if [ -d /sage ]; then \
278+
echo "### Incremental build from \$(cat /sage/VERSION.txt)" && \
279+
printf '/src\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /sage/.gitignore && \
280+
printf '/src\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /new/.gitignore && \
281+
if ! (cd /new && /.ci/retrofit-worktree.sh worktree-image /sage); then \
282+
echo "retrofit-worktree.sh failed, falling back to replacing /sage"; \
283+
for a in local logs; do \
284+
if [ -d /sage/\$a ]; then mv /sage/\$a /new/; fi; \
285+
done; \
286+
rm -rf /sage; \
287+
mv /new /sage; \
288+
fi; \
289+
else \
290+
mv /new /sage; \
291+
fi
234292
WORKDIR /sage
235-
$ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap bootstrap-conda configure.ac sage .homebrew-build-env tox.ini Pipfile.m4 ./
236-
$ADD config/config.rpath config/config.rpath
237-
$ADD src/doc/bootstrap src/doc/bootstrap
238-
$ADD src/bin src/bin
239-
$ADD src/Pipfile.m4 src/pyproject.toml.m4 src/requirements.txt.m4 src/VERSION.txt src/
240-
$ADD m4 ./m4
241-
$ADD pkgs pkgs
242-
$ADD build ./build
243-
$ADD .upstream.d ./.upstream.d
244-
ARG BOOTSTRAP=./bootstrap
293+
294+
ARG BOOTSTRAP="${BOOTSTRAP-./bootstrap}"
245295
$RUN sh -x -c "\${BOOTSTRAP}" $ENDRUN $THEN_SAVE_STATUS
246296
247297
FROM bootstrapped as configured
248298
#:configuring:
249299
RUN $CHECK_STATUS_THEN mkdir -p logs/pkgs; rm -f config.log; ln -s logs/pkgs/config.log config.log
250-
ARG EXTRA_CONFIGURE_ARGS=""
300+
ARG CONFIGURE_ARGS="${CONFIGURE_ARGS:---enable-build-as-root}"
251301
EOF
252302
if [ ${WITH_SYSTEM_SPKG} = "force" ]; then
253303
cat <<EOF
254-
$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 ***********"; echo "::group::config.log"; cat config.log; echo "::endgroup::"; ./configure --enable-build-as-root; echo "::group::config.log"; cat config.log; echo "::endgroup::"; exit 1) $ENDRUN $THEN_SAVE_STATUS
304+
$RUN ./configure $SYSTEM_CONFIGURE_ARGS \${CONFIGURE_ARGS} || (echo "::group::config.log"; cat config.log; echo "::endgroup::"; echo "********** configuring without forcing ***********"; ./configure \${CONFIGURE_ARGS}; echo "::group::config.log"; cat config.log; echo "::endgroup::"; exit 1) $ENDRUN $THEN_SAVE_STATUS
255305
EOF
256306
else
257307
cat <<EOF
258-
$RUN echo "****** Configuring: ./configure --enable-build-as-root $CONFIGURE_ARGS \${EXTRA_CONFIGURE_ARGS} *******"; ./configure --enable-build-as-root $CONFIGURE_ARGS \${EXTRA_CONFIGURE_ARGS} || (echo "::group::config.log"; cat config.log; echo "::endgroup::"; exit 1) $ENDRUN $THEN_SAVE_STATUS
308+
$RUN ./configure $SYSTEM_CONFIGURE_ARGS \${CONFIGURE_ARGS} || (echo "::group::config.log"; cat config.log; echo "::endgroup::"; exit 1) $ENDRUN $THEN_SAVE_STATUS
259309
EOF
260310
fi
261311
cat <<EOF
@@ -286,7 +336,19 @@ ENV MAKE="make -j\${NUMPROC}"
286336
ARG USE_MAKEFLAGS="-k V=0"
287337
ENV SAGE_CHECK=warn
288338
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst"
289-
$ADD src src
339+
$ADD .gitignore /new/.gitignore
340+
$ADD src /new/src
341+
ADD .ci /.ci
342+
RUN cd /new && rm -rf .git && \
343+
if /.ci/retrofit-worktree.sh worktree-pre /sage; then \
344+
cd /sage && touch configure build/make/Makefile; \
345+
else \
346+
echo "retrofit-worktree.sh failed, falling back to replacing /sage/src"; \
347+
rm -rf /sage/src; \
348+
mv src /sage/src; \
349+
cd /sage && ./bootstrap && ./config.status; \
350+
fi
351+
290352
ARG TARGETS="build"
291353
$RUN $CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS} $ENDRUN $THEN_SAVE_STATUS
292354

.devcontainer/onCreate-conda.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,4 @@ conda init bash
88

99
# Build sage
1010
conda run -n sage-dev ./bootstrap
11-
conda run -n sage-dev ./configure --with-python=/opt/conda/envs/sage-dev/bin/python --prefix=/opt/conda/envs/sage-dev
12-
conda run -n sage-dev pip install --no-build-isolation -v -v -e ./pkgs/sage-conf ./pkgs/sage-setup
1311
conda run -n sage-dev pip install --no-build-isolation -v -v -e ./src

.devcontainer/portability-debian-buster-gcc_spkg-minimal/devcontainer.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

.devcontainer/portability-debian-buster-gcc_spkg-minimal/portability-Dockerfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

.devcontainer/portability-debian-buster-gcc_spkg-standard/devcontainer.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

.devcontainer/portability-debian-buster-gcc_spkg-standard/portability-Dockerfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)