From 18458bf3535e183c3315cd5763d7b09f3bef4b1e Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 11 Oct 2023 13:49:47 -0700 Subject: [PATCH 01/13] Rename spkg-piprm-requirements.txt to just spkg-requirements.txt --- build/bin/sage-dist-helpers | 2 +- build/bin/sage-spkg | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/bin/sage-dist-helpers b/build/bin/sage-dist-helpers index 67a2201d31f..567168b1f67 100644 --- a/build/bin/sage-dist-helpers +++ b/build/bin/sage-dist-helpers @@ -376,7 +376,7 @@ sdh_store_and_pip_install_wheel() { if [ -n "${SAGE_PKG_DIR}" ]; then # Record name of installed distribution name for uninstallation. wheel=${wheel##*/} - echo "${wheel%%-*}" >> ${SAGE_PKG_DIR}/spkg-piprm-requirements.txt + echo "${wheel%%-*}" >> ${SAGE_PKG_DIR}/spkg-requirements.txt fi } diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index 9b38ed6afc7..92c920d57cb 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -548,7 +548,7 @@ WRAPPED_SCRIPTS="build install check preinst postinst $INSTALLED_SCRIPTS" # Prepare script for uninstallation of packages that use sdh_pip_install # or sdh_store_and_pip_install_wheel. -echo 'sdh_pip_uninstall -r $SAGE_SPKG_SCRIPTS/$PKG_BASE/spkg-piprm-requirements.txt' > spkg-piprm.in +echo 'sdh_pip_uninstall -r $SAGE_SPKG_SCRIPTS/$PKG_BASE/spkg-requirements.txt' > spkg-piprm.in for script in $WRAPPED_SCRIPTS; do # 'Installed' scripts are not run immediately out of the package build @@ -722,7 +722,7 @@ unset SAGE_DESTDIR_LOCAL # removed by sage-spkg-uninstall INSTALLED_SCRIPTS_DEST="$SAGE_SPKG_SCRIPTS/$PKG_BASE" -if [ -f spkg-piprm-requirements.txt ]; then +if [ -f spkg-requirements.txt ]; then INSTALLED_SCRIPTS="$INSTALLED_SCRIPTS piprm-requirements.txt" else # No packages to uninstall with pip, so remove the prepared uninstall script From 4a4810e10c497c6d8d934a492f389abc0b5d9004 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 11 Oct 2023 12:36:36 -0700 Subject: [PATCH 02/13] build/make/Makefile.in (SCRIPT_PACKAGE_templ): Set more variables set by sage-spkg --- build/make/Makefile.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/make/Makefile.in b/build/make/Makefile.in index cc004d08c3c..d6e79c03547 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -730,7 +730,11 @@ $(1)-$(4)-no-deps: . '$$(SAGE_ROOT)/src/bin/sage-env' && \ . '$$(SAGE_ROOT)/build/bin/sage-build-env-config' && \ . '$$(SAGE_ROOT)/build/bin/sage-build-env' && \ + PKG_BASE="$(1)" \ + PKG_VER="$(2)" \ + PKG_NAME="$(1)-$(2)" \ SAGE_SPKG_WHEELS=$$($(4))/var/lib/sage/wheels \ + SAGE_SPKG_SCRIPTS=$$($(4))/var/lib/sage/scripts \ SAGE_INST_LOCAL=$$($(4)) \ sage-logger -p 'SAGE_CHECK=$$(SAGE_CHECK_$(1)) $$(SAGE_ROOT)/build/pkgs/$(1)/spkg-install' '$$(SAGE_LOGS)/$(1)-$(2).log' && \ rm -f "$$($(4))/$(SPKG_INST_RELDIR)/$(1)"-* && \ From 952405f3c1b131122821a9b1d673ac8a107ff987 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 11 Oct 2023 13:01:41 -0700 Subject: [PATCH 03/13] build/bin/sage-dist-helpers (sdh_store_[and_pip_install_]wheel): Record wheel file name in venv/var/lib/sage/scripts/PKG_BASE/spkg-requirements.txt --- build/bin/sage-dist-helpers | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/build/bin/sage-dist-helpers b/build/bin/sage-dist-helpers index 567168b1f67..73119347438 100644 --- a/build/bin/sage-dist-helpers +++ b/build/bin/sage-dist-helpers @@ -321,7 +321,15 @@ sdh_store_wheel() { mkdir -p "${SAGE_DESTDIR}${SAGE_SPKG_WHEELS}" && \ $sudo mv "$wheel" "${SAGE_DESTDIR}${SAGE_SPKG_WHEELS}/" || \ sdh_die "Error storing $wheel" - wheel="${SAGE_DESTDIR}${SAGE_SPKG_WHEELS}/${wheel##*/}" + wheel="${SAGE_SPKG_WHEELS}/${wheel##*/}" + if [ -n "${SAGE_SPKG_SCRIPTS}" -a -n "${PKG_BASE}" ]; then + wheel_basename="${wheel##*/}" + distname="${wheel_basename%%-*}" + # Record name and wheel file location + mkdir -p ${SAGE_DESTDIR}${SAGE_SPKG_SCRIPTS}/${PKG_BASE} + echo "${distname} @ file://${wheel}" >> ${SAGE_DESTDIR}${SAGE_SPKG_SCRIPTS}/${PKG_BASE}/spkg-requirements.txt + fi + wheel="${SAGE_DESTDIR}${wheel}" } sdh_store_and_pip_install_wheel() { @@ -373,11 +381,6 @@ sdh_store_and_pip_install_wheel() { fi $sudo sage-pip-install $root $pip_options "$wheel" || \ sdh_die "Error installing ${wheel##*/}" - if [ -n "${SAGE_PKG_DIR}" ]; then - # Record name of installed distribution name for uninstallation. - wheel=${wheel##*/} - echo "${wheel%%-*}" >> ${SAGE_PKG_DIR}/spkg-requirements.txt - fi } sdh_pip_uninstall() { From f8b93c7b8ac623c1ecb56f2a739b0aaa4a51966a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 11 Oct 2023 13:23:02 -0700 Subject: [PATCH 04/13] build/bin/sage-spkg: Remove unused code for packages without spkg-install.in --- build/bin/sage-spkg | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index 92c920d57cb..d7de39dcb2d 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -567,24 +567,6 @@ for script in $WRAPPED_SCRIPTS; do fi done - -# When there is no spkg-install, assume the "spkg" is a tarball not -# specifically made for Sage. Since we want it to be as easy as -# possible to install such a package, we "guess" spkg-install. -if [ ! -f spkg-install ]; then - echo '#!/usr/bin/env bash' > spkg-install - if [ -x configure ]; then - echo './configure --prefix="$SAGE_INST_LOCAL" && make && $SAGE_SUDO make install' >> spkg-install - elif [ -f setup.py ]; then - echo 'python setup.py install' >> spkg-install - else - echo >&2 "Error: There is no spkg-install script, no setup.py, and no configure" - echo >&2 "script, so I do not know how to install $PKG_SRC." - exit 1 - fi - chmod +x spkg-install -fi - echo "****************************************************" echo "Host system:" uname -a From 91b0b8371213b2123c88f68ffc490f96dc3c9f3f Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 11 Oct 2023 14:05:58 -0700 Subject: [PATCH 05/13] build/bin/sage-spkg: Adjust to spkg-requirements.txt being installed directly --- build/bin/sage-spkg | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index d7de39dcb2d..b540c8e866f 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -704,9 +704,7 @@ unset SAGE_DESTDIR_LOCAL # removed by sage-spkg-uninstall INSTALLED_SCRIPTS_DEST="$SAGE_SPKG_SCRIPTS/$PKG_BASE" -if [ -f spkg-requirements.txt ]; then - INSTALLED_SCRIPTS="$INSTALLED_SCRIPTS piprm-requirements.txt" -else +if [ ! -f $INSTALLED_SCRIPTS_DEST/spkg-requirements.txt ]; then # No packages to uninstall with pip, so remove the prepared uninstall script rm -f spkg-piprm spkg-piprm.in fi From f91c20b2b20dd52c3bc210d7eb2e0705b91b4a21 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 11 Oct 2023 14:35:47 -0700 Subject: [PATCH 06/13] build/make/Makefile.in (SCRIPT_PACKAGE_templ): Remove script dir before running spkg-install --- build/make/Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/build/make/Makefile.in b/build/make/Makefile.in index d6e79c03547..5ded207c435 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -724,6 +724,7 @@ $(1)-$(4)-no-deps: echo "$$($(4)_DISABLED_MESSAGE)" 2>&1; \ exit 1; \ elif [ -x '$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-install' ]; then \ + rm -rf '$$($(4))/var/lib/sage/scripts/$(1)'; \ cd '$$(SAGE_ROOT)/build/pkgs/$(1)' && \ . '$$(SAGE_ROOT)/src/bin/sage-src-env-config' && \ . '$$(SAGE_ROOT)/src/bin/sage-env-config' && \ From 0aaf02e55702c32411e329b3964fd02447ff7c37 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 11 Oct 2023 15:29:47 -0700 Subject: [PATCH 07/13] build/make/Makefile.in (SCRIPT_PACKAGE_templ) [SAGE_CHECK=yes]: Call script spkg-postinstcheck if it exists; new target SPKG-check --- build/make/Makefile.in | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/build/make/Makefile.in b/build/make/Makefile.in index 5ded207c435..60d40f8991e 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -737,7 +737,8 @@ $(1)-$(4)-no-deps: SAGE_SPKG_WHEELS=$$($(4))/var/lib/sage/wheels \ SAGE_SPKG_SCRIPTS=$$($(4))/var/lib/sage/scripts \ SAGE_INST_LOCAL=$$($(4)) \ - sage-logger -p 'SAGE_CHECK=$$(SAGE_CHECK_$(1)) $$(SAGE_ROOT)/build/pkgs/$(1)/spkg-install' '$$(SAGE_LOGS)/$(1)-$(2).log' && \ + SAGE_CHECK=$$(SAGE_CHECK_$(1)) \ + sage-logger -p '$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-install && if [ $$$$SAGE_CHECK != no -a -x $$(SAGE_ROOT)/build/pkgs/$(1)/spkg-postinstcheck ]; then $$(SAGE_ROOT)/build/pkgs/$(1)/spkg-postinstcheck; fi' '$$(SAGE_LOGS)/$(1)-$(2).log' && \ rm -f "$$($(4))/$(SPKG_INST_RELDIR)/$(1)"-* && \ touch "$$($(4))/$(SPKG_INST_RELDIR)/$(1)-$(2)"; \ else ( \ @@ -757,6 +758,26 @@ $(1)-$(4)-no-deps: $(1)-no-deps: $(1)-$(4)-no-deps +$(1)-$(4)-check: + $(PLUS)@if [ -x $$(SAGE_ROOT)/build/pkgs/$(1)/spkg-postinstcheck ]; then \ + cd '$$(SAGE_ROOT)/build/pkgs/$(1)' && \ + . '$$(SAGE_ROOT)/src/bin/sage-src-env-config' && \ + . '$$(SAGE_ROOT)/src/bin/sage-env-config' && \ + . '$$(SAGE_ROOT)/src/bin/sage-env' && \ + . '$$(SAGE_ROOT)/build/bin/sage-build-env-config' && \ + . '$$(SAGE_ROOT)/build/bin/sage-build-env' && \ + PKG_BASE="$(1)" \ + PKG_VER="$(2)" \ + PKG_NAME="$(1)-$(2)" \ + SAGE_SPKG_WHEELS=$$($(4))/var/lib/sage/wheels \ + SAGE_SPKG_SCRIPTS=$$($(4))/var/lib/sage/scripts \ + SAGE_INST_LOCAL=$$($(4)) \ + SAGE_CHECK=$$(SAGE_CHECK_$(1)) \ + sage-logger -p '$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-postinstcheck' '$$(SAGE_LOGS)/$(1)-$(2).log'; \ + fi + +$(1)-check: $(1)-$(4)-check + $(1)-$(4)-uninstall: -$(AM_V_at)cd '$$(SAGE_ROOT)/build/pkgs/$(1)' && \ . '$$(SAGE_ROOT)/src/bin/sage-src-env-config' && \ From 417de39f72e245b3f921d19d278ea37d00e6dc59 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 11 Oct 2023 15:30:58 -0700 Subject: [PATCH 08/13] build/pkgs/sagemath_*/spkg-postinstcheck: Break out from spkg-install --- .../sagemath_categories/spkg-postinstcheck | 1 + .../sagemath_environment/spkg-postinstcheck | 1 + build/pkgs/sagemath_objects/spkg-install | 23 ---------------- .../pkgs/sagemath_objects/spkg-postinstcheck | 27 +++++++++++++++++++ build/pkgs/sagemath_repl/spkg-postinstcheck | 1 + 5 files changed, 30 insertions(+), 23 deletions(-) create mode 120000 build/pkgs/sagemath_categories/spkg-postinstcheck create mode 120000 build/pkgs/sagemath_environment/spkg-postinstcheck create mode 100755 build/pkgs/sagemath_objects/spkg-postinstcheck create mode 120000 build/pkgs/sagemath_repl/spkg-postinstcheck diff --git a/build/pkgs/sagemath_categories/spkg-postinstcheck b/build/pkgs/sagemath_categories/spkg-postinstcheck new file mode 120000 index 00000000000..313e9f9dc98 --- /dev/null +++ b/build/pkgs/sagemath_categories/spkg-postinstcheck @@ -0,0 +1 @@ +../sagemath_objects/spkg-postinstcheck \ No newline at end of file diff --git a/build/pkgs/sagemath_environment/spkg-postinstcheck b/build/pkgs/sagemath_environment/spkg-postinstcheck new file mode 120000 index 00000000000..313e9f9dc98 --- /dev/null +++ b/build/pkgs/sagemath_environment/spkg-postinstcheck @@ -0,0 +1 @@ +../sagemath_objects/spkg-postinstcheck \ No newline at end of file diff --git a/build/pkgs/sagemath_objects/spkg-install b/build/pkgs/sagemath_objects/spkg-install index 472e7f0d4d6..18ceb18724d 100755 --- a/build/pkgs/sagemath_objects/spkg-install +++ b/build/pkgs/sagemath_objects/spkg-install @@ -23,26 +23,3 @@ python3 -m build --outdir "$DIST_DIR"/dist . || sdh_die "Failure building sdist wheel=$(cd "$DIST_DIR" && sdh_store_wheel . >&2 && echo $wheel) ls -l "$wheel" - -if [ "$SAGE_CHECK" != no ]; then - export TOX_PARALLEL_NO_SPINNER=1 - echo Running "tox -r -p auto -v --installpkg $wheel" - tox -r -p auto -v --installpkg $wheel - status=$? - case $status:$SAGE_CHECK:$([ -r known-test-failures.json ]; echo $?) in - 0:*:0) echo "Passed the test suite (modulo baseline known-test-failures*.json)";; - 0:*:*) echo "Passed the test suite";; - *:warn:0) echo "Warning: New failures (not in baseline known-test-failures*.json (ignored)"; status=0;; - *:warn:*) echo "Warning: Failures testing the package (ignored)"; status=0;; - *:yes:0) echo "New failures, not in baseline known-test-failures*.json";; - *:yes:*) echo "Failures testing the package";; - esac - # Show summaries of failures (suppress lines ending with '[failed in baseline]') - for f in $(pwd)/.tox/sagepython-sagewheels-nopypi-norequirements*/log/*-command*.log; do - if [ -r "$f" ]; then - echo "$f" - grep '^sage -t.*#[^]]*$' "$f" - fi - done - exit $status -fi diff --git a/build/pkgs/sagemath_objects/spkg-postinstcheck b/build/pkgs/sagemath_objects/spkg-postinstcheck new file mode 100755 index 00000000000..87cea0fc38f --- /dev/null +++ b/build/pkgs/sagemath_objects/spkg-postinstcheck @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +cd src + +export PIP_NO_INDEX=true +export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS" + +export TOX_PARALLEL_NO_SPINNER=1 +wheel="$(sed -n '1s,.*@ file://,,p' $SAGE_SPKG_SCRIPTS/$PKG_BASE/spkg-requirements.txt)" +echo Running "tox -r -p auto -v --installpkg $wheel" +tox -r -p auto -v --installpkg "$wheel" +status=$? +case $status:$SAGE_CHECK:$([ -r known-test-failures.json ]; echo $?) in + 0:*:0) echo "Passed the test suite (modulo baseline known-test-failures*.json)";; + 0:*:*) echo "Passed the test suite";; + *:warn:0) echo "Warning: New failures (not in baseline known-test-failures*.json (ignored)"; status=0;; + *:warn:*) echo "Warning: Failures testing the package (ignored)"; status=0;; + *:yes:0) echo "New failures, not in baseline known-test-failures*.json";; + *:yes:*) echo "Failures testing the package";; +esac +# Show summaries of failures (suppress lines ending with '[failed in baseline]') +for f in $(pwd)/.tox/sagepython-sagewheels-nopypi-norequirements*/log/*-command*.log; do + if [ -r "$f" ]; then + echo "$f" + grep '^sage -t.*#[^]]*$' "$f" + fi +done +exit $status diff --git a/build/pkgs/sagemath_repl/spkg-postinstcheck b/build/pkgs/sagemath_repl/spkg-postinstcheck new file mode 120000 index 00000000000..313e9f9dc98 --- /dev/null +++ b/build/pkgs/sagemath_repl/spkg-postinstcheck @@ -0,0 +1 @@ +../sagemath_objects/spkg-postinstcheck \ No newline at end of file From 3c2939ab3efea15f2609e9444b6f85cb5ba9215c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 11 Oct 2023 15:52:17 -0700 Subject: [PATCH 09/13] Rename spkg-postinstcheck -> spkg-check --- build/make/Makefile.in | 6 +++--- build/pkgs/sagemath_categories/spkg-check | 1 + build/pkgs/sagemath_categories/spkg-postinstcheck | 1 - build/pkgs/sagemath_environment/spkg-check | 1 + build/pkgs/sagemath_environment/spkg-postinstcheck | 1 - .../sagemath_objects/{spkg-postinstcheck => spkg-check} | 0 build/pkgs/sagemath_repl/spkg-check | 1 + build/pkgs/sagemath_repl/spkg-postinstcheck | 1 - 8 files changed, 6 insertions(+), 6 deletions(-) create mode 120000 build/pkgs/sagemath_categories/spkg-check delete mode 120000 build/pkgs/sagemath_categories/spkg-postinstcheck create mode 120000 build/pkgs/sagemath_environment/spkg-check delete mode 120000 build/pkgs/sagemath_environment/spkg-postinstcheck rename build/pkgs/sagemath_objects/{spkg-postinstcheck => spkg-check} (100%) create mode 120000 build/pkgs/sagemath_repl/spkg-check delete mode 120000 build/pkgs/sagemath_repl/spkg-postinstcheck diff --git a/build/make/Makefile.in b/build/make/Makefile.in index 60d40f8991e..6a1d202bff9 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -738,7 +738,7 @@ $(1)-$(4)-no-deps: SAGE_SPKG_SCRIPTS=$$($(4))/var/lib/sage/scripts \ SAGE_INST_LOCAL=$$($(4)) \ SAGE_CHECK=$$(SAGE_CHECK_$(1)) \ - sage-logger -p '$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-install && if [ $$$$SAGE_CHECK != no -a -x $$(SAGE_ROOT)/build/pkgs/$(1)/spkg-postinstcheck ]; then $$(SAGE_ROOT)/build/pkgs/$(1)/spkg-postinstcheck; fi' '$$(SAGE_LOGS)/$(1)-$(2).log' && \ + sage-logger -p '$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-install && if [ $$$$SAGE_CHECK != no -a -x $$(SAGE_ROOT)/build/pkgs/$(1)/spkg-check ]; then $$(SAGE_ROOT)/build/pkgs/$(1)/spkg-check; fi' '$$(SAGE_LOGS)/$(1)-$(2).log' && \ rm -f "$$($(4))/$(SPKG_INST_RELDIR)/$(1)"-* && \ touch "$$($(4))/$(SPKG_INST_RELDIR)/$(1)-$(2)"; \ else ( \ @@ -759,7 +759,7 @@ $(1)-$(4)-no-deps: $(1)-no-deps: $(1)-$(4)-no-deps $(1)-$(4)-check: - $(PLUS)@if [ -x $$(SAGE_ROOT)/build/pkgs/$(1)/spkg-postinstcheck ]; then \ + $(PLUS)@if [ -x $$(SAGE_ROOT)/build/pkgs/$(1)/spkg-check ]; then \ cd '$$(SAGE_ROOT)/build/pkgs/$(1)' && \ . '$$(SAGE_ROOT)/src/bin/sage-src-env-config' && \ . '$$(SAGE_ROOT)/src/bin/sage-env-config' && \ @@ -773,7 +773,7 @@ $(1)-$(4)-check: SAGE_SPKG_SCRIPTS=$$($(4))/var/lib/sage/scripts \ SAGE_INST_LOCAL=$$($(4)) \ SAGE_CHECK=$$(SAGE_CHECK_$(1)) \ - sage-logger -p '$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-postinstcheck' '$$(SAGE_LOGS)/$(1)-$(2).log'; \ + sage-logger -p '$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-check' '$$(SAGE_LOGS)/$(1)-$(2).log'; \ fi $(1)-check: $(1)-$(4)-check diff --git a/build/pkgs/sagemath_categories/spkg-check b/build/pkgs/sagemath_categories/spkg-check new file mode 120000 index 00000000000..91c6b1835fc --- /dev/null +++ b/build/pkgs/sagemath_categories/spkg-check @@ -0,0 +1 @@ +../sagemath_objects/spkg-check \ No newline at end of file diff --git a/build/pkgs/sagemath_categories/spkg-postinstcheck b/build/pkgs/sagemath_categories/spkg-postinstcheck deleted file mode 120000 index 313e9f9dc98..00000000000 --- a/build/pkgs/sagemath_categories/spkg-postinstcheck +++ /dev/null @@ -1 +0,0 @@ -../sagemath_objects/spkg-postinstcheck \ No newline at end of file diff --git a/build/pkgs/sagemath_environment/spkg-check b/build/pkgs/sagemath_environment/spkg-check new file mode 120000 index 00000000000..91c6b1835fc --- /dev/null +++ b/build/pkgs/sagemath_environment/spkg-check @@ -0,0 +1 @@ +../sagemath_objects/spkg-check \ No newline at end of file diff --git a/build/pkgs/sagemath_environment/spkg-postinstcheck b/build/pkgs/sagemath_environment/spkg-postinstcheck deleted file mode 120000 index 313e9f9dc98..00000000000 --- a/build/pkgs/sagemath_environment/spkg-postinstcheck +++ /dev/null @@ -1 +0,0 @@ -../sagemath_objects/spkg-postinstcheck \ No newline at end of file diff --git a/build/pkgs/sagemath_objects/spkg-postinstcheck b/build/pkgs/sagemath_objects/spkg-check similarity index 100% rename from build/pkgs/sagemath_objects/spkg-postinstcheck rename to build/pkgs/sagemath_objects/spkg-check diff --git a/build/pkgs/sagemath_repl/spkg-check b/build/pkgs/sagemath_repl/spkg-check new file mode 120000 index 00000000000..91c6b1835fc --- /dev/null +++ b/build/pkgs/sagemath_repl/spkg-check @@ -0,0 +1 @@ +../sagemath_objects/spkg-check \ No newline at end of file diff --git a/build/pkgs/sagemath_repl/spkg-postinstcheck b/build/pkgs/sagemath_repl/spkg-postinstcheck deleted file mode 120000 index 313e9f9dc98..00000000000 --- a/build/pkgs/sagemath_repl/spkg-postinstcheck +++ /dev/null @@ -1 +0,0 @@ -../sagemath_objects/spkg-postinstcheck \ No newline at end of file From af6d0ad8559a5b926ec9fa99bf4400294cef227d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 11 Oct 2023 16:24:08 -0700 Subject: [PATCH 10/13] build/pkgs/sage_sws2rst/spkg-install: Do not call spkg-check from here any more --- build/pkgs/sage_sws2rst/spkg-check | 11 ++++++++++- build/pkgs/sage_sws2rst/spkg-install | 10 ---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/build/pkgs/sage_sws2rst/spkg-check b/build/pkgs/sage_sws2rst/spkg-check index 667df773214..7372750871e 100755 --- a/build/pkgs/sage_sws2rst/spkg-check +++ b/build/pkgs/sage_sws2rst/spkg-check @@ -1,2 +1,11 @@ #! /bin/sh -cd src && ./check.sh +cd src +./check.sh +if [ $? -ne 0 ]; then + if [ "$SAGE_CHECK" = "warn" ]; then + echo >&2 "Warning: Failures testing package $PKG_NAME (ignored)" + else + echo >&2 "Error testing package $PKG_NAME" + exit 1 + fi +fi diff --git a/build/pkgs/sage_sws2rst/spkg-install b/build/pkgs/sage_sws2rst/spkg-install index 9cb71471fd8..a180fb36542 100755 --- a/build/pkgs/sage_sws2rst/spkg-install +++ b/build/pkgs/sage_sws2rst/spkg-install @@ -18,13 +18,3 @@ if [ "$SAGE_EDITABLE" = yes ]; then else sdh_pip_install . fi -cd .. -# For type=script packages, spkg-check is not run -case "$SAGE_CHECK" in - yes) - ./spkg-check - ;; - warn) - ./spkg-check || echo >&2 "Warning: Failures testing package sage_sws2rst (ignored)" - ;; -esac From 22b101f6473209959d7eb81243aebec573152c17 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 11 Oct 2023 17:25:52 -0700 Subject: [PATCH 11/13] build/make/Makefile.in (pypi-wheels-check): New target --- build/make/Makefile.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/make/Makefile.in b/build/make/Makefile.in index 6a1d202bff9..6031ae7fa2a 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -468,6 +468,8 @@ wheels: $(MAKE_REC) SAGE_EDITABLE=no SAGE_WHEELS=yes $(WHEEL_PACKAGES) @echo "Built wheels are in venv/var/lib/sage/wheels/" +pypi-wheels-check: $(PYPI_WHEEL_PACKAGES:%=%-check) + #============================================================================== # Setting SAGE_CHECK... variables #============================================================================== From 383861343e434e569a051dd16545ada948554ff9 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 11 Oct 2023 18:12:23 -0700 Subject: [PATCH 12/13] .github/workflows/build.yml: Separate build and test --- .github/workflows/build.yml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 062fa973ac3..8a44a1ff188 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -107,20 +107,19 @@ jobs: (cd worktree-image && git commit -q -m "current changes" --allow-empty -a && git am; git reset --quiet old; git add -N .) < upstream/ci_fixes.patch fi - - name: Incremental build, test changed files (sage -t --new) + - name: Incremental build id: incremental run: | # Now re-bootstrap and build. The build is incremental because we were careful with the timestamps. - # We run tests with "sage -t --new"; this only tests the uncommitted changes. - ./bootstrap && make build && ./sage -t --new -p2 + ./bootstrap && make build working-directory: ./worktree-image env: MAKE: make -j2 --output-sync=recurse SAGE_NUM_THREADS: 2 - - name: Build and test modularized distributions + - name: Build modularized distributions if: always() && steps.worktree.outcome == 'success' - run: make V=0 tox && make pypi-wheels + run: make V=0 tox && make SAGE_CHECK=no pypi-wheels working-directory: ./worktree-image env: MAKE: make -j2 --output-sync=recurse @@ -165,6 +164,25 @@ jobs: MAKE: make -j2 --output-sync=recurse SAGE_NUM_THREADS: 2 + # Testing + + - name: Test changed files (sage -t --new) + run: | + # We run tests with "sage -t --new"; this only tests the uncommitted changes. + ./sage -t --new -p2 + working-directory: ./worktree-image + env: + MAKE: make -j2 --output-sync=recurse + SAGE_NUM_THREADS: 2 + + - name: Test modularized distributions + if: always() && steps.worktree.outcome == 'success' + run: make V=0 tox && make pypi-wheels-check + working-directory: ./worktree-image + env: + MAKE: make -j2 --output-sync=recurse + SAGE_NUM_THREADS: 2 + - name: Pytest if: contains(github.ref, 'pytest') run: | From 8224cb097fcbeecb4f19ef42bec85eeef0d1a33a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 11 Oct 2023 22:36:09 -0700 Subject: [PATCH 13/13] .github/workflows/build.yml: Fix 'if' of some steps --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a44a1ff188..1d365405f2a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -167,6 +167,7 @@ jobs: # Testing - name: Test changed files (sage -t --new) + if: always() && steps.build.outcome == 'success' run: | # We run tests with "sage -t --new"; this only tests the uncommitted changes. ./sage -t --new -p2 @@ -176,7 +177,7 @@ jobs: SAGE_NUM_THREADS: 2 - name: Test modularized distributions - if: always() && steps.worktree.outcome == 'success' + if: always() && steps.build.outcome == 'success' run: make V=0 tox && make pypi-wheels-check working-directory: ./worktree-image env: