Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into binary_wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Oct 19, 2024
2 parents 43c3caf + 7726cd9 commit 621a6d5
Show file tree
Hide file tree
Showing 655 changed files with 11,752 additions and 6,419 deletions.
2 changes: 1 addition & 1 deletion .ci/retrofit-worktree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ git worktree add --detach $WORKTREE_NAME
rm -rf $WORKTREE_DIRECTORY/.git && mv $WORKTREE_NAME/.git $WORKTREE_DIRECTORY/
rm -rf $WORKTREE_NAME && ln -s $WORKTREE_DIRECTORY $WORKTREE_NAME
if [ ! -f $WORKTREE_NAME/.gitignore ]; then cp .gitignore $WORKTREE_NAME/; fi
(cd $WORKTREE_NAME && git add -A && git commit --quiet --allow-empty -m "old" -a && git tag -f old && git checkout new && git status)
(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)
86 changes: 44 additions & 42 deletions .ci/write-dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ STRIP_COMMENTS="sed s/#.*//;"
SAGE_ROOT=.
export PATH="$SAGE_ROOT"/build/bin:$PATH
SYSTEM_PACKAGES=$EXTRA_SYSTEM_PACKAGES
SYSTEM_CONFIGURE_ARGS="--enable-option-checking "
SYSTEM_CONFIGURE_ARGS=" --enable-option-checking"
for SPKG in $(sage-package list --has-file=spkg-configure.m4 $SAGE_PACKAGE_LIST_ARGS) $EXTRA_SAGE_PACKAGES; do
SYSTEM_PACKAGE=$(sage-get-system-packages $SYSTEM $SPKG)
if [ -n "${SYSTEM_PACKAGE}" ]; then
Expand All @@ -45,13 +45,20 @@ for SPKG in $(sage-package list --has-file=spkg-configure.m4 $SAGE_PACKAGE_LIST_
# shell-quote package if necessary
SYSTEM_PACKAGES+=$(printf " %q" "$a")
done
SYSTEM_CONFIGURE_ARGS+="--with-system-${SPKG}=${WITH_SYSTEM_SPKG} "
# Check if SPKG is not a dummy package
if [[ $SPKG != _* ]]; then
SYSTEM_CONFIGURE_ARGS+=" --with-system-${SPKG}=${WITH_SYSTEM_SPKG}"
fi
fi
done
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"
if [ -z "$__CHOWN" ]; then
ADD="ADD"
else
ADD="ADD $__CHOWN"
fi
RUN=RUN
cat <<EOF
ARG BASE_IMAGE=$(eval echo "${FULL_BASE_IMAGE_AND_TAG}")
Expand Down Expand Up @@ -86,10 +93,7 @@ case $SYSTEM in
# we remove the unminimize binary here after it has done its job.
#
cat <<EOF
RUN if command -v unminimize > /dev/null; then \
(yes | unminimize) || echo "(ignored)"; \
rm -f "\$(command -v unminimize)"; \
fi
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 @@ -254,10 +258,10 @@ case ${DOCKER_BUILDKIT-0} in
# 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'
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; '
CHECK_STATUS_THEN=' STATUS=$(cat STATUS 2>/dev/null); case "$STATUS" in ""|0) ;; *) exit $STATUS;; esac;'
esac

if [ -n "$GITHUB_ACTIONS" ]; then
Expand All @@ -281,38 +285,37 @@ $ADD pkgs /new/pkgs
$ADD build /new/build
$ADD .upstream.d /new/.upstream.d
ADD .ci /.ci
RUN if [ -d /sage ]; then \
echo "### Incremental build from \$(cat /sage/VERSION.txt)" && \
printf '/src/*\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /sage/.gitignore && \
printf '/src/*\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /new/.gitignore && \
if ! (cd /new && /.ci/retrofit-worktree.sh worktree-image /sage); then \
echo "retrofit-worktree.sh failed, falling back to replacing /sage"; \
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; \
RUN if [ -d /sage ]; then \\
echo "### Incremental build from \$(cat /sage/VERSION.txt)" && \\
printf '/src/*\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /sage/.gitignore && \\
printf '/src/*\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /new/.gitignore && \\
if ! (cd /new && /.ci/retrofit-worktree.sh worktree-image /sage); then \\
echo "retrofit-worktree.sh failed, falling back to replacing /sage"; \\
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
ARG BOOTSTRAP="${BOOTSTRAP-./bootstrap}"
$RUN sh -x -c "\${BOOTSTRAP}" $ENDRUN $THEN_SAVE_STATUS
$RUN sh -x -c "\${BOOTSTRAP}"$ENDRUN$THEN_SAVE_STATUS
FROM bootstrapped AS configured
#:configuring:
RUN $CHECK_STATUS_THEN mkdir -p logs/pkgs; rm -f config.log; ln -s logs/pkgs/config.log config.log
RUN$CHECK_STATUS_THEN mkdir -p logs/pkgs; rm -f config.log; ln -s logs/pkgs/config.log config.log
ARG CONFIGURE_ARGS="${CONFIGURE_ARGS:---enable-build-as-root}"
EOF
if [ ${WITH_SYSTEM_SPKG} = "force" ]; then
cat <<EOF
$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
$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
EOF
else
cat <<EOF
$RUN ./configure $SYSTEM_CONFIGURE_ARGS \${CONFIGURE_ARGS} || (echo "::group::config.log"; cat config.log; echo "::endgroup::"; exit 1) $ENDRUN $THEN_SAVE_STATUS
$RUN ./configure $SYSTEM_CONFIGURE_ARGS \${CONFIGURE_ARGS} || (echo "::group::config.log"; cat config.log; echo "::endgroup::"; exit 1)$ENDRUN$THEN_SAVE_STATUS
EOF
fi
cat <<EOF
Expand All @@ -325,7 +328,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 $CHECK_STATUS_THEN make \${USE_MAKEFLAGS} base-toolchain $ENDRUN $THEN_SAVE_STATUS
$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 @@ -335,7 +338,7 @@ 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 $CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS_PRE} $ENDRUN $THEN_SAVE_STATUS
$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
Expand All @@ -345,19 +348,18 @@ ENV SAGE_CHECK=warn
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst"
$ADD .gitignore /new/.gitignore
$ADD src /new/src
RUN cd /new && rm -rf .git && \
if /.ci/retrofit-worktree.sh worktree-pre /sage; then \
cd /sage && touch configure build/make/Makefile; \
else \
echo "retrofit-worktree.sh failed, falling back to replacing /sage/src"; \
rm -rf /sage/src; \
mv src /sage/src; \
cd /sage && ./bootstrap && ./config.status; \
fi; \
RUN cd /new && rm -rf .git && \\
if /.ci/retrofit-worktree.sh worktree-pre /sage; then \\
cd /sage && touch configure build/make/Makefile; \\
else \\
echo "retrofit-worktree.sh failed, falling back to replacing /sage/src"; \\
rm -rf /sage/src; \\
mv src /sage/src; \\
cd /sage && ./bootstrap && ./config.status; \\
fi; \\
cd /sage && rm -rf .git; rm -rf /new || echo "(error ignored)"
ARG TARGETS="build"
$RUN $CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS} $ENDRUN $THEN_SAVE_STATUS
$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 @@ -366,7 +368,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 $CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS_OPTIONAL} || echo "(error ignored)" $ENDRUN $THEN_SAVE_STATUS
$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 .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ body:
- **OS**: Ubuntu 20.04
- Sage Version: 9.2
value: |
- **OS**:
- **Sage Version**:
render: markdown
- **OS**:
- **Sage Version**:
validations:
required: true
- type: checkboxes
Expand Down
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/failure_building_from_source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ body:
- **OS**: Ubuntu 20.04
- Sage Version: 9.2
value: |
- **OS**:
- **OS**:
- **Sage Version**:
render: markdown
validations:
required: true
- type: textarea
Expand Down
4 changes: 2 additions & 2 deletions .github/sync_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ def actor_valid(self):
for com in coms:
for auth in com['authors']:
login = auth['login']
if not login in authors:
if login not in authors:
if not self.is_this_bot(login) and login != author:
debug('PR %s has recent commit by %s' % (self._issue, login))
authors.append(login)
Expand Down Expand Up @@ -746,7 +746,7 @@ def add_label(self, label):
r"""
Add the given label to the issue or PR.
"""
if not label in self.get_labels():
if label not in self.get_labels():
self.edit(label, '--add-label')
info('Add label to %s: %s' % (self._issue, label))

Expand Down
47 changes: 42 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ jobs:
remove-haskell: true
remove-codeql: true
remove-docker-images: true

- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Get changed files and packages
id: changed-files
uses: tj-actions/changed-files@v45
Expand All @@ -110,26 +112,47 @@ jobs:
- 'build/pkgs/*/spkg-configure.m4'
pkgs:
- 'build/pkgs/**'
- '!build/pkgs/_**'
- '!build/pkgs/configure/**'
- 'pkgs/**'
doctests:
- 'src/**/*.{py,pyx,pxd,pxi,sage,spyx,rst,tex}'
- '!src/{setup,conftest*}.py'
- name: Determine targets to build
id: build-targets
run: |
uninstall_targets=$(echo $(for a in '' ${{ steps.changed-files.outputs.configures_all_changed_files }}; do echo $a | sed -E 's,build/pkgs/([a-z0-9][_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'; done | sort -u))
build_targets=$(echo $(for a in '' ${{ steps.changed-files.outputs.pkgs_all_changed_files }}; do SPKG=$(echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([a-z0-9][-_.a-z0-9]*)/[^ ]* *,\2,;'); if [ -f "build/pkgs/$SPKG/checksums.ini" -o -f "build/pkgs/$SPKG/requirements.txt" -o -f "build/pkgs/$SPKG/spkg-install" ]; then echo "$SPKG-ensure"; fi; done | sort -u))
uninstall_targets=$(echo $(
for a in '' ${{ steps.changed-files.outputs.configures_all_changed_files }}; do
# Extract package name from the file path and append '-uninstall'
echo $a | sed -E 's,build/pkgs/([a-z0-9][_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'
done | sort -u # Sort and ensure uniqueness
))
build_targets=$(echo $(
for a in '' ${{ steps.changed-files.outputs.pkgs_all_changed_files }}; do
# Extract package name, replace '-' with '_', and strip extra parts from the path
SPKG=$(echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([a-z0-9][-_.a-z0-9]*)/[^ ]* *,\2,;')
# Check if key files exist in the package directory
if [ -f "build/pkgs/$SPKG/checksums.ini" ] || \
[ -f "build/pkgs/$SPKG/requirements.txt" ] || \
[ -f "build/pkgs/$SPKG/spkg-install" ]; then
echo "$SPKG-ensure" # add the "$SPKG-ensure" target
fi
done | sort -u # Sort and ensure uniqueness
))
if [ -n "$uninstall_targets" ]; then
echo "build_targets=$uninstall_targets reconfigure $build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT
echo "build_targets=$uninstall_targets reconfigure $build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT
else
echo "build_targets=$build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT
echo "build_targets=$build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT
fi
cat $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
path: worktree-base
if: github.base_ref && steps.changed-files.outputs.pkgs_all_changed_files

- name: Compute metrics
run: |
export PATH=build/bin:$PATH
Expand All @@ -140,13 +163,15 @@ jobs:
else
sage-package metrics :all:
fi
- name: Install test prerequisites
# From docker.yml
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install tox
sudo apt-get clean
df -h
- name: Merge CI fixes from sagemath/sage
# From docker.yml
# This step needs to happen after the commit sha is put in DOCKER_TAG
Expand Down Expand Up @@ -254,16 +279,19 @@ jobs:
remove-haskell: true
remove-codeql: true
remove-docker-images: true

- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Install test prerequisites
# From docker.yml
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install tox
sudo apt-get clean
df -h
- name: Merge CI fixes from sagemath/sage
# From docker.yml
# This step needs to happen after the commit sha is put in DOCKER_TAG
Expand Down Expand Up @@ -352,16 +380,19 @@ jobs:
remove-haskell: true
remove-codeql: true
remove-docker-images: true

- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Install test prerequisites
# From docker.yml
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install tox
sudo apt-get clean
df -h
- name: Merge CI fixes from sagemath/sage
# From docker.yml
# This step needs to happen after the commit sha is put in DOCKER_TAG
Expand Down Expand Up @@ -442,8 +473,11 @@ jobs:
if: (success() || failure()) && steps.container.outcome == 'success'
uses: actions/upload-artifact@v4
with:
# The path .coverage is a directory that contains the combined coverage
# data file .coverage, which is a hidden file because of the leading dot
name: coverage-${{ steps.copy-coverage.outputs.tests_id }}
path: .coverage
include-hidden-files: true

coverage-report:
runs-on: ubuntu-latest
Expand All @@ -466,16 +500,19 @@ jobs:
remove-haskell: true
remove-codeql: true
remove-docker-images: true

- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Install test prerequisites
# From docker.yml
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install tox
sudo apt-get clean
df -h
- name: Merge CI fixes from sagemath/sage
# From docker.yml
# This step needs to happen after the commit sha is put in DOCKER_TAG
Expand Down Expand Up @@ -530,11 +567,11 @@ jobs:
# Combining

- name: Download coverage artifacts
if: (success() || failure()) && steps.container.outcome == 'success'
uses: actions/download-artifact@v4
with:
path: .coverage
pattern: coverage-*
if: (success() || failure()) && steps.container.outcome == 'success'

- name: Coverage report
if: (success() || failure()) && steps.container.outcome == 'success'
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ jobs:
(cd doc && mv .git ../git && mv .gitattributes ../gitattributes)
mv CHANGES.html doc
fi
# Create the robots.txt file to discourage web crawlers from indexing doc preview webpages
echo "User-agent: *" > doc/robots.txt
echo "Disallow: /" >> doc/robots.txt
# Zip everything for increased performance
zip -r doc.zip doc
Expand Down
Loading

0 comments on commit 621a6d5

Please sign in to comment.