On Mon, Sep 27, 2021 at 3:04 PM Barry Warsaw <barry@python.org> wrote:
If you’re planning a runtime -X option, then does that mean that the modules will be frozen at build time but Python will decide at runtime whether to use the frozen modules or the unfrozen ones?
Correct. FYI, this was already done.
Are you planning on including the currently frozen importlib modules in that same mechanism?
No. They must always be frozen. See is_essential_frozen_module() in Python/import.c.
Will `make test` and/or CI run Python with both options? How will we make sure that frozen modules (or not) don’t break Python?
If "configure --with-optimizations" always sets the default to "on" and the default is "off" otherwise, then the PGO buildbots will exercise the frozen path. Likewise if "--with-pydebug" (or in-source-tree) makes the default "off" and otherwise it's "on". Without a build-time option already handled by one of the buildbots, we'd need to either add a dedicated buildbot or run it both ways (like we do with importlib). I expect that won't be necessary.
Option #3 seems like the most reasonable one to me, with the ability to turn it on when running from the source tree.
It's definitely the one that fits most naturally for me. -eric