Repository navigation
gh-161364: Mark Setup.bootstrap's modules with a *bootstrap* line - #161734
Conversation
The rule of a Makefile from before pythongh-160689 regenerates the Makefile by calling makesetup without -b. That left BOOTSTRAP_MODOBJS empty, and Programs/_freeze_module failed to link until the Makefile was regenerated again. A *bootstrap* line in Setup.bootstrap.in marks the modules either way.
itamaro
left a comment
There was a problem hiding this comment.
good catch, thanks for fixing it!
see one inline comments for inline comment wording nits. also I think this doesn't really need a NEWS entry, so if you're pushing a comment edit, consider also dropping the NEWS entry (unless you feel strongly it's needed :) )
| # These are the bootstrap modules, which makesetup gets with -b. The line | ||
| # below says so as well, for the recipe of a Makefile from before -b | ||
| # existed, which passes this file without it (gh-161364). | ||
| *bootstrap* |
There was a problem hiding this comment.
wording nits
| # These are the bootstrap modules, which makesetup gets with -b. The line | |
| # below says so as well, for the recipe of a Makefile from before -b | |
| # existed, which passes this file without it (gh-161364). | |
| *bootstrap* | |
| # Mark bootstrap modules explicitly so older Makefile recipes work | |
| # without passing -b to makesetup (gh-161364). | |
| *bootstrap* |
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
Thanks! I took your wording and dropped the NEWS entry, so this will need the I have made the requested changes; please review again |
|
Thanks for making the requested changes! @itamaro: please review the changes made to this pull request. |
…line (python#161734) An existing Makefile can regenerate itself using an older recipe that invokes `makesetup` without `-b`. This leaves `BOOTSTRAP_MODOBJS` empty and causes `Programs/_freeze_module` to fail to link. Add a `*bootstrap*` marker to `Setup.bootstrap.in` so both old and new recipes identify the bootstrap modules correctly.
When make finds the Makefile out of date, it regenerates it with the rule of the Makefile it has already loaded. If that Makefile is from before gh-160689 (after a
git pull, or when an in-tree build is switched from 3.15), its rule calls makesetup without-b, soBOOTSTRAP_MODOBJScomes out empty andPrograms/_freeze_modulefails to link with the undefinedPyErr_CheckSignalsfrom the issue. The new Makefile is then newer than its inputs, so it stays broken until something regenerates it again, like touchingMakefile.pre.in.This adds a
*bootstrap*line toSetup.bootstrap.in. makesetup already handles that line the same way as-b(-bjust emits it), so the modules are marked as bootstrap modules whichever rule regenerates the Makefile.check_extension_modules.pyskips the line like*noconfig*; without that, the module check reports a module named*bootstrap*that fails to import.Tested by building in-tree at the parent of 0e35313 and at 3.15, then checking out this branch or main and running make:
_freeze_modulefails to link,BOOTSTRAP_MODOBJSis empty, and a second make still failsBOOTSTRAP_MODOBJShas the modules, and a second make doesn't regenerate the MakefileA fresh build checks the same 116 modules as main. The old rule still only moves
config.c, so after such a switch aconfig_bootstrap.cis left in the build directory until the Makefile is regenerated by the new rule.cc @itamaro since this comes from gh-160689.
undefined reference to PyErr_CheckSignals#161364