From a613d444f95bbb1b504de3e2a6ba569da6b98109 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Thu, 18 Nov 2021 13:32:08 +0100 Subject: [PATCH 1/5] bpo-45573: Move mandatory core modules to Modules/Setup.core Signed-off-by: Christian Heimes --- Makefile.pre.in | 3 ++ .../2021-11-18-13-31-02.bpo-45573.LCjGB8.rst | 1 + Modules/Setup | 27 +---------- Modules/Setup.core | 34 ++++++++++++++ configure | 45 ++++++++++++++++++- configure.ac | 27 ++++++++++- setup.py | 14 +++--- 7 files changed, 117 insertions(+), 34 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2021-11-18-13-31-02.bpo-45573.LCjGB8.rst create mode 100644 Modules/Setup.core diff --git a/Makefile.pre.in b/Makefile.pre.in index 2e42d53d5b9869..a3a79c887f00c1 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -910,10 +910,12 @@ Makefile Modules/config.c: Makefile.pre \ $(MAKESETUP) \ $(srcdir)/Modules/Setup \ Modules/Setup.local \ + $(srcdir)/Modules/Setup.core \ Modules/Setup.stdlib $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \ -s Modules \ Modules/Setup.local \ + $(srcdir)/Modules/Setup.core \ $(srcdir)/Modules/Setup @mv config.c Modules @echo "The Makefile was updated, you may need to re-run make." @@ -2167,6 +2169,7 @@ libainstall: @DEF_MAKE_RULE@ python-config $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile $(INSTALL_DATA) $(srcdir)/Modules/Setup $(DESTDIR)$(LIBPL)/Setup + $(INSTALL_DATA) $(srcdir)/Modules/Setup.core $(DESTDIR)$(LIBPL)/Setup.core $(INSTALL_DATA) Modules/Setup.stdlib $(DESTDIR)$(LIBPL)/Setup.stdlib $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc diff --git a/Misc/NEWS.d/next/Build/2021-11-18-13-31-02.bpo-45573.LCjGB8.rst b/Misc/NEWS.d/next/Build/2021-11-18-13-31-02.bpo-45573.LCjGB8.rst new file mode 100644 index 00000000000000..fbb63026669cc7 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-11-18-13-31-02.bpo-45573.LCjGB8.rst @@ -0,0 +1 @@ +Mandatory core modules are now in ``Modules/Setup.core`` diff --git a/Modules/Setup b/Modules/Setup index f8c90ea77721dd..54abb17a4fd711 100644 --- a/Modules/Setup +++ b/Modules/Setup @@ -111,31 +111,8 @@ PYTHONPATH=$(COREPYTHONPATH) # --- -# Built-in modules required to get a functioning interpreter; -# cannot be built as shared! - -_collections _collectionsmodule.c -_abc _abc.c -_codecs _codecsmodule.c -_functools _functoolsmodule.c -_io -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c -_locale _localemodule.c -_operator _operator.c -_signal signalmodule.c -_sre _sre.c -_stat _stat.c -_symtable symtablemodule.c -_thread _threadmodule.c -_tracemalloc _tracemalloc.c # See bpo-35053 as to why this is built in. -_weakref _weakref.c -atexit atexitmodule.c -errno errnomodule.c -faulthandler faulthandler.c -itertools itertoolsmodule.c -posix posixmodule.c -pwd pwdmodule.c -time timemodule.c - +# Built-in modules required to get a functioning interpreter are listed in +# Modules/Setup.core. # --- # The rest of the modules listed in this file are all commented out by diff --git a/Modules/Setup.core b/Modules/Setup.core new file mode 100644 index 00000000000000..d543f087b89fc2 --- /dev/null +++ b/Modules/Setup.core @@ -0,0 +1,34 @@ +# -*- makefile -*- + +# --- +# Built-in modules required to get a functioning interpreter; +# cannot be built as shared! + +# module C APIs are used in core +atexit atexitmodule.c +faulthandler faulthandler.c +posix posixmodule.c +_signal signalmodule.c +_tracemalloc _tracemalloc.c + +# modules used by importlib, deepfreeze, freeze, runpy, and sysconfig +_codecs _codecsmodule.c +_collections _collectionsmodule.c +errno errnomodule.c +_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c +itertools itertoolsmodule.c +_sre _sre.c +_thread _threadmodule.c +time timemodule.c +_weakref _weakref.c + +# commonly used core modules +_abc _abc.c +_functools _functoolsmodule.c +_locale _localemodule.c +_operator _operator.c +_stat _stat.c +_symtable symtablemodule.c + +# for systems without $HOME env, used by site._getuserbase() +pwd pwdmodule.c diff --git a/configure b/configure index 657c71dca62bdd..f11e2926b8220a 100755 --- a/configure +++ b/configure @@ -19456,6 +19456,49 @@ MODULE_BLOCK= +# This is what autoupdate's m4 run will expand. It fires +# the warning (with _au_warn_XXX), outputs it into the +# updated configure.ac (with AC_DIAGNOSE), and then outputs +# the replacement expansion. + + +# This is an auxiliary macro that is also run when +# autoupdate runs m4. It simply calls m4_warning, but +# we need a wrapper so that each warning is emitted only +# once. We break the quoting in m4_warning's argument in +# order to expand this macro's arguments, not AU_DEFUN's. + + +# Finally, this is the expansion that is picked up by +# autoconf. It tells the user to run autoupdate, and +# then outputs the replacement expansion. We do not care +# about autoupdate's warning because that contains +# information on what to do *after* running autoupdate. + + + + + as_fn_append MODULE_BLOCK "MODULE_IO_CFLAGS=-I\$(srcdir)/Modules/_io$as_nl" + + + as_fn_append MODULE_BLOCK "MODULE_IO_LDFLAGS=$TIMEMODULE_LIB$as_nl" + + + + + + + as_fn_append MODULE_BLOCK "MODULE_TIME_LDFLAGS=$TIMEMODULE_LIB$as_nl" + + + + + + as_fn_append MODULE_BLOCK "MODULE__DATETIME_LDFLAGS=$TIMEMODULE_LIB$as_nl" + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module ossaudiodev" >&5 $as_echo_n "checking for stdlib extension module ossaudiodev... " >&6; } case $py_stdlib_not_available in #( @@ -21068,7 +21111,7 @@ fi echo "creating Makefile" >&6 $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ -s Modules \ - Modules/Setup.local $srcdir/Modules/Setup + Modules/Setup.local $srcdir/Modules/Setup.core $srcdir/Modules/Setup mv config.c Modules if test -z "$PKG_CONFIG"; then diff --git a/configure.ac b/configure.ac index 4bac7ccf2484ea..94c7a886913b6f 100644 --- a/configure.ac +++ b/configure.ac @@ -6030,6 +6030,31 @@ AC_DEFUN([PY_STDLIB_MOD], [ m4_popdef([modstate])dnl ]) +dnl Define simple, always enabled stdlib extension module +dnl PY_STDLIB_MOD_SIMPLE([NAME], [CFLAGS], [LDFLAGS]) +dnl cflags and ldflags are optional +AC_DEFUN([PY_STDLIB_MOD_SIMPLE], [ + m4_pushdef([modcond], [MODULE_]m4_toupper([$1]))dnl + dnl _MODULE_BLOCK_ADD(modcond, [yes]) + dnl AM_CONDITIONAL(modcond, [true]) + m4_ifval([$2], [ + _MODULE_BLOCK_ADD([MODULE_]m4_toupper([$1])[_CFLAGS], [$2]) + ]) + m4_ifval([$3], [ + _MODULE_BLOCK_ADD([MODULE_]m4_toupper([$1])[_LDFLAGS], [$3]) + ]) + m4_popdef([modcond])dnl +]) +dnl alias for static core modules (Modules/Setup.core) +AU_ALIAS([PY_STDLIB_MOD_CORE], [PY_STDLIB_MOD_SIMPLE]) + +dnl static modules in Modules/Setup.core +PY_STDLIB_MOD_SIMPLE([io], [-I\$(srcdir)/Modules/_io], [$TIMEMODULE_LIB]) + +dnl always enabled extension modules +PY_STDLIB_MOD_SIMPLE([time], [], [$TIMEMODULE_LIB]) +PY_STDLIB_MOD_SIMPLE([_datetime], [], [$TIMEMODULE_LIB]) + dnl platform specific extensions PY_STDLIB_MOD([ossaudiodev], [], [test "$ac_cv_header_linux_soundcard_h" = yes -o "$ac_cv_header_sys_soundcard_h" = yes]) @@ -6062,7 +6087,7 @@ fi echo "creating Makefile" >&AS_MESSAGE_FD $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ -s Modules \ - Modules/Setup.local $srcdir/Modules/Setup + Modules/Setup.local $srcdir/Modules/Setup.core $srcdir/Modules/Setup mv config.c Modules if test -z "$PKG_CONFIG"; then diff --git a/setup.py b/setup.py index 040f90af601cce..fb9fd2b498d55e 100644 --- a/setup.py +++ b/setup.py @@ -1006,9 +1006,9 @@ def detect_simple_extensions(self): if lib: time_libs.append(lib) - # time operations and variables - self.add(Extension('time', ['timemodule.c'], - libraries=time_libs)) + # time operations and variables, always built by Modules/Setup.core + # self.add(Extension('time', ['timemodule.c'], + # libraries=time_libs)) # libm is needed by delta_new() that uses round() and by accum() that # uses modf(). self.add(Extension('_datetime', ['_datetimemodule.c'], @@ -1034,8 +1034,8 @@ def detect_simple_extensions(self): self.add(Extension('_opcode', ['_opcode.c'])) # asyncio speedups self.add(Extension("_asyncio", ["_asynciomodule.c"])) - # _abc speedups - self.add(Extension("_abc", ["_abc.c"])) + # _abc speedups, always built by Modules/Setup.core + # self.add(Extension("_abc", ["_abc.c"])) # _queue module self.add(Extension("_queue", ["_queuemodule.c"])) # _statistics module @@ -1054,8 +1054,8 @@ def detect_simple_extensions(self): libs = ['bsd'] self.add(Extension('fcntl', ['fcntlmodule.c'], libraries=libs)) - # pwd(3) - self.add(Extension('pwd', ['pwdmodule.c'])) + # pwd(3), always built by Modules/Setup.core + # self.add(Extension('pwd', ['pwdmodule.c'])) # grp(3) if not VXWORKS: self.add(Extension('grp', ['grpmodule.c'])) From 8c29e5290f714ed6090792944fdd19a31df4bfd7 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 19 Nov 2021 09:49:48 +0100 Subject: [PATCH 2/5] Use Setup.bootstrap --- Makefile.pre.in | 6 +- .../2021-11-18-13-31-02.bpo-45573.LCjGB8.rst | 3 +- Modules/{Setup.core => Setup.bootstrap} | 0 Modules/Setup.stdlib.in | 3 + configure | 65 ++++++++++++------- configure.ac | 15 ++--- setup.py | 13 ++-- 7 files changed, 61 insertions(+), 44 deletions(-) rename Modules/{Setup.core => Setup.bootstrap} (100%) diff --git a/Makefile.pre.in b/Makefile.pre.in index a3a79c887f00c1..312e52486f2960 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -910,12 +910,12 @@ Makefile Modules/config.c: Makefile.pre \ $(MAKESETUP) \ $(srcdir)/Modules/Setup \ Modules/Setup.local \ - $(srcdir)/Modules/Setup.core \ + $(srcdir)/Modules/Setup.bootstrap \ Modules/Setup.stdlib $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \ -s Modules \ Modules/Setup.local \ - $(srcdir)/Modules/Setup.core \ + $(srcdir)/Modules/Setup.bootstrap \ $(srcdir)/Modules/Setup @mv config.c Modules @echo "The Makefile was updated, you may need to re-run make." @@ -2169,7 +2169,7 @@ libainstall: @DEF_MAKE_RULE@ python-config $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile $(INSTALL_DATA) $(srcdir)/Modules/Setup $(DESTDIR)$(LIBPL)/Setup - $(INSTALL_DATA) $(srcdir)/Modules/Setup.core $(DESTDIR)$(LIBPL)/Setup.core + $(INSTALL_DATA) $(srcdir)/Modules/Setup.bootstrap $(DESTDIR)$(LIBPL)/Setup.bootstrap $(INSTALL_DATA) Modules/Setup.stdlib $(DESTDIR)$(LIBPL)/Setup.stdlib $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc diff --git a/Misc/NEWS.d/next/Build/2021-11-18-13-31-02.bpo-45573.LCjGB8.rst b/Misc/NEWS.d/next/Build/2021-11-18-13-31-02.bpo-45573.LCjGB8.rst index fbb63026669cc7..5f388948fb50fd 100644 --- a/Misc/NEWS.d/next/Build/2021-11-18-13-31-02.bpo-45573.LCjGB8.rst +++ b/Misc/NEWS.d/next/Build/2021-11-18-13-31-02.bpo-45573.LCjGB8.rst @@ -1 +1,2 @@ -Mandatory core modules are now in ``Modules/Setup.core`` +Mandatory core modules, that are required to bootstrap Python, are now in +``Modules/Setup.bootstrap``. diff --git a/Modules/Setup.core b/Modules/Setup.bootstrap similarity index 100% rename from Modules/Setup.core rename to Modules/Setup.bootstrap diff --git a/Modules/Setup.stdlib.in b/Modules/Setup.stdlib.in index 2e87b032e35e8e..3b0d3227bc5b04 100644 --- a/Modules/Setup.stdlib.in +++ b/Modules/Setup.stdlib.in @@ -29,6 +29,9 @@ ############################################################################ # Modules that should always be present (POSIX and Windows): +# needs libm and on some platforms librt +@MODULE__DATETIME_TRUE@_datetime _datetimemodule.c + # _decimal uses libmpdec # either static libmpdec.a from Modules/_decimal/libmpdec or libmpdec.so # with ./configure --with-system-libmpdec diff --git a/configure b/configure index f11e2926b8220a..9d03d89a241ef4 100755 --- a/configure +++ b/configure @@ -634,6 +634,12 @@ MODULE_PYEXPAT_FALSE MODULE_PYEXPAT_TRUE MODULE_OSSAUDIODEV_FALSE MODULE_OSSAUDIODEV_TRUE +MODULE__DATETIME_FALSE +MODULE__DATETIME_TRUE +MODULE_TIME_FALSE +MODULE_TIME_TRUE +MODULE__IO_FALSE +MODULE__IO_TRUE TEST_MODULES LIBRARY_DEPS STATIC_LIBPYTHON @@ -19456,45 +19462,48 @@ MODULE_BLOCK= -# This is what autoupdate's m4 run will expand. It fires -# the warning (with _au_warn_XXX), outputs it into the -# updated configure.ac (with AC_DIAGNOSE), and then outputs -# the replacement expansion. -# This is an auxiliary macro that is also run when -# autoupdate runs m4. It simply calls m4_warning, but -# we need a wrapper so that each warning is emitted only -# once. We break the quoting in m4_warning's argument in -# order to expand this macro's arguments, not AU_DEFUN's. - - -# Finally, this is the expansion that is picked up by -# autoconf. It tells the user to run autoupdate, and -# then outputs the replacement expansion. We do not care -# about autoupdate's warning because that contains -# information on what to do *after* running autoupdate. - + if true; then + MODULE__IO_TRUE= + MODULE__IO_FALSE='#' +else + MODULE__IO_TRUE='#' + MODULE__IO_FALSE= +fi + as_fn_append MODULE_BLOCK "MODULE__IO_CFLAGS='-I$(srcdir)/Modules/_io'$as_nl" - as_fn_append MODULE_BLOCK "MODULE_IO_CFLAGS=-I\$(srcdir)/Modules/_io$as_nl" - as_fn_append MODULE_BLOCK "MODULE_IO_LDFLAGS=$TIMEMODULE_LIB$as_nl" + if true; then + MODULE_TIME_TRUE= + MODULE_TIME_FALSE='#' +else + MODULE_TIME_TRUE='#' + MODULE_TIME_FALSE= +fi + as_fn_append MODULE_BLOCK "MODULE_TIME_LDFLAGS=$TIMEMODULE_LIB$as_nl" - as_fn_append MODULE_BLOCK "MODULE_TIME_LDFLAGS=$TIMEMODULE_LIB$as_nl" + if true; then + MODULE__DATETIME_TRUE= + MODULE__DATETIME_FALSE='#' +else + MODULE__DATETIME_TRUE='#' + MODULE__DATETIME_FALSE= +fi - as_fn_append MODULE_BLOCK "MODULE__DATETIME_LDFLAGS=$TIMEMODULE_LIB$as_nl" + as_fn_append MODULE_BLOCK "MODULE__DATETIME_LDFLAGS=$TIMEMODULE_LIB $LIBM$as_nl" @@ -19871,6 +19880,18 @@ LTLIBOBJS=$ac_ltlibobjs +if test -z "${MODULE__IO_TRUE}" && test -z "${MODULE__IO_FALSE}"; then + as_fn_error $? "conditional \"MODULE__IO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${MODULE_TIME_TRUE}" && test -z "${MODULE_TIME_FALSE}"; then + as_fn_error $? "conditional \"MODULE_TIME\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${MODULE__DATETIME_TRUE}" && test -z "${MODULE__DATETIME_FALSE}"; then + as_fn_error $? "conditional \"MODULE__DATETIME\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${MODULE_OSSAUDIODEV_TRUE}" && test -z "${MODULE_OSSAUDIODEV_FALSE}"; then as_fn_error $? "conditional \"MODULE_OSSAUDIODEV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -21111,7 +21132,7 @@ fi echo "creating Makefile" >&6 $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ -s Modules \ - Modules/Setup.local $srcdir/Modules/Setup.core $srcdir/Modules/Setup + Modules/Setup.local $srcdir/Modules/Setup.bootstrap $srcdir/Modules/Setup mv config.c Modules if test -z "$PKG_CONFIG"; then diff --git a/configure.ac b/configure.ac index 94c7a886913b6f..d9f50c3e8b9e3d 100644 --- a/configure.ac +++ b/configure.ac @@ -6035,8 +6035,7 @@ dnl PY_STDLIB_MOD_SIMPLE([NAME], [CFLAGS], [LDFLAGS]) dnl cflags and ldflags are optional AC_DEFUN([PY_STDLIB_MOD_SIMPLE], [ m4_pushdef([modcond], [MODULE_]m4_toupper([$1]))dnl - dnl _MODULE_BLOCK_ADD(modcond, [yes]) - dnl AM_CONDITIONAL(modcond, [true]) + AM_CONDITIONAL(modcond, [true]) m4_ifval([$2], [ _MODULE_BLOCK_ADD([MODULE_]m4_toupper([$1])[_CFLAGS], [$2]) ]) @@ -6045,15 +6044,13 @@ AC_DEFUN([PY_STDLIB_MOD_SIMPLE], [ ]) m4_popdef([modcond])dnl ]) -dnl alias for static core modules (Modules/Setup.core) -AU_ALIAS([PY_STDLIB_MOD_CORE], [PY_STDLIB_MOD_SIMPLE]) -dnl static modules in Modules/Setup.core -PY_STDLIB_MOD_SIMPLE([io], [-I\$(srcdir)/Modules/_io], [$TIMEMODULE_LIB]) +dnl static modules in Modules/Setup.bootstrap +PY_STDLIB_MOD_SIMPLE([_io], ['-I$(srcdir)/Modules/_io'], []) +PY_STDLIB_MOD_SIMPLE([time], [], [$TIMEMODULE_LIB]) dnl always enabled extension modules -PY_STDLIB_MOD_SIMPLE([time], [], [$TIMEMODULE_LIB]) -PY_STDLIB_MOD_SIMPLE([_datetime], [], [$TIMEMODULE_LIB]) +PY_STDLIB_MOD_SIMPLE([_datetime], [], [$TIMEMODULE_LIB $LIBM]) dnl platform specific extensions PY_STDLIB_MOD([ossaudiodev], @@ -6087,7 +6084,7 @@ fi echo "creating Makefile" >&AS_MESSAGE_FD $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ -s Modules \ - Modules/Setup.local $srcdir/Modules/Setup.core $srcdir/Modules/Setup + Modules/Setup.local $srcdir/Modules/Setup.bootstrap $srcdir/Modules/Setup mv config.c Modules if test -z "$PKG_CONFIG"; then diff --git a/setup.py b/setup.py index fb9fd2b498d55e..fc04efc77e19ed 100644 --- a/setup.py +++ b/setup.py @@ -1006,13 +1006,10 @@ def detect_simple_extensions(self): if lib: time_libs.append(lib) - # time operations and variables, always built by Modules/Setup.core - # self.add(Extension('time', ['timemodule.c'], - # libraries=time_libs)) + # time module is built by Modules/Setup.bootstrap # libm is needed by delta_new() that uses round() and by accum() that # uses modf(). - self.add(Extension('_datetime', ['_datetimemodule.c'], - libraries=['m'])) + self.addext(Extension('_datetime', ['_datetimemodule.c'])) # zoneinfo module self.add(Extension('_zoneinfo', ['_zoneinfo.c'])) # random number generator implemented in C @@ -1034,8 +1031,7 @@ def detect_simple_extensions(self): self.add(Extension('_opcode', ['_opcode.c'])) # asyncio speedups self.add(Extension("_asyncio", ["_asynciomodule.c"])) - # _abc speedups, always built by Modules/Setup.core - # self.add(Extension("_abc", ["_abc.c"])) + # _abc module is built by Modules/Setup.bootstrap # _queue module self.add(Extension("_queue", ["_queuemodule.c"])) # _statistics module @@ -1054,8 +1050,7 @@ def detect_simple_extensions(self): libs = ['bsd'] self.add(Extension('fcntl', ['fcntlmodule.c'], libraries=libs)) - # pwd(3), always built by Modules/Setup.core - # self.add(Extension('pwd', ['pwdmodule.c'])) + # pwd module is built by Modules/Setup.bootstrap # grp(3) if not VXWORKS: self.add(Extension('grp', ['grpmodule.c'])) From e11c9b65ea7b4c16c3ac265424c24cec1bd34632 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 19 Nov 2021 10:22:45 +0100 Subject: [PATCH 3/5] Fix comment --- Modules/Setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Setup b/Modules/Setup index 54abb17a4fd711..5a7c232d3c555e 100644 --- a/Modules/Setup +++ b/Modules/Setup @@ -112,7 +112,7 @@ PYTHONPATH=$(COREPYTHONPATH) # --- # Built-in modules required to get a functioning interpreter are listed in -# Modules/Setup.core. +# Modules/Setup.bootstrap. # --- # The rest of the modules listed in this file are all commented out by From e749a53c16573a9d516aaecf4f8307f7891ad8b1 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 19 Nov 2021 10:25:38 +0100 Subject: [PATCH 4/5] Single quotes don't work --- configure | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 9d03d89a241ef4..96005cb63aff05 100755 --- a/configure +++ b/configure @@ -19473,7 +19473,7 @@ else fi - as_fn_append MODULE_BLOCK "MODULE__IO_CFLAGS='-I$(srcdir)/Modules/_io'$as_nl" + as_fn_append MODULE_BLOCK "MODULE__IO_CFLAGS=-I\$(srcdir)/Modules/_io$as_nl" diff --git a/configure.ac b/configure.ac index d9f50c3e8b9e3d..d4c9bef4242656 100644 --- a/configure.ac +++ b/configure.ac @@ -6046,7 +6046,7 @@ AC_DEFUN([PY_STDLIB_MOD_SIMPLE], [ ]) dnl static modules in Modules/Setup.bootstrap -PY_STDLIB_MOD_SIMPLE([_io], ['-I$(srcdir)/Modules/_io'], []) +PY_STDLIB_MOD_SIMPLE([_io], [-I\$(srcdir)/Modules/_io], []) PY_STDLIB_MOD_SIMPLE([time], [], [$TIMEMODULE_LIB]) dnl always enabled extension modules From db3e45e1659767efc997c77c93f6c9611cfe3f94 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 19 Nov 2021 16:01:01 +0100 Subject: [PATCH 5/5] Consolidate comments about extensions in Setup.bootstrap --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index fc04efc77e19ed..0b7e7ab0a30613 100644 --- a/setup.py +++ b/setup.py @@ -1006,7 +1006,6 @@ def detect_simple_extensions(self): if lib: time_libs.append(lib) - # time module is built by Modules/Setup.bootstrap # libm is needed by delta_new() that uses round() and by accum() that # uses modf(). self.addext(Extension('_datetime', ['_datetimemodule.c'])) @@ -1031,7 +1030,6 @@ def detect_simple_extensions(self): self.add(Extension('_opcode', ['_opcode.c'])) # asyncio speedups self.add(Extension("_asyncio", ["_asynciomodule.c"])) - # _abc module is built by Modules/Setup.bootstrap # _queue module self.add(Extension("_queue", ["_queuemodule.c"])) # _statistics module @@ -1050,7 +1048,6 @@ def detect_simple_extensions(self): libs = ['bsd'] self.add(Extension('fcntl', ['fcntlmodule.c'], libraries=libs)) - # pwd module is built by Modules/Setup.bootstrap # grp(3) if not VXWORKS: self.add(Extension('grp', ['grpmodule.c'])) @@ -1505,6 +1502,9 @@ def detect_modules(self): self.configure_compiler() self.init_inc_lib_dirs() + # Some C extensions are built by entries in Modules/Setup.bootstrap. + # These are extensions are required to bootstrap the interpreter or + # build process. self.detect_simple_extensions() if TEST_EXTENSIONS: self.detect_test_extensions()