You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OS-specific frozen modules are built, even on other OSes. #89436
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/ericsnowcurrently'closed_at=Nonecreated_at=<Date2021-09-23.17:31:45.907>labels= ['interpreter-core', 'type-bug', '3.11']
title='OS-specific frozen modules are built, even on other OSes.'updated_at=<Date2021-11-20.00:28:14.846>user='https://github.com/ericsnowcurrently'
The list of frozen modules in Python/frozen.c is generated by Tools/scripts/freeze_modules.py. Currently we freeze both posixpath and ntpath, even though for startup we only need one of the two (depending on the OS). In this case both modules are available on all platforms (and only os.path differs), so we might be okay to leave both frozen. The cost isn't high.
However, we may need to accommodate freezing a module only on a subset of supported OSes:
if the extra cost (to the size of the executable) is too high
if there's an OS-specific module that is only available on that OS
In that case, we'd need to generate the appropriate ifdefs in Python/frozen.c. We can't just exclude the module during generation since frozen.c is committed to the repo.
Activity
ericsnowcurrently commentedon Sep 23, 2021
The list of frozen modules in Python/frozen.c is generated by Tools/scripts/freeze_modules.py. Currently we freeze both posixpath and ntpath, even though for startup we only need one of the two (depending on the OS). In this case both modules are available on all platforms (and only os.path differs), so we might be okay to leave both frozen. The cost isn't high.
However, we may need to accommodate freezing a module only on a subset of supported OSes:
In that case, we'd need to generate the appropriate ifdefs in Python/frozen.c. We can't just exclude the module during generation since frozen.c is committed to the repo.
ericsnowcurrently commentedon Sep 23, 2021
FYI, currently os.path is also frozen and *is* OS-specific. However, that's a separate matter. See bpo-45272.