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

name clash between (generated) conftest.py and this in m4 macros #39357

Open
dimpase opened this issue Jan 20, 2025 · 4 comments · May be fixed by #39363
Open

name clash between (generated) conftest.py and this in m4 macros #39357

dimpase opened this issue Jan 20, 2025 · 4 comments · May be fixed by #39363

Comments

@dimpase
Copy link
Member

dimpase commented Jan 20, 2025

@jhpalmieri - thanks for digging this up. It's a name clash between (generated) conftest.py used in checking Sage's Python, and conftest.py introduced by this PR, and used by pytest. It's probably a standard name for pytest, so we'd need to rename conftest.py in the macros used by ./configure. I'll try to fix this. @tobiasdiez

Originally posted by @dimpase in #39206 (comment)

@tobiasdiez
Copy link
Contributor

Sorry, I was not aware that configure writes files in the root directory. contest.py is indeed the standard pytest name, so shouldnt be used by configure

@dimpase
Copy link
Member Author

dimpase commented Jan 21, 2025

I've checked that in ./configure one has

rm -f configure*

in a lot of places; these rm come from standard autoconf macros and it's unrealistic to fix them.

So what we can do is to use a shell analog of Python atexit facility to rename conftest.py to something safe, and then rename it back at ./configure shell exit.

Or perhaps tell pytest to look for conftest.py somewhere else, but I don't know how.

@dimpase
Copy link
Member Author

dimpase commented Jan 21, 2025

Here is the answer I got on the autoconf mailing list:
https://lists.gnu.org/archive/html/autoconf/2025-01/msg00013.html

tl;dr; no luck fixing it and preserving the way we do things now. They suggest a split build - I'll try, but I'm not hopeful.

@dimpase
Copy link
Member Author

dimpase commented Jan 21, 2025

No, of course, split build (running configure+make in a subdirectory) can't be done without (major?) changes of what we do now.

How about going with a wrapper? Say, we have a script called Configure which makes a copy of configure.py, calls configure passing all the parameters, and finally restores configure.py ?

@dimpase dimpase linked a pull request Jan 22, 2025 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants