Skip to content

bpo-45573: Move mandatory core modules to Modules/Setup.bootstrap (GH-29616) #29616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 19, 2021

Conversation

tiran
Copy link
Member

@tiran tiran commented Nov 18, 2021

@tiran tiran force-pushed the bpo-45573-setup-core branch 2 times, most recently from be740b2 to 0db8a04 Compare November 18, 2021 13:37
@tiran tiran marked this pull request as ready for review November 18, 2021 15:34
@tiran tiran force-pushed the bpo-45573-setup-core branch from 0db8a04 to 05c1b88 Compare November 18, 2021 16:11
Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice improvement. Not all modules that #define Py_BUILD_CORE_MODULE are included in Modules/Setup.core. Is Modules/Setup.builtin a more "correct" name?

Modules that define Py_BUILD_CORE_MODULE
$ grep -r "#.*define.*Py_BUILD_CORE_MODULE" Modules | sort
Modules/_abc.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_asynciomodule.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_blake2/blake2b_impl.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_blake2/blake2module.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_blake2/blake2s_impl.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_ctypes/_ctypes.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_ctypes/callbacks.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_ctypes/cfield.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_ctypes/stgdict.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_cursesmodule.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_datetimemodule.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_decimal/_decimal.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_hashopenssl.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_heapqmodule.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_json.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_lsprof.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_pickle.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_posixsubprocess.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_queuemodule.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_randommodule.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_sha3/sha3module.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_struct.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_testinternalcapi.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_testmultiphase.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_xxsubinterpretersmodule.c:#  define Py_BUILD_CORE_MODULE 1
Modules/_zoneinfo.c:#  define Py_BUILD_CORE_MODULE 1
Modules/arraymodule.c:#  define Py_BUILD_CORE_MODULE 1
Modules/binascii.c:#  define Py_BUILD_CORE_MODULE 1
Modules/cmathmodule.c:#  define Py_BUILD_CORE_MODULE 1
Modules/mathmodule.c:#  define Py_BUILD_CORE_MODULE 1
Modules/md5module.c:#  define Py_BUILD_CORE_MODULE 1
Modules/sha1module.c:#  define Py_BUILD_CORE_MODULE 1
Modules/sha256module.c:#  define Py_BUILD_CORE_MODULE 1
Modules/sha512module.c:#  define Py_BUILD_CORE_MODULE 1
Modules/unicodedata.c:#  define Py_BUILD_CORE_MODULE 1

configure.ac Outdated
Comment on lines 6008 to 6009
dnl alias for static core modules (Modules/Setup.core)
AU_ALIAS([PY_STDLIB_MOD_CORE], [PY_STDLIB_MOD_SIMPLE])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the alias?

@tiran
Copy link
Member Author

tiran commented Nov 19, 2021

This is a nice improvement. Not all modules that #define Py_BUILD_CORE_MODULE are included in Modules/Setup.core. Is Modules/Setup.builtin a more "correct" name?

The term core is overloaded. I have not found a better term, though.

Py_BUILD_CORE_MODULE enables some private APIs that not available to 3rd party extension modules. The flag is orthogonal to static / shared state. You can build a shared C extension that uses core module APIs.

Setup.builtin does not fit well either. Other modules can be build as builtin modules, too. Setup.mandatory is also incorrect. Some modules like _abc could be build as shared extensions. Maybe Setup.bootstrap ?

@erlend-aasland
Copy link
Contributor

Yeah, Setup.bootstrap sounds like the best candidate.

@tiran tiran changed the title bpo-45573: Move mandatory core modules to Modules/Setup.core bpo-45573: Move mandatory core modules to Modules/Setup.bootstrap Nov 19, 2021
@tiran tiran force-pushed the bpo-45573-setup-core branch from 05c1b88 to a1b915f Compare November 19, 2021 08:50
@tiran tiran force-pushed the bpo-45573-setup-core branch from ff2d1e0 to db3e45e Compare November 19, 2021 15:01
Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! LGTM

@tiran tiran changed the title bpo-45573: Move mandatory core modules to Modules/Setup.bootstrap bpo-45573: Move mandatory core modules to Modules/Setup.bootstrap (GH-29616) Nov 19, 2021
@tiran tiran merged commit 7e44dc0 into python:main Nov 19, 2021
@tiran tiran deleted the bpo-45573-setup-core branch November 19, 2021 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants