Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

back up/restore conftest.py #39363

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/write-dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ cat <<EOF
FROM with-system-packages AS bootstrapped
#:bootstrapping:
RUN rm -rf /new /sage/.git
$ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap configure.ac sage .homebrew-build-env tox.ini .gitignore /new/
$ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap conftest.py configure_wrapper configure.ac sage .homebrew-build-env tox.ini .gitignore /new/
$ADD config/config.rpath /new/config/config.rpath
$ADD src/doc/bootstrap /new/src/doc/bootstrap
$ADD src/bin /new/src/bin
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ jobs:

- name: Generate Dockerfile
# From docker.yml
# tox -e <environment name> command runs commands in `tox.ini`,
# in particlar the script `.ci/write-dockerfile.sh`, to generate `Dockerfile`.
dimpase marked this conversation as resolved.
Show resolved Hide resolved
run: |
tox -e ${{ env.TOX_ENV }}
cp .tox/${{ env.TOX_ENV }}/Dockerfile .
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/config.log
/config.status
/configure
/real_configure
/confdefs.h

/m4/sage_spkg_configures.m4
Expand Down
6 changes: 4 additions & 2 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -220,7 +222,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 \
Expand Down
4 changes: 4 additions & 0 deletions configure_wrapper
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#! /bin/sh
cp conftest.py bak_conftest.py
./real_configure $@
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be safer to change $@ to "$@" to avoid arguments with spaces being broken up (not sure if it's portable, at least it works in bash)

also does the real_configure script support running it in a different directory? if yes then it may be a good idea to also support it by changing it to "$(dirname "$0")"/real_configure

mv bak_conftest.py conftest.py
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does make configure still work? (if yes maybe leave it alone to be conservative, if not maybe we need to fix it)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, make configure should still work. However, I don't know how, and trying to figure it out gives me a headache. OK, let's revert this change and see.

# Old default before https://github.com/sagemath/sage/issues/32406
RUN ./configure --disable-editable
RUN make build
Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/developer/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ package :mod:`sage.numerical.backends` and some modules in

- VS Code: Install the `Python extension <https://marketplace.visualstudio.com/items?itemName=ms-python.python>`_ and follow the `official VS Code documentation <https://code.visualstudio.com/docs/python/testing>`__.

*Configuration:* :sage_root:`src/conftest.py`
*Configuration:* :sage_root:`conftest.py`

*Documentation:* https://docs.pytest.org/en/stable/index.html

Expand Down
Loading