Skip to content
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

bpo-45847: port _struct to PY_STDLIB_MOD (GH-29706) #29706

Merged
merged 1 commit into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Modules/Setup.stdlib.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
@MODULE__PICKLE_TRUE@_pickle _pickle.c
@MODULE__QUEUE_TRUE@_queue _queuemodule.c
@MODULE__RANDOM_TRUE@_random _randommodule.c
@MODULE__STRUCT_TRUE@_struct _struct.c
@MODULE__TYPING_TRUE@_typing _typingmodule.c
@MODULE__XXSUBINTERPRETERS_TRUE@_xxsubinterpreters _xxsubinterpretersmodule.c
@MODULE__ZONEINFO_TRUE@_zoneinfo _zoneinfo.c
Expand Down
15 changes: 15 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,8 @@ MODULE__XXSUBINTERPRETERS_FALSE
MODULE__XXSUBINTERPRETERS_TRUE
MODULE__TYPING_FALSE
MODULE__TYPING_TRUE
MODULE__STRUCT_FALSE
MODULE__STRUCT_TRUE
MODULE_SELECT_FALSE
MODULE_SELECT_TRUE
MODULE__RANDOM_FALSE
Expand Down Expand Up @@ -20547,6 +20549,15 @@ else
fi
as_fn_append MODULE_BLOCK "MODULE_SELECT=yes$as_nl"

if true; then
MODULE__STRUCT_TRUE=
MODULE__STRUCT_FALSE='#'
else
MODULE__STRUCT_TRUE='#'
MODULE__STRUCT_FALSE=
fi
as_fn_append MODULE_BLOCK "MODULE__STRUCT=yes$as_nl"

if true; then
MODULE__TYPING_TRUE=
MODULE__TYPING_FALSE='#'
Expand Down Expand Up @@ -21968,6 +21979,10 @@ if test -z "${MODULE_SELECT_TRUE}" && test -z "${MODULE_SELECT_FALSE}"; then
as_fn_error $? "conditional \"MODULE_SELECT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MODULE__STRUCT_TRUE}" && test -z "${MODULE__STRUCT_FALSE}"; then
as_fn_error $? "conditional \"MODULE__STRUCT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MODULE__TYPING_TRUE}" && test -z "${MODULE__TYPING_FALSE}"; then
as_fn_error $? "conditional \"MODULE__TYPING\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6135,6 +6135,7 @@ PY_STDLIB_MOD_SIMPLE([_pickle])
PY_STDLIB_MOD_SIMPLE([_queue])
PY_STDLIB_MOD_SIMPLE([_random])
PY_STDLIB_MOD_SIMPLE([select])
PY_STDLIB_MOD_SIMPLE([_struct])
PY_STDLIB_MOD_SIMPLE([_typing])
PY_STDLIB_MOD_SIMPLE([_xxsubinterpreters])
PY_STDLIB_MOD_SIMPLE([_zoneinfo])
Expand Down
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,7 @@ def detect_simple_extensions(self):

self.addext(Extension("_queue", ["_queuemodule.c"]))
self.addext(Extension("_statistics", ["_statisticsmodule.c"]))
self.addext(Extension("_struct", ["_struct.c"]))
self.addext(Extension("_typing", ["_typingmodule.c"]))

# Modules with some UNIX dependencies -- on by default:
Expand Down Expand Up @@ -1447,6 +1448,9 @@ def detect_uuid(self):
self.missing.append('_uuid')

def detect_modules(self):
# remove dummy extension
self.extensions = []

self.configure_compiler()
self.init_inc_lib_dirs()

Expand Down Expand Up @@ -2101,9 +2105,9 @@ class DummyProcess:
'build_scripts': PyBuildScripts,
'install': PyBuildInstall,
'install_lib': PyBuildInstallLib},
# The struct module is defined here, because build_ext won't be
# A dummy module is defined here, because build_ext won't be
# called unless there's at least one extension module defined.
ext_modules=[Extension('_struct', ['_struct.c'])],
ext_modules=[Extension('_dummy', ['_dummy.c'])],

# If you change the scripts installed here, you also need to
# check the PyBuildScripts command above, and change the links
Expand Down