Builds Without HAVE_DYNAMIC_LOADING Set Still Expose Features and API Related to Dynamic Modules
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Bug report
Bug description:
When CPython is built without HAVE_DYNAMIC_LOADING set, we currently leave out a small handful of code in Python/import.c and Python/importdl.c. However, there is a bunch more that should probably be excluded (via #ifdef HAVE_DYNAMIC_LOADING):
- some functions and constants in Python/importdl.c and Include/internal/pycore_importdl.h
- some functions, constants, and state in Python/import.c and Include/internal/pycore_import.h
- some code in Lib/importlib/_bootstrap_external.py
- maybe some code in Objects/moduleobject.c
- builds for Modules/Setup.stdlib
- checks in Tools/build/check_extension_modules.py
- modules listed by Tools/build/generate_stdlib_module_names.py
(Also see gh-122907.)
Getting this all correct would probably take a fair amount of effort. Perhaps the big question is would it be worth addressing all these cases?
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the dynamic-loading paths named in Python/import.c, Python/importdl.c, Include/internal/pycore_importdl.h, Include/internal/pycore_import.h, Lib/importlib/_bootstrap_external.py, and Objects/moduleobject.c, along with the listed Tools/build scripts and Modules/Setup.stdlib. Compare behavior when HAVE_DYNAMIC_LOADING is unset, considering gh-122907, and determine the complete scope before defining what consistent exclusion of dynamic-module APIs and features would mean.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100