From 503a0a061c49fa5c96e0ec5dac0dc5371b9ac6fb Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Mon, 20 Jan 2025 17:27:24 -0600 Subject: [PATCH 1/9] correctly document location of conftest.py for pytest --- src/doc/en/developer/tools.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/en/developer/tools.rst b/src/doc/en/developer/tools.rst index bc18723cb24..661b8972185 100644 --- a/src/doc/en/developer/tools.rst +++ b/src/doc/en/developer/tools.rst @@ -382,7 +382,7 @@ package :mod:`sage.numerical.backends` and some modules in - VS Code: Install the `Python extension `_ and follow the `official VS Code documentation `__. -*Configuration:* :sage_root:`src/conftest.py` +*Configuration:* :sage_root:`conftest.py` *Documentation:* https://docs.pytest.org/en/stable/index.html From c68d07addc4cdeb96d04a98dc5450f7602ea9fb7 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Tue, 21 Jan 2025 18:04:32 -0600 Subject: [PATCH 2/9] wrap ./configure in a wrapper saving conftest.py as autoconf's generated configure clobbers conftest*, we are saving conftest.py from it by making a backup copy and then restoring it after the real configure was run. --- .gitignore | 1 + bootstrap | 2 ++ configure_wrapper | 4 ++++ 3 files changed, 7 insertions(+) create mode 100755 configure_wrapper diff --git a/.gitignore b/.gitignore index b8bfc364a26..36a502b10a9 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ /config.log /config.status /configure +/real_configure /confdefs.h /m4/sage_spkg_configures.m4 diff --git a/bootstrap b/bootstrap index 00c2a1f7d54..c5abb339832 100755 --- a/bootstrap +++ b/bootstrap @@ -329,3 +329,5 @@ fi if [ $SAVE = yes ]; then save fi +mv configure real_configure +cp configure_wrapper configure diff --git a/configure_wrapper b/configure_wrapper new file mode 100755 index 00000000000..3eb3eeb00b4 --- /dev/null +++ b/configure_wrapper @@ -0,0 +1,4 @@ +#! /bin/sh +cp conftest.py bak_conftest.py +./real_configure $@ +mv bak_conftest.py conftest.py From 08aecadeadfe90699fb7698955d6fc93fa763652 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Wed, 22 Jan 2025 11:22:23 -0600 Subject: [PATCH 3/9] add the wrapper and real_configure to configure tarball --- bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap b/bootstrap index c5abb339832..048d16e8575 100755 --- a/bootstrap +++ b/bootstrap @@ -220,7 +220,7 @@ save () { fi mkdir -p upstream tar zcf "$NEWCONFBALL" \ - configure \ + configure real_configure configure_wrapper \ config/install-sh config/compile config/config.guess config/config.sub config/missing \ build/make/Makefile-auto.in \ src/doc/en/installation/*.txt \ From 48a81bdf8042ad7855dc2ff83e46618d9e26ef47 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Wed, 22 Jan 2025 14:24:25 -0600 Subject: [PATCH 4/9] use ./bootstrap in building docker container --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index a97664b2292..4cc7e2884e5 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -196,7 +196,7 @@ ARG MAKEFLAGS="-j2" ENV MAKEFLAGS $MAKEFLAGS ARG SAGE_NUM_THREADS="2" ENV SAGE_NUM_THREADS $SAGE_NUM_THREADS -RUN make configure +RUN ./bootstrap # Old default before https://github.com/sagemath/sage/issues/32406 RUN ./configure --disable-editable RUN make build From 7ad95b9b4c7ed86b5dcced16a92620497e300374 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Wed, 22 Jan 2025 19:30:17 -0600 Subject: [PATCH 5/9] move wrapper creation to the better place --- bootstrap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bootstrap b/bootstrap index 048d16e8575..77a5cde41ed 100755 --- a/bootstrap +++ b/bootstrap @@ -146,7 +146,9 @@ EOF st=$? case $st in - 0) true;; # Success + 0) # Success + mv configure real_configure + cp configure_wrapper configure;; 179|16|63|127) # no m4 for pkg-config|autotools not installed|or version too old if [ $DOWNLOAD = yes ]; then @@ -329,5 +331,3 @@ fi if [ $SAVE = yes ]; then save fi -mv configure real_configure -cp configure_wrapper configure From 776464d2d7d5222f76afe25f50fb5ace2e4d86a8 Mon Sep 17 00:00:00 2001 From: user202729 <25191436+user202729@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:02:29 +0700 Subject: [PATCH 6/9] also ADD configure_wrapper and conftest.py --- .ci/write-dockerfile.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/write-dockerfile.sh b/.ci/write-dockerfile.sh index 7a3512dafd9..0453a023a74 100755 --- a/.ci/write-dockerfile.sh +++ b/.ci/write-dockerfile.sh @@ -275,7 +275,7 @@ cat < Date: Fri, 24 Jan 2025 00:19:54 -0600 Subject: [PATCH 7/9] add comments suggested on #39373i by user202729 --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bbecdf481b6..9ae9ccd1f5d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -308,6 +308,8 @@ jobs: - name: Generate Dockerfile # From docker.yml + # tox -e command runs commands in `tox.ini`, + # in particlar the script `.ci/write-dockerfile.sh`, to generate `Dockerfile`. run: | tox -e ${{ env.TOX_ENV }} cp .tox/${{ env.TOX_ENV }}/Dockerfile . From ff0f316991fc22e913833c4f7e1fefb0444d7d35 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Fri, 24 Jan 2025 22:12:39 -0600 Subject: [PATCH 8/9] Revert "use ./bootstrap in building docker container" This reverts commit 48a81bdf8042ad7855dc2ff83e46618d9e26ef47. --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 4cc7e2884e5..a97664b2292 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -196,7 +196,7 @@ ARG MAKEFLAGS="-j2" ENV MAKEFLAGS $MAKEFLAGS ARG SAGE_NUM_THREADS="2" ENV SAGE_NUM_THREADS $SAGE_NUM_THREADS -RUN ./bootstrap +RUN make configure # Old default before https://github.com/sagemath/sage/issues/32406 RUN ./configure --disable-editable RUN make build From 8290ad703c28ddb42417518cd6992c9f92d5846a Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Fri, 24 Jan 2025 23:41:14 -0600 Subject: [PATCH 9/9] typo fix --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ae9ccd1f5d..05eaa3a768e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -309,7 +309,7 @@ jobs: - name: Generate Dockerfile # From docker.yml # tox -e command runs commands in `tox.ini`, - # in particlar the script `.ci/write-dockerfile.sh`, to generate `Dockerfile`. + # in particular the script `.ci/write-dockerfile.sh`, to generate `Dockerfile`. run: | tox -e ${{ env.TOX_ENV }} cp .tox/${{ env.TOX_ENV }}/Dockerfile .