Fix conftest.py being deleted by configure script#41333
Merged
vbraun merged 2 commits intosagemath:developfrom Dec 29, 2025
Merged
Fix conftest.py being deleted by configure script#41333vbraun merged 2 commits intosagemath:developfrom
vbraun merged 2 commits intosagemath:developfrom
Conversation
…gure Updated backup file naming and modified configure script behavior to protect conftest.py during configuration.
|
Documentation preview for this PR (built with commit a1812a6; changes) is ready! 🎉 |
Member
|
seems to be the right path to fix this, finally, not sure about details |
Member
|
On Thu, Dec 25, 2025 at 03:02:01AM -0800, Chenxin Zhong wrote:
@cxzhong requested your review on: sagemath/sage#41333 Fix conftest.py being deleted by configure script.
I just tested this, by running make which triggers bootstrap+configure,
and then errors out, and no, it does not work.
That is, the file does not get restored.
(perhaps it does if `make ` finishes normally)
|
Member
|
oops, I actually made a testing error, sorry. It seems to work all right. |
dimpase
approved these changes
Dec 26, 2025
dimpase
reviewed
Jan 5, 2026
|
|
||
| # Fix config.status to call ./configure instead of ./real_configure | ||
| # so that --recheck also protects conftest.py | ||
| sed -i "s|'./real_configure'|'./configure'|g" config.status |
Member
There was a problem hiding this comment.
this is non-posix use of sed, it breaks macOS builds.
https://groups.google.com/g/sage-release/c/fG2pnz3Hfi0/m/dF2iSSIjBgAJ
@cxzhong
dimpase
added a commit
to dimpase/sage
that referenced
this pull request
Jan 6, 2026
fixes a bug in sagemath#41333
dimpase
added a commit
to dimpase/sage
that referenced
this pull request
Jan 7, 2026
fixes a bug in sagemath#41333
dimpase
added a commit
to dimpase/sage
that referenced
this pull request
Jan 7, 2026
fixes a bug in sagemath#41333 tested on macOS and Linux now
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
Jan 13, 2026
sagemathgh-41399: allow macOS sed fixes a bug in sagemath#41333 <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#41399 Reported by: Dima Pasechnik Reviewer(s): John H. Palmieri
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
Jan 14, 2026
sagemathgh-41399: allow macOS sed fixes a bug in sagemath#41333 <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#41399 Reported by: Dima Pasechnik Reviewer(s): John H. Palmieri
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When running
makeafter switching branches or when reconfiguration is needed,conftest.py(the pytest configuration file) gets deleted.Root Cause
The
configure_wrapperscript backs upconftest.pybefore running./real_configureand restores it afterward:However, when
maketriggers a reconfigure, it runs:The
config.statusfile is generated byreal_configureand contains a hardcoded path:This bypasses the
./configurewrapper entirely, so:conftest.pyis not backed upreal_configureruns and deletes allconftest*filesconftest.pyis goneWhen This Happens
makeaftergit checkoutto a different branchmakeafter any change that triggersreconfiguretarget./config.status --recheckdirectlyPotential Solutions
Modify
config.statusgeneration - Patch the autoconf output to call./configureinstead of./real_configure📝 Checklist
⌛ Dependencies