diff --git a/.ci/retrofit-worktree.sh b/.ci/retrofit-worktree.sh index eba1b674ecb..4c283f7ff4a 100755 --- a/.ci/retrofit-worktree.sh +++ b/.ci/retrofit-worktree.sh @@ -23,9 +23,10 @@ set -x # If actions/checkout downloaded our source tree using the GitHub REST API # instead of with git (because do not have git installed in our image), # we first make the source tree a repo. -if [ ! -d .git ]; then git init && git add -A && git commit --quiet -m "new"; fi +if [ ! -d .git ]; then git init; fi -# Tag this state of the source tree "new". This is what we want to build and test. +# Commit and tag this state of the source tree "new". This is what we want to build and test. +git add -A && git commit --quiet --allow-empty -m "new" git tag -f new # Our container image contains a source tree in $WORKTREE_DIRECTORY with a full build of Sage. diff --git a/.ci/write-dockerfile.sh b/.ci/write-dockerfile.sh index 67ef594729c..3a4ae5b152d 100755 --- a/.ci/write-dockerfile.sh +++ b/.ci/write-dockerfile.sh @@ -264,6 +264,7 @@ cat <> $GITHUB_OUTPUT + else + 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 + if [ -d worktree-base ]; then + (echo "# $GITHUB_BASE_REF"; SAGE_ROOT=worktree-base sage-package metrics :all:) > base-metrics.txt + (echo "# $GITHUB_REF"; sage-package metrics :all:) > metrics.txt + diff --color=always --width=100 --side-by-side --left-column base-metrics.txt metrics.txt || true + else + sage-package metrics :all: + fi - name: Install test prerequisites # From docker.yml run: | @@ -142,7 +184,7 @@ jobs: # more reliable than "load", for which we observed random failure # conditions in which the built image could not be found. # - push: true + push: ${{ steps.changed-files.outputs.doctests_all_changed_files && true || false }} load: false context: . tags: ${{ env.BUILD_IMAGE }} @@ -153,9 +195,12 @@ jobs: NUMPROC=6 USE_MAKEFLAGS=-k V=0 SAGE_NUM_THREADS=4 --output-sync=recurse TARGETS_PRE=build/make/Makefile - TARGETS=ci-build-with-fallback + TARGETS=${{ steps.build-targets.outputs.build_targets }} - name: Start container + id: container + # Try to continue when "exporting to GitHub Actions Cache" failed with timeout + if: (success() || failure()) && steps.changed-files.outputs.doctests_all_changed_files run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -165,6 +210,7 @@ jobs: # Testing - name: Check that all modules can be imported + if: (success() || failure()) && steps.container.outcome == 'success' && steps.changed-files.outputs.doctests_all_changed_files run: | # Increase the length of the lines in the "short summary" export COLUMNS=120 @@ -175,20 +221,12 @@ jobs: ./sage -python -m pytest -c tox.ini -qq --doctest --collect-only || true shell: sh .ci/docker-exec-script.sh BUILD /sage {0} - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v44 - with: - # File extensions per sage.doctest.control.skipfile - files: src/**/*.{py,pyx,pxd,pxi,sage,spyx,rst,tex} - files_ignore: src/{setup,conftest*}.py - - name: Test changed files (sage -t --new) - if: steps.changed-files.outputs.all_changed_files + if: (success() || failure()) && steps.container.outcome == 'success' && steps.changed-files.outputs.doctests_all_changed_files run: | export MAKE="make -j2 --output-sync=recurse" SAGE_NUM_THREADS=4 # https://github.com/tj-actions/changed-files?tab=readme-ov-file#outputs- - ./sage -t --long --format github -p4 ${{ steps.changed-files.outputs.all_changed_files }} + ./sage -t --long --format github -p4 ${{ steps.changed-files.outputs.doctests_all_changed_files }} shell: sh .ci/docker-exec-script.sh BUILD /sage {0} test-mod: @@ -266,9 +304,11 @@ jobs: NUMPROC=6 USE_MAKEFLAGS=-k V=0 SAGE_NUM_THREADS=4 --output-sync=recurse TARGETS_PRE=build/make/Makefile - TARGETS=ci-build-with-fallback + TARGETS=${{ needs.test-new.outputs.build_targets }} - name: Start container + id: container + if: (success() || failure()) run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -278,6 +318,7 @@ jobs: # Testing - name: Test modularized distributions + if: (success() || failure()) && steps.container.outcome == 'success' run: | export MAKE="make -j2 --output-sync=recurse" SAGE_NUM_THREADS=4 make V=0 tox-ensure && make ${{ matrix.targets }} @@ -361,10 +402,11 @@ jobs: NUMPROC=6 USE_MAKEFLAGS=-k V=0 SAGE_NUM_THREADS=4 --output-sync=recurse TARGETS_PRE=build/make/Makefile - TARGETS=ci-build-with-fallback + TARGETS=${{ needs.test-new.outputs.build_targets }} - name: Start container id: container + if: (success() || failure()) run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -374,6 +416,7 @@ jobs: # Testing - name: Test all files (sage -t --long ${{ matrix.tests }}) + if: (success() || failure()) && steps.container.outcome == 'success' run: | mkdir .coverage rm -rf /sage/.coverage @@ -473,10 +516,11 @@ jobs: NUMPROC=6 USE_MAKEFLAGS=-k V=0 SAGE_NUM_THREADS=4 --output-sync=recurse TARGETS_PRE=build/make/Makefile - TARGETS=ci-build-with-fallback + TARGETS=${{ needs.test-new.outputs.build_targets }} - name: Start container id: container + if: (success() || failure()) run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -490,8 +534,10 @@ jobs: with: path: .coverage pattern: coverage-* + if: (success() || failure()) && steps.container.outcome == 'success' - name: Coverage report + if: (success() || failure()) && steps.container.outcome == 'success' # Using --omit to avoid "CoverageWarning: Couldn't parse '/tmp/tmp06qizzie/tmp_ldpu46ob.py': No source for code" run: | rm -rf /sage/.coverage @@ -505,6 +551,7 @@ jobs: shell: sh .ci/docker-exec-script.sh BUILD . {0} - name: Upload coverage to codecov + if: (success() || failure()) && steps.container.outcome == 'success' uses: codecov/codecov-action@v4 with: directory: .coverage/coverage-report diff --git a/.github/workflows/ci-linux-incremental.yml b/.github/workflows/ci-linux-incremental.yml index 88a31a5ce42..ce468ff3a42 100644 --- a/.github/workflows/ci-linux-incremental.yml +++ b/.github/workflows/ci-linux-incremental.yml @@ -41,12 +41,11 @@ jobs: runs-on: ubuntu-latest name: List changed packages outputs: - uninstall_targets: ${{ steps.build-targets.outputs.uninstall_targets }} build_targets: ${{ steps.build-targets.outputs.build_targets }} steps: - uses: actions/checkout@v4 - name: Get all packages that have changed - id: changed-packages + id: changed-files uses: tj-actions/changed-files@v44 with: files_yaml: | @@ -58,14 +57,19 @@ jobs: - name: Determine targets to build id: build-targets run: | - echo "uninstall_targets=$(echo $(for a in '' ${{ steps.changed-packages.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))" >> $GITHUB_OUTPUT - echo "build_targets=$(echo $(for a in '' ${{ steps.changed-packages.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))" >> $GITHUB_OUTPUT + 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)) + if [ -n "$uninstall_targets" ]; then + 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 + fi cat $GITHUB_OUTPUT - uses: actions/checkout@v4 with: ref: ${{ github.base_ref }} path: worktree-base - if: github.base_ref + if: github.base_ref && steps.changed-files.outputs.pkgs_all_changed_files - name: Compute metrics run: | export PATH=build/bin:$PATH @@ -88,15 +92,14 @@ jobs: from_docker_target: "with-targets" from_docker_tag: "dev" docker_targets: "with-targets" - targets: "${{needs.changed_files.outputs.uninstall_targets}} reconfigure ${{needs.changed_files.outputs.build_targets}} build doc-html ptest" + targets: "${{needs.changed_files.outputs.build_targets}} doc-html ptest-nodoc" tox_system_factors: >- ["ubuntu-focal", - "ubuntu-jammy", - "ubuntu-mantic", + "ubuntu-noble", "debian-bullseye", "debian-bookworm", "fedora-30", - "fedora-38", + "fedora-40", "gentoo-python3.11", "debian-bullseye-i386"] tox_packages_factors: >- @@ -107,14 +110,6 @@ jobs: site: needs: [changed_files] - if: | - github.event_name != 'pull_request' || - ((github.event.action != 'labeled' && - (contains(github.event.pull_request.labels.*.name, 'c: packages: standard') || - contains(github.event.pull_request.labels.*.name, 'c: packages: optional'))) || - (github.event.action == 'labeled' && - (github.event.label.name == 'c: packages: optional' || - github.event.label.name == 'c: packages: standard'))) uses: ./.github/workflows/docker.yml with: # Build incrementally from published Docker image @@ -124,7 +119,7 @@ jobs: from_docker_target: "with-targets" from_docker_tag: "dev" docker_targets: "with-targets" - targets: "${{needs.changed_files.outputs.uninstall_targets}} reconfigure ${{needs.changed_files.outputs.build_targets}} build doc-html ptest" + targets: "${{needs.changed_files.outputs.build_targets}} doc-html ptest-nodoc" # Only test systems with a usable system python (>= 3.9) # with only a small number of test failures as of 10.2.rc0 tox_system_factors: >- diff --git a/.github/workflows/doc-build-pdf.yml b/.github/workflows/doc-build-pdf.yml index d4cc6ebc6ca..2eac8e17ffc 100644 --- a/.github/workflows/doc-build-pdf.yml +++ b/.github/workflows/doc-build-pdf.yml @@ -101,6 +101,9 @@ jobs: TARGETS=ci-build-with-fallback - name: Start container + id: container + # Try to continue when "exporting to GitHub Actions Cache" failed with timeout + if: (success() || failure()) run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -110,6 +113,8 @@ jobs: # Docs - name: Update system packages + id: packages + if: (success() || failure()) && steps.container.outcome == 'success' run: | export PATH="build/bin:$PATH" eval $(sage-print-system-package-command auto update) @@ -119,6 +124,7 @@ jobs: - name: Build docs (PDF) id: docbuild + if: (success() || failure()) && steps.packages.outcome == 'success' run: | export MAKE="make -j5 --output-sync=recurse" SAGE_NUM_THREADS=5 make doc-clean doc-uninstall; make sagemath_doc_html-build-deps sagemath_doc_pdf-no-deps diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 4d0420874b8..f47dac38d57 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -105,6 +105,9 @@ jobs: TARGETS=ci-build-with-fallback - name: Start container + id: container + # Try to continue when "exporting to GitHub Actions Cache" failed with timeout + if: (success() || failure()) run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -115,6 +118,7 @@ jobs: - name: Store old docs id: worktree + if: (success() || failure()) && steps.container.outcome == 'success' run: | git config --global --add safe.directory $(pwd) git config --global user.email "ci-sage@example.com" @@ -140,6 +144,7 @@ jobs: - name: Build docs id: docbuild + if: (success() || failure()) && steps.worktree.outcome == 'success' # Always non-incremental because of the concern that # incremental docbuild may introduce broken links (inter-file references) though build succeeds run: | diff --git a/build/bin/sage-dist-helpers b/build/bin/sage-dist-helpers index d7ef0a81a8b..d55ac539837 100644 --- a/build/bin/sage-dist-helpers +++ b/build/bin/sage-dist-helpers @@ -247,9 +247,10 @@ sdh_pip_install() { install_options="$install_options $1" ;; -C|--config-settings) - build_options="$build_options --config-setting" shift - build_options="$build_options $1" + # Per 'python -m build --help', options which begin with a hyphen + # must be in the form of "--config-setting=--opt(=value)" or "-C--opt(=value)" + build_options="$build_options --config-setting=$1" ;; *) break diff --git a/build/pkgs/cmake/spkg-configure.m4 b/build/pkgs/cmake/spkg-configure.m4 index 4210442c44c..6149f49a7c5 100644 --- a/build/pkgs/cmake/spkg-configure.m4 +++ b/build/pkgs/cmake/spkg-configure.m4 @@ -1,5 +1,5 @@ SAGE_SPKG_CONFIGURE([cmake], [dnl - AC_CACHE_CHECK([for cmake >= 3.11], [ac_cv_path_CMAKE], [dnl + AC_CACHE_CHECK([for cmake >= 3.18], [ac_cv_path_CMAKE], [dnl dnl Do not accept cmake installed via https://pypi.org/project/cmake/ dnl in the default user scheme; it will not work in our venv because dnl we set PYTHONUSERBASE in sage-env. @@ -8,7 +8,7 @@ SAGE_SPKG_CONFIGURE([cmake], [dnl cmake_version=`$ac_path_CMAKE --version 2>&1 \ | $SED -n -e 's/cmake version *\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)/\1/p'` AS_IF([test -n "$cmake_version"], [dnl - AX_COMPARE_VERSION([$cmake_version], [ge], [3.11], [dnl + AX_COMPARE_VERSION([$cmake_version], [ge], [3.18], [dnl ac_cv_path_CMAKE="$ac_path_CMAKE" ac_path_CMAKE_found=: ]) diff --git a/build/pkgs/igraph/checksums.ini b/build/pkgs/igraph/checksums.ini index 6d63bbce214..62eafa1aec9 100644 --- a/build/pkgs/igraph/checksums.ini +++ b/build/pkgs/igraph/checksums.ini @@ -1,4 +1,4 @@ tarball=igraph-VERSION.tar.gz -sha1=40efbd2adf3c1cc0a2bb3e14f4c7898d053f1fe4 -sha256=ac5fa94ae6fd1eace651e4b235e99c056479a5c5d0d641aed30240ac33b19403 +sha1=3789f61beac1f1231f8c3832102dcb2720f2a0c9 +sha256=b011f7f9f38a3e59924cc9ff652e6d33105fa03fcaf3792f47d752626a0a4625 upstream_url=https://github.com/igraph/igraph/releases/download/VERSION/igraph-VERSION.tar.gz diff --git a/build/pkgs/igraph/package-version.txt b/build/pkgs/igraph/package-version.txt index 1a46c7f13e7..70016a7c6ad 100644 --- a/build/pkgs/igraph/package-version.txt +++ b/build/pkgs/igraph/package-version.txt @@ -1 +1 @@ -0.10.8 +0.10.12 diff --git a/build/pkgs/igraph/spkg-check.in b/build/pkgs/igraph/spkg-check.in index 27cd9419538..29b0a04f2cc 100644 --- a/build/pkgs/igraph/spkg-check.in +++ b/build/pkgs/igraph/spkg-check.in @@ -1,2 +1,3 @@ cd src -$MAKE check +cd build +sdh_make_check diff --git a/build/pkgs/igraph/spkg-configure.m4 b/build/pkgs/igraph/spkg-configure.m4 index 5133fce98da..0072f6ea6bc 100644 --- a/build/pkgs/igraph/spkg-configure.m4 +++ b/build/pkgs/igraph/spkg-configure.m4 @@ -3,7 +3,7 @@ SAGE_SPKG_CONFIGURE([igraph], [ dnl check for igraph with pkg-config dnl Per upstream in https://github.com/sagemath/sage/pull/36750#issuecomment-1826998762: dnl each python-igraph release is only guaranteed to be compatible with the same C/igraph that it bundles - PKG_CHECK_MODULES([IGRAPH], [igraph >= 0.10.8 igraph < 0.10.9], [], [ + PKG_CHECK_MODULES([IGRAPH], [igraph >= 0.10.12 igraph < 0.10.13], [], [ sage_spkg_install_igraph=yes]) ]) ]) diff --git a/build/pkgs/python_igraph/checksums.ini b/build/pkgs/python_igraph/checksums.ini index ecdc7ea2dfe..d7247b21a30 100644 --- a/build/pkgs/python_igraph/checksums.ini +++ b/build/pkgs/python_igraph/checksums.ini @@ -1,4 +1,4 @@ tarball=python-igraph-VERSION.tar.gz -sha1=ef7ee85cb1bc83109c744d5dd6bbe5e37598ce3f -sha256=e55df60f882a51b8e8c1c5e7e940c5f90685d75634ea6df63bebcc983397adfa +sha1=da963213ab22c60938d4e77ffab811875ee43a8a +sha256=2d71d645a4c3344c5910543fabbae10d3163f46a3e824ba7753c14b9036b8233 upstream_url=https://pypi.io/packages/source/i/igraph/igraph-VERSION.tar.gz diff --git a/build/pkgs/python_igraph/package-version.txt b/build/pkgs/python_igraph/package-version.txt index 1a96df19c09..62d5dbdf3c7 100644 --- a/build/pkgs/python_igraph/package-version.txt +++ b/build/pkgs/python_igraph/package-version.txt @@ -1 +1 @@ -0.11.3 +0.11.5 diff --git a/build/pkgs/python_igraph/spkg-install.in b/build/pkgs/python_igraph/spkg-install.in index bafbbda375e..07408c34b0d 100644 --- a/build/pkgs/python_igraph/spkg-install.in +++ b/build/pkgs/python_igraph/spkg-install.in @@ -1,10 +1,2 @@ cd src -# Use --use-pep517 because https://github.com/igraph/python-igraph as of 0.9.11 does not have pyproject.toml -# and so "pip wheel" would use a legacy build method, ignoring --config-settings. -# -# TODO: With setuptools 63.2.0, passing another --config-settings "--global-option=--no-wait" (not really needed) -# kills the "--global-option=--use-pkg-config". -# https://github.com/pypa/setuptools/issues/3380 makes changes to this, so we can revisit this after -# the next setuptools upgrade. -# -sdh_pip_install --use-pep517 --config-settings "--global-option=--use-pkg-config" . +sdh_pip_install --config-settings "--global-option=--use-pkg-config" --config-settings "--global-option=--no-wait" .