Skip to content

Commit a7455b1

Browse files
authored
Merge branch 'develop' into patch-8
2 parents 62b05ff + 209ae4c commit a7455b1

File tree

1,645 files changed

+35997
-13776
lines changed

Some content is hidden

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

1,645 files changed

+35997
-13776
lines changed

.ci/create-changes-html.sh

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/bin/sh
22
if [ $# != 2 ]; then
3-
echo >&2 "usage: $0 BASE_DOC_COMMIT DOC_REPO"
4-
echo >&2 "creates CHANGES.html in the current directory"
5-
echo >&2 "for the diffs of DOC_REPO against BASE_DOC_COMMIT"
3+
echo >&2 "Usage: $0 DIFF_TEXT DOC_REPO"
4+
echo >&2 "This script generates a CHANGES.html file in the current directory"
5+
echo >&2 "and adds anchor targets in the documents within DOC_REPO"
6+
echo >&2 "based on the diff hunks in the DIFF_TEXT file."
67
exit 1
78
fi
8-
BASE_DOC_COMMIT="$1"
9+
DIFF_TEXT="$1"
910
DOC_REPOSITORY="$2"
1011

1112
# Create CHANGES.html
@@ -52,11 +53,10 @@ diffParagraphs.forEach(paragraph => {
5253
EOF
5354
echo '</head>' >> CHANGES.html
5455
echo '<body>' >> CHANGES.html
55-
(cd $DOC_REPOSITORY && git diff $BASE_DOC_COMMIT -- "*.html") > diff.txt
5656
python3 - << EOF
5757
import os, re, html
5858
from itertools import chain
59-
with open('diff.txt', 'r') as f:
59+
with open('$DIFF_TEXT', 'r') as f:
6060
diff_text = f.read()
6161
diff_blocks = re.split(r'^(?=diff --git)', diff_text, flags=re.MULTILINE)
6262
out_blocks = []
@@ -83,12 +83,21 @@ for block in diff_blocks:
8383
hunk_lines = []
8484
search_result = re.search(r'@@ -(\d+),(\d+) \+(\d+),(\d+)', line)
8585
if search_result:
86-
line_number = int(search_result.group(3))
86+
line_number = int(search_result.group(3)) - 1
8787
span = int(search_result.group(4))
8888
for i in chain(range(line_number, line_number + span), range(line_number - 1, -1, -1)):
89-
if content[i].startswith('<') and not content[i].startswith('</'):
89+
try:
90+
ln = content[i]
91+
except IndexError:
92+
continue
93+
for idx, char in enumerate(ln):
94+
if not char.isspace():
95+
break
96+
else:
97+
idx = len(ln)
98+
if ln.startswith('<', idx) and not ln.startswith('</', idx):
9099
count += 1
91-
content[i] = f'<span id="hunk{count}" style="visibility: hidden;"></span>' + content[i]
100+
content[i] = ln[:idx] + f'<span id="hunk{count}" style="visibility: hidden;"></span>' + ln[idx:]
92101
hunks.append(f'<p class="hunk"><a href="{path}#hunk{count}" class="hunk" target="_blank">hunk #{count}</a></p>')
93102
break
94103
hunk_lines.append(line)
@@ -107,4 +116,4 @@ EOF
107116
cat diff.html >> CHANGES.html
108117
echo '</body>' >> CHANGES.html
109118
echo '</html>' >> CHANGES.html
110-
rm diff.txt diff.html
119+
rm diff.html

.ci/retrofit-worktree.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ git worktree add --detach $WORKTREE_NAME
4343
rm -rf $WORKTREE_DIRECTORY/.git && mv $WORKTREE_NAME/.git $WORKTREE_DIRECTORY/
4444
rm -rf $WORKTREE_NAME && ln -s $WORKTREE_DIRECTORY $WORKTREE_NAME
4545
if [ ! -f $WORKTREE_NAME/.gitignore ]; then cp .gitignore $WORKTREE_NAME/; fi
46-
(cd $WORKTREE_NAME && git add -A && git commit --quiet --allow-empty -m "old" -a && git tag -f old && git checkout new && git status)
46+
(cd $WORKTREE_NAME && git add -A && git commit --quiet --allow-empty -m "old" -a && git tag -f old && git checkout -f new && git clean -fd && git status)

.ci/write-dockerfile.sh

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ STRIP_COMMENTS="sed s/#.*//;"
3535
SAGE_ROOT=.
3636
export PATH="$SAGE_ROOT"/build/bin:$PATH
3737
SYSTEM_PACKAGES=$EXTRA_SYSTEM_PACKAGES
38-
SYSTEM_CONFIGURE_ARGS="--enable-option-checking "
38+
SYSTEM_CONFIGURE_ARGS=" --enable-option-checking"
3939
for SPKG in $(sage-package list --has-file=spkg-configure.m4 $SAGE_PACKAGE_LIST_ARGS) $EXTRA_SAGE_PACKAGES; do
4040
SYSTEM_PACKAGE=$(sage-get-system-packages $SYSTEM $SPKG)
4141
if [ -n "${SYSTEM_PACKAGE}" ]; then
@@ -45,13 +45,20 @@ for SPKG in $(sage-package list --has-file=spkg-configure.m4 $SAGE_PACKAGE_LIST_
4545
# shell-quote package if necessary
4646
SYSTEM_PACKAGES+=$(printf " %q" "$a")
4747
done
48-
SYSTEM_CONFIGURE_ARGS+="--with-system-${SPKG}=${WITH_SYSTEM_SPKG} "
48+
# Check if SPKG is not a dummy package
49+
if [[ $SPKG != _* ]]; then
50+
SYSTEM_CONFIGURE_ARGS+=" --with-system-${SPKG}=${WITH_SYSTEM_SPKG}"
51+
fi
4952
fi
5053
done
5154
echo "# Automatically generated by SAGE_ROOT/.ci/write-dockerfile.sh"
5255
echo "# the :comments: separate the generated file into sections"
5356
echo "# to simplify writing scripts that customize this file"
54-
ADD="ADD $__CHOWN"
57+
if [ -z "$__CHOWN" ]; then
58+
ADD="ADD"
59+
else
60+
ADD="ADD $__CHOWN"
61+
fi
5562
RUN=RUN
5663
cat <<EOF
5764
ARG BASE_IMAGE=$(eval echo "${FULL_BASE_IMAGE_AND_TAG}")
@@ -86,10 +93,7 @@ case $SYSTEM in
8693
# we remove the unminimize binary here after it has done its job.
8794
#
8895
cat <<EOF
89-
RUN if command -v unminimize > /dev/null; then \
90-
(yes | unminimize) || echo "(ignored)"; \
91-
rm -f "\$(command -v unminimize)"; \
92-
fi
96+
RUN if command -v unminimize > /dev/null; then (yes | unminimize) || echo "(ignored)"; rm -f "\$(command -v unminimize)"; fi
9397
EOF
9498
if [ -n "$DIST_UPGRADE" ]; then
9599
cat <<EOF
@@ -254,10 +258,10 @@ case ${DOCKER_BUILDKIT-0} in
254258
# With buildkit we cannot retrieve failed builds.
255259
# So we do not allow the main step of a build stage to fail.
256260
# Instead we record the exit code in the file STATUS.
257-
THEN_SAVE_STATUS='; echo $? > STATUS'
261+
THEN_SAVE_STATUS=' ; echo $? > STATUS'
258262
# ... and at the beginning of the next build stage,
259263
# we check the status and exit with an error status.
260-
CHECK_STATUS_THEN='STATUS=$(cat STATUS 2>/dev/null); case "$STATUS" in ""|0) ;; *) exit $STATUS;; esac; '
264+
CHECK_STATUS_THEN=' STATUS=$(cat STATUS 2>/dev/null); case "$STATUS" in ""|0) ;; *) exit $STATUS;; esac;'
261265
esac
262266

263267
if [ -n "$GITHUB_ACTIONS" ]; then
@@ -281,38 +285,37 @@ $ADD pkgs /new/pkgs
281285
$ADD build /new/build
282286
$ADD .upstream.d /new/.upstream.d
283287
ADD .ci /.ci
284-
RUN if [ -d /sage ]; then \
285-
echo "### Incremental build from \$(cat /sage/VERSION.txt)" && \
286-
printf '/src\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /sage/.gitignore && \
287-
printf '/src\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /new/.gitignore && \
288-
if ! (cd /new && /.ci/retrofit-worktree.sh worktree-image /sage); then \
289-
echo "retrofit-worktree.sh failed, falling back to replacing /sage"; \
290-
for a in local logs; do \
291-
if [ -d /sage/\$a ]; then mv /sage/\$a /new/; fi; \
292-
done; \
293-
rm -rf /sage; \
294-
mv /new /sage; \
295-
fi; \
296-
else \
297-
mv /new /sage; \
288+
RUN if [ -d /sage ]; then \\
289+
echo "### Incremental build from \$(cat /sage/VERSION.txt)" && \\
290+
printf '/src/*\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /sage/.gitignore && \\
291+
printf '/src/*\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /new/.gitignore && \\
292+
if ! (cd /new && /.ci/retrofit-worktree.sh worktree-image /sage); then \\
293+
echo "retrofit-worktree.sh failed, falling back to replacing /sage"; \\
294+
for a in local logs; do \\
295+
if [ -d /sage/\$a ]; then mv /sage/\$a /new/; fi; \\
296+
done; \\
297+
rm -rf /sage; \\
298+
mv /new /sage; \\
299+
fi; \\
300+
else \\
301+
mv /new /sage; \\
298302
fi
299303
WORKDIR /sage
300-
301304
ARG BOOTSTRAP="${BOOTSTRAP-./bootstrap}"
302-
$RUN sh -x -c "\${BOOTSTRAP}" $ENDRUN $THEN_SAVE_STATUS
305+
$RUN sh -x -c "\${BOOTSTRAP}"$ENDRUN$THEN_SAVE_STATUS
303306
304307
FROM bootstrapped AS configured
305308
#:configuring:
306-
RUN $CHECK_STATUS_THEN mkdir -p logs/pkgs; rm -f config.log; ln -s logs/pkgs/config.log config.log
309+
RUN$CHECK_STATUS_THEN mkdir -p logs/pkgs; rm -f config.log; ln -s logs/pkgs/config.log config.log
307310
ARG CONFIGURE_ARGS="${CONFIGURE_ARGS:---enable-build-as-root}"
308311
EOF
309312
if [ ${WITH_SYSTEM_SPKG} = "force" ]; then
310313
cat <<EOF
311-
$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
314+
$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
312315
EOF
313316
else
314317
cat <<EOF
315-
$RUN ./configure $SYSTEM_CONFIGURE_ARGS \${CONFIGURE_ARGS} || (echo "::group::config.log"; cat config.log; echo "::endgroup::"; exit 1) $ENDRUN $THEN_SAVE_STATUS
318+
$RUN ./configure $SYSTEM_CONFIGURE_ARGS \${CONFIGURE_ARGS} || (echo "::group::config.log"; cat config.log; echo "::endgroup::"; exit 1)$ENDRUN$THEN_SAVE_STATUS
316319
EOF
317320
fi
318321
cat <<EOF
@@ -323,50 +326,49 @@ ARG NUMPROC=8
323326
ENV MAKE="make -j\${NUMPROC}"
324327
ARG USE_MAKEFLAGS="-k V=0"
325328
ENV SAGE_CHECK=warn
326-
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst"
329+
ENV SAGE_CHECK_PACKAGES="!cython,!python3,!cysignals,!linbox,!ppl,!cmake,!rpy2,!sage_sws2rst"
327330
#:toolchain:
328-
$RUN $CHECK_STATUS_THEN make \${USE_MAKEFLAGS} base-toolchain $ENDRUN $THEN_SAVE_STATUS
331+
$RUN$CHECK_STATUS_THEN make \${USE_MAKEFLAGS} base-toolchain$ENDRUN$THEN_SAVE_STATUS
329332
330333
FROM with-base-toolchain AS with-targets-pre
331334
ARG NUMPROC=8
332335
ENV MAKE="make -j\${NUMPROC}"
333336
ARG USE_MAKEFLAGS="-k V=0"
334337
ENV SAGE_CHECK=warn
335-
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst"
338+
ENV SAGE_CHECK_PACKAGES="!cython,!python3,!cysignals,!linbox,!ppl,!cmake,!rpy2,!sage_sws2rst"
336339
#:make:
337340
ARG TARGETS_PRE="all-sage-local"
338-
$RUN $CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS_PRE} $ENDRUN $THEN_SAVE_STATUS
341+
$RUN$CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS_PRE}$ENDRUN$THEN_SAVE_STATUS
339342
340343
FROM with-targets-pre AS with-targets
341344
ARG NUMPROC=8
342345
ENV MAKE="make -j\${NUMPROC}"
343346
ARG USE_MAKEFLAGS="-k V=0"
344347
ENV SAGE_CHECK=warn
345-
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst"
348+
ENV SAGE_CHECK_PACKAGES="!cython,!python3,!cysignals,!linbox,!ppl,!cmake,!rpy2,!sage_sws2rst"
346349
$ADD .gitignore /new/.gitignore
347350
$ADD src /new/src
348-
RUN cd /new && rm -rf .git && \
349-
if /.ci/retrofit-worktree.sh worktree-pre /sage; then \
350-
cd /sage && touch configure build/make/Makefile; \
351-
else \
352-
echo "retrofit-worktree.sh failed, falling back to replacing /sage/src"; \
353-
rm -rf /sage/src; \
354-
mv src /sage/src; \
355-
cd /sage && ./bootstrap && ./config.status; \
356-
fi; \
351+
RUN cd /new && rm -rf .git && \\
352+
if /.ci/retrofit-worktree.sh worktree-pre /sage; then \\
353+
cd /sage && touch configure build/make/Makefile; \\
354+
else \\
355+
echo "retrofit-worktree.sh failed, falling back to replacing /sage/src"; \\
356+
rm -rf /sage/src; \\
357+
mv src /sage/src; \\
358+
cd /sage && ./bootstrap && ./config.status; \\
359+
fi; \\
357360
cd /sage && rm -rf .git; rm -rf /new || echo "(error ignored)"
358-
359361
ARG TARGETS="build"
360-
$RUN $CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS} $ENDRUN $THEN_SAVE_STATUS
362+
$RUN$CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS}$ENDRUN$THEN_SAVE_STATUS
361363
362364
FROM with-targets AS with-targets-optional
363365
ARG NUMPROC=8
364366
ENV MAKE="make -j\${NUMPROC}"
365367
ARG USE_MAKEFLAGS="-k V=0"
366368
ENV SAGE_CHECK=warn
367-
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst"
369+
ENV SAGE_CHECK_PACKAGES="!cython,!python3,!cysignals,!linbox,!ppl,!cmake,!rpy2,!sage_sws2rst"
368370
ARG TARGETS_OPTIONAL="ptest"
369-
$RUN $CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS_OPTIONAL} || echo "(error ignored)" $ENDRUN $THEN_SAVE_STATUS
371+
$RUN$CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS_OPTIONAL} || echo "(error ignored)"$ENDRUN$THEN_SAVE_STATUS
370372
371373
#:end:
372374
EOF

.codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ coverage:
1717
target: auto
1818
threshold: 0%
1919
base: auto
20+
informational: true

.devcontainer/portability-centos-stream-9-python3.9-minimal/devcontainer.json renamed to .devcontainer/portability-centos-stream-9-minimal/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
// from .devcontainer/portability-devcontainer.json.in
44
// See https://aka.ms/devcontainer.json for format details.
55
{
6-
"name": "centos-stream-9-python3.9-minimal (≥ 8-core)",
6+
"name": "centos-stream-9-minimal (≥ 8-core)",
77
"build": {
88
"dockerfile": "portability-Dockerfile",
99
// See tox.ini for definitions
1010
"args": {
11-
"SYSTEM_FACTOR": "centos-stream-9-python3.9",
11+
"SYSTEM_FACTOR": "centos-stream-9",
1212
"PACKAGE_FACTOR": "minimal",
1313
"DOCKER_TARGET": "with-targets",
1414
"DOCKER_TAG": "dev"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// The command "tox -e update_docker_platforms"
2+
// creates .devcontainer/portability-*-*/devcontainer.json
3+
// from .devcontainer/portability-devcontainer.json.in
4+
// See https://aka.ms/devcontainer.json for format details.
5+
{
6+
"name": "centos-stream-9-python3.12-minimal (≥ 8-core)",
7+
"build": {
8+
"dockerfile": "portability-Dockerfile",
9+
// See tox.ini for definitions
10+
"args": {
11+
"SYSTEM_FACTOR": "centos-stream-9-python3.12",
12+
"PACKAGE_FACTOR": "minimal",
13+
"DOCKER_TARGET": "with-targets",
14+
"DOCKER_TAG": "dev"
15+
}
16+
},
17+
"containerEnv": {
18+
"MAKE": "make -j4"
19+
},
20+
"onCreateCommand": ".devcontainer/onCreate.sh",
21+
"updateContentCommand": ".devcontainer/portability-updateContent.sh",
22+
"extensions": [
23+
"ms-python.python"
24+
]
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// The command "tox -e update_docker_platforms"
2+
// creates .devcontainer/portability-*-*/devcontainer.json
3+
// from .devcontainer/portability-devcontainer.json.in
4+
// See https://aka.ms/devcontainer.json for format details.
5+
{
6+
"name": "centos-stream-9-python3.12-standard (≥ 8-core)",
7+
"build": {
8+
"dockerfile": "portability-Dockerfile",
9+
// See tox.ini for definitions
10+
"args": {
11+
"SYSTEM_FACTOR": "centos-stream-9-python3.12",
12+
"PACKAGE_FACTOR": "standard",
13+
"DOCKER_TARGET": "with-targets",
14+
"DOCKER_TAG": "dev"
15+
}
16+
},
17+
"containerEnv": {
18+
"MAKE": "make -j4"
19+
},
20+
"onCreateCommand": ".devcontainer/onCreate.sh",
21+
"updateContentCommand": ".devcontainer/portability-updateContent.sh",
22+
"extensions": [
23+
"ms-python.python"
24+
]
25+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../portability-Dockerfile

0 commit comments

Comments
 (0)