Skip to content

Commit

Permalink
Merge branch 'develop' into EllipticCurvePoint_inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
kwankyu authored May 13, 2024
2 parents fa73364 + ffbbea9 commit 051126d
Show file tree
Hide file tree
Showing 3,029 changed files with 56,623 additions and 560,631 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions .ci/create-changes-html.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ echo '<script>hljs.highlightAll();</script>' >> CHANGES.html
cat >> CHANGES.html << EOF
<script>
document.addEventListener('DOMContentLoaded', () => {
const baseDocURL = 'https://sagemath.netlify.app'
const diffSite = 'https://pianomister.github.io/diffsite'
const baseDocURL = 'https://sagemath-tobias.netlify.app'
const diffParagraphs = document.querySelectorAll('p.diff');
diffParagraphs.forEach(paragraph => {
const rootURL = window.location.origin;
Expand Down Expand Up @@ -51,7 +51,7 @@ diffParagraphs.forEach(paragraph => {
EOF
echo '</head>' >> CHANGES.html
echo '<body>' >> CHANGES.html
(cd $DOC_REPOSITORY && git diff $BASE_DOC_COMMIT -- *.html) > diff.txt
(cd $DOC_REPOSITORY && git diff $BASE_DOC_COMMIT -- "*.html") > diff.txt
python3 - << EOF
import os, re, html
with open('diff.txt', 'r') as f:
Expand Down
14 changes: 14 additions & 0 deletions .ci/docker-exec-script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh -x
if [ $# -lt 3 ]; then
echo >&2 "usage: docker-exec-script.sh CONTAINER WORKDIR [VAR=VALUE...] SCRIPT"
exit 1
fi
CONTAINER=$1
WORKDIR=$2
shift 2
(echo "cd \"$WORKDIR\"";
while [ $# -gt 1 ]; do
echo "export \"$1\""
shift
done;
cat "$1") | docker exec -i $CONTAINER bash -ex
16 changes: 10 additions & 6 deletions .ci/merge-fixes.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/sh
# Apply open PRs labeled "blocker" from sagemath/sage as patches.
# Apply open PRs labeled "p: CI Fix" from sagemath/sage as patches.
# (policy set by vote in 2024-03,
# https://groups.google.com/g/sage-devel/c/OKwwUGyKveo/m/vpyCXYBqAAAJ)
#
# This script is invoked by various workflows in .github/workflows
#
# The repository variable SAGE_CI_FIXES_FROM_REPOS can be set
Expand All @@ -20,15 +23,15 @@ for REPO in ${SAGE_CI_FIXES_FROM_REPOSITORIES:-sagemath/sage}; do
echo "Nothing to do for 'none' in SAGE_CI_FIXES_FROM_REPOSITORIES"
;;
*/*)
echo "Getting open PRs with 'blocker' status from https://github.com/$REPO/pulls?q=is%3Aopen+label%3A%22p%3A+blocker+%2F+1%22"
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"
GH="gh -R $REPO"
REPO_FILE="upstream/ci-fixes-${REPO%%/*}-${REPO##*/}"
PRs="$($GH pr list --label "p: blocker / 1" --json number --jq '.[].number' | tee $REPO_FILE)"
PRs="$($GH pr list --label "p: CI Fix" --json number --jq '.[].number' | tee $REPO_FILE)"
date -u +"%Y-%m-%dT%H:%M:%SZ" > $REPO_FILE.date # Record the date, for future reference
if [ -z "$PRs" ]; then
echo "Nothing to do: Found no open PRs with 'blocker' status in $REPO."
echo "Nothing to do: Found no open PRs with 'p: CI Fix' label in $REPO."
else
echo "Found open PRs with 'blocker' status in $REPO: $(echo $PRs)"
echo "Found open PRs with 'p: CI Fix' label in $REPO: $(echo $PRs)"
git tag -f test_base
git commit -q -m "Uncommitted changes" --no-allow-empty -a
for a in $PRs; do
Expand All @@ -42,6 +45,7 @@ for REPO in ${SAGE_CI_FIXES_FROM_REPOSITORIES:-sagemath/sage}; do
# Considered alternative: Use https://github.com/$REPO/pull/$a.diff,
# which squashes everything into one diff without commit metadata.
PULL_URL="https://github.com/$REPO/pull/$a"
PULL_SHORT="$REPO#$a"
PULL_FILE="$REPO_FILE-$a"
PATH=build/bin:$PATH build/bin/sage-download-file --quiet "$PULL_URL.patch" $PULL_FILE.patch
date -u +"%Y-%m-%dT%H:%M:%SZ" > $PULL_FILE.date # Record the date, for future reference
Expand All @@ -67,7 +71,7 @@ for REPO in ${SAGE_CI_FIXES_FROM_REPOSITORIES:-sagemath/sage}; do
git am --signoff --show-current-patch=diff
echo "--------------------------------------------------------------------8<-----------------------------"
echo "::endgroup::"
echo "Failure applying $PULL_URL as a patch, resetting"
echo "Failure applying $PULL_SHORT as a patch, resetting"
git am --signoff --abort
fi
done
Expand Down
101 changes: 76 additions & 25 deletions build/bin/write-dockerfile.sh → .ci/write-dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ for SPKG in $(sage-package list --has-file=spkg-configure.m4 $SAGE_PACKAGE_LIST_
CONFIGURE_ARGS+="--with-system-${SPKG}=${WITH_SYSTEM_SPKG} "
fi
done
echo "# Automatically generated by SAGE_ROOT/build/bin/write-dockerfile.sh"
echo "# Automatically generated by SAGE_ROOT/.ci/write-dockerfile.sh"
echo "# the :comments: separate the generated file into sections"
echo "# to simplify writing scripts that customize this file"
ADD="ADD $__CHOWN"
RUN=RUN
cat <<EOF
ARG BASE_IMAGE
ARG BASE_IMAGE=$(eval echo "${FULL_BASE_IMAGE_AND_TAG}")
FROM \${BASE_IMAGE} as with-system-packages
EOF
case $SYSTEM in
Expand All @@ -54,8 +54,21 @@ case $SYSTEM in
1|y*|Y*)
;;
*)
#
# The Ubuntu Docker images are "minimized", meaning that some large
# bits such as documentation has been removed. We have to unminimize
# once (which reinstalls the full versions of some minimized packages),
# or e.g. the maxima documentation (which we depend on for correct operation)
# will be missing.
#
# But we only have to do this once. To save time in incremental builds,
# we remove the unminimize binary here after it has done its job.
#
cat <<EOF
RUN (yes | unminimize) || echo "(ignored)"
RUN if command -v unminimize > /dev/null; then \
(yes | unminimize) || echo "(ignored)"; \
rm -f "$(command -v unminimize)"; \
fi
EOF
if [ -n "$DIST_UPGRADE" ]; then
cat <<EOF
Expand Down Expand Up @@ -143,7 +156,7 @@ EOF
;;
*)
cat <<EOF
ARG USE_CONDARC=condarc.yml
ARG USE_CONDARC=${USE_CONDARC-condarc.yml}
ADD *condarc*.yml /tmp/
RUN echo \${CONDARC}; cd /tmp && conda config --stdin < \${USE_CONDARC}
RUN conda update -n base conda
Expand Down Expand Up @@ -214,36 +227,65 @@ EOF
;;
esac
esac

case ${DOCKER_BUILDKIT-0} in
1)
# With buildkit we cannot retrieve failed builds.
# So we do not allow the main step of a build stage to fail.
# Instead we record the exit code in the file STATUS.
THEN_SAVE_STATUS='; echo $? > STATUS'
# ... and at the beginning of the next build stage,
# we check the status and exit with an error status.
CHECK_STATUS_THEN='STATUS=$(cat STATUS 2>/dev/null); case "$STATUS" in ""|0) ;; *) exit $STATUS;; esac; '
esac

cat <<EOF
FROM with-system-packages as bootstrapped
#:bootstrapping:
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
$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/
$ADD config/config.rpath /new/config/config.rpath
$ADD src/doc/bootstrap /new/src/doc/bootstrap
$ADD src/bin /new/src/bin
$ADD src/Pipfile.m4 src/pyproject.toml.m4 src/requirements.txt.m4 src/setup.cfg.m4 src/VERSION.txt /new/src/
$ADD m4 /new/m4
$ADD pkgs /new/pkgs
$ADD build /new/build
$ADD .ci /new/.ci
$ADD .upstream.d /new/.upstream.d
RUN if [ -d /sage ]; then \
echo "### Incremental build from \$(cat /sage/VERSION.txt)" && \
if command -v git; then \
(cd /new && \
echo /src >> .gitignore && \
./.ci/retrofit-worktree.sh worktree-image /sage); \
else \
for a in local logs; do \
if [ -d /sage/\$a ]; then mv /sage/\$a /new/; fi; \
done; \
rm -rf /sage; \
mv /new /sage; \
fi; \
else \
mv /new /sage; \
fi
WORKDIR /sage
$ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap bootstrap-conda configure.ac sage .homebrew-build-env tox.ini Pipfile.m4 ./
$ADD config/config.rpath config/config.rpath
$ADD src/doc/bootstrap src/doc/bootstrap
$ADD src/bin src/bin
$ADD src/Pipfile.m4 src/pyproject.toml.m4 src/requirements.txt.m4 src/setup.cfg.m4 src/VERSION.txt src/
$ADD m4 ./m4
$ADD pkgs pkgs
$ADD build ./build
$ADD .upstream.d ./.upstream.d
ARG BOOTSTRAP=./bootstrap
$RUN sh -x -c "\${BOOTSTRAP}" $ENDRUN
ARG BOOTSTRAP=${BOOTSTRAP-./bootstrap}
$RUN sh -x -c "\${BOOTSTRAP}" $ENDRUN $THEN_SAVE_STATUS
FROM bootstrapped as configured
#:configuring:
RUN mkdir -p logs/pkgs; rm -f config.log; ln -s logs/pkgs/config.log config.log
ARG EXTRA_CONFIGURE_ARGS=""
RUN $CHECK_STATUS_THEN mkdir -p logs/pkgs; rm -f config.log; ln -s logs/pkgs/config.log config.log
ARG EXTRA_CONFIGURE_ARGS="${CONFIGURE_ARGS}"
EOF
if [ ${WITH_SYSTEM_SPKG} = "force" ]; then
cat <<EOF
$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
$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
EOF
else
cat <<EOF
$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
$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
EOF
fi
cat <<EOF
Expand All @@ -256,7 +298,7 @@ ARG USE_MAKEFLAGS="-k V=0"
ENV SAGE_CHECK=warn
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst"
#:toolchain:
$RUN make \${USE_MAKEFLAGS} base-toolchain $ENDRUN
$RUN $CHECK_STATUS_THEN make \${USE_MAKEFLAGS} base-toolchain $ENDRUN $THEN_SAVE_STATUS
FROM with-base-toolchain as with-targets-pre
ARG NUMPROC=8
Expand All @@ -266,17 +308,26 @@ ENV SAGE_CHECK=warn
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst"
#:make:
ARG TARGETS_PRE="all-sage-local"
$RUN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS_PRE} $ENDRUN
$RUN $CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS_PRE} $ENDRUN $THEN_SAVE_STATUS
FROM with-targets-pre as with-targets
ARG NUMPROC=8
ENV MAKE="make -j\${NUMPROC}"
ARG USE_MAKEFLAGS="-k V=0"
ENV SAGE_CHECK=warn
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst"
$ADD src src
$ADD .gitignore /new/.gitignore
$ADD src /new/src
RUN if command -v git; then \
cd /new && rm -rf .git && \
./.ci/retrofit-worktree.sh worktree-pre /sage; \
else \
rm -rf /sage/src; \
mv /new/src /sage/src; \
fi
ARG TARGETS="build"
$RUN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS} $ENDRUN
$RUN $CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS} $ENDRUN $THEN_SAVE_STATUS
FROM with-targets as with-targets-optional
ARG NUMPROC=8
Expand All @@ -285,7 +336,7 @@ ARG USE_MAKEFLAGS="-k V=0"
ENV SAGE_CHECK=warn
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst"
ARG TARGETS_OPTIONAL="ptest"
$RUN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS_OPTIONAL} || echo "(error ignored)" $ENDRUN
$RUN $CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS_OPTIONAL} || echo "(error ignored)" $ENDRUN $THEN_SAVE_STATUS
#:end:
EOF
5 changes: 2 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@
"vscode": {
"extensions": [
"guyskk.language-cython",
"ms-python.isort",
"ms-toolsai.jupyter",
"ms-python.vscode-pylance",
"ms-python.pylint",
"ms-python.python",
"lextudio.restructuredtext",
"trond-snekvik.simple-rst"
"trond-snekvik.simple-rst",
"charliermarsh.ruff"
]
}
}
Expand Down
2 changes: 0 additions & 2 deletions .devcontainer/onCreate-conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ conda init bash

# Build sage
conda run -n sage-dev ./bootstrap
conda run -n sage-dev ./configure --with-python=/opt/conda/envs/sage-dev/bin/python --prefix=/opt/conda/envs/sage-dev
conda run -n sage-dev pip install --no-build-isolation -v -v -e ./pkgs/sage-conf ./pkgs/sage-setup
conda run -n sage-dev pip install --no-build-isolation -v -v -e ./src
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
// from .devcontainer/portability-devcontainer.json.in
// See https://aka.ms/devcontainer.json for format details.
{
"name": "ubuntu-trusty-toolchain-gcc_9-minimal (≥ 8-core)",
"name": "fedora-40-minimal (≥ 8-core)",
"build": {
"dockerfile": "portability-Dockerfile",
// See tox.ini for definitions
"args": {
"SYSTEM_FACTOR": "ubuntu-trusty-toolchain-gcc_9",
"SYSTEM_FACTOR": "fedora-40",
"PACKAGE_FACTOR": "minimal",
"DOCKER_TARGET": "with-targets",
"DOCKER_TAG": "dev"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
// from .devcontainer/portability-devcontainer.json.in
// See https://aka.ms/devcontainer.json for format details.
{
"name": "ubuntu-trusty-toolchain-gcc_9-standard (≥ 8-core)",
"name": "fedora-40-standard (≥ 8-core)",
"build": {
"dockerfile": "portability-Dockerfile",
// See tox.ini for definitions
"args": {
"SYSTEM_FACTOR": "ubuntu-trusty-toolchain-gcc_9",
"SYSTEM_FACTOR": "fedora-40",
"PACKAGE_FACTOR": "standard",
"DOCKER_TARGET": "with-targets",
"DOCKER_TAG": "dev"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
// from .devcontainer/portability-devcontainer.json.in
// See https://aka.ms/devcontainer.json for format details.
{
"name": "opensuse-15.3-gcc_11-python3.9-minimal (≥ 8-core)",
"name": "gentoo-python3.12-minimal (≥ 8-core)",
"build": {
"dockerfile": "portability-Dockerfile",
// See tox.ini for definitions
"args": {
"SYSTEM_FACTOR": "opensuse-15.3-gcc_11-python3.9",
"SYSTEM_FACTOR": "gentoo-python3.12",
"PACKAGE_FACTOR": "minimal",
"DOCKER_TARGET": "with-targets",
"DOCKER_TAG": "dev"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
// from .devcontainer/portability-devcontainer.json.in
// See https://aka.ms/devcontainer.json for format details.
{
"name": "opensuse-15.3-gcc_11-python3.9-standard (≥ 8-core)",
"name": "gentoo-python3.12-standard (≥ 8-core)",
"build": {
"dockerfile": "portability-Dockerfile",
// See tox.ini for definitions
"args": {
"SYSTEM_FACTOR": "opensuse-15.3-gcc_11-python3.9",
"SYSTEM_FACTOR": "gentoo-python3.12",
"PACKAGE_FACTOR": "standard",
"DOCKER_TARGET": "with-targets",
"DOCKER_TAG": "dev"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
// from .devcontainer/portability-devcontainer.json.in
// See https://aka.ms/devcontainer.json for format details.
{
"name": "opensuse-15.4-gcc_11-python3.10-minimal (≥ 8-core)",
"name": "linuxmint-21.3-minimal (≥ 8-core)",
"build": {
"dockerfile": "portability-Dockerfile",
// See tox.ini for definitions
"args": {
"SYSTEM_FACTOR": "opensuse-15.4-gcc_11-python3.10",
"SYSTEM_FACTOR": "linuxmint-21.3",
"PACKAGE_FACTOR": "minimal",
"DOCKER_TARGET": "with-targets",
"DOCKER_TAG": "dev"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
// from .devcontainer/portability-devcontainer.json.in
// See https://aka.ms/devcontainer.json for format details.
{
"name": "opensuse-15.4-gcc_11-python3.10-standard (≥ 8-core)",
"name": "linuxmint-21.3-standard (≥ 8-core)",
"build": {
"dockerfile": "portability-Dockerfile",
// See tox.ini for definitions
"args": {
"SYSTEM_FACTOR": "opensuse-15.4-gcc_11-python3.10",
"SYSTEM_FACTOR": "linuxmint-21.3",
"PACKAGE_FACTOR": "standard",
"DOCKER_TARGET": "with-targets",
"DOCKER_TAG": "dev"
Expand Down
25 changes: 25 additions & 0 deletions .devcontainer/portability-ubuntu-noble-minimal/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// The command "tox -e update_docker_platforms"
// creates .devcontainer/portability-*-*/devcontainer.json
// from .devcontainer/portability-devcontainer.json.in
// See https://aka.ms/devcontainer.json for format details.
{
"name": "ubuntu-noble-minimal (≥ 8-core)",
"build": {
"dockerfile": "portability-Dockerfile",
// See tox.ini for definitions
"args": {
"SYSTEM_FACTOR": "ubuntu-noble",
"PACKAGE_FACTOR": "minimal",
"DOCKER_TARGET": "with-targets",
"DOCKER_TAG": "dev"
}
},
"containerEnv": {
"MAKE": "make -j4"
},
"onCreateCommand": ".devcontainer/onCreate.sh",
"updateContentCommand": ".devcontainer/portability-updateContent.sh",
"extensions": [
"ms-python.python"
]
}
Loading

0 comments on commit 051126d

Please sign in to comment.