From 9cc3b30532844f6c082a4c00e1d2e44dd3ca2051 Mon Sep 17 00:00:00 2001 From: pxin Date: Tue, 22 Dec 2020 17:59:32 +0800 Subject: [PATCH 01/14] Add --enable-test-modules option for configure --- Makefile.pre.in | 58 ++++++++++++------- .../2020-12-22-17-57-04.bpo-31904.j3a8r0.rst | 1 + configure | 17 ++++++ configure.ac | 8 +++ setup.py | 3 +- 5 files changed, 65 insertions(+), 22 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2020-12-22-17-57-04.bpo-31904.j3a8r0.rst diff --git a/Makefile.pre.in b/Makefile.pre.in index 69ed251936a605..98491e15b62021 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1365,8 +1365,29 @@ maninstall: altmaninstall # Install the library XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax -LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ - tkinter/test/test_ttk site-packages test \ +LIBSUBDIRS= tkinter \ + site-packages \ + importlib \ + importlib/metadata \ + asyncio \ + collections concurrent concurrent/futures encodings \ + email email/mime \ + ensurepip ensurepip/_bundled \ + html json http dbm xmlrpc \ + sqlite3 \ + logging csv wsgiref urllib \ + lib2to3 lib2to3/fixes lib2to3/pgen2 \ + ctypes ctypes/macholib \ + idlelib idlelib/Icons \ + distutils distutils/command $(XMLLIBSUBDIRS) \ + turtledemo \ + multiprocessing multiprocessing/dummy \ + unittest \ + venv venv/scripts venv/scripts/common venv/scripts/posix \ + curses pydoc_data \ + zoneinfo +TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ + tkinter/test/test_ttk test \ test/audiodata \ test/capath test/data \ test/cjkencodings test/decimaltestdata \ @@ -1384,8 +1405,6 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ test/test_import/data/package \ test/test_import/data/package2 \ test/test_import/data/unwritable \ - importlib \ - importlib/metadata \ test/test_importlib \ test/test_importlib/builtin \ test/test_importlib/data \ @@ -1426,28 +1445,25 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ test/test_importlib/zipdata02 \ test/test_zoneinfo test/test_zoneinfo/data \ test/ziptestdata \ - asyncio \ test/test_asyncio \ - collections concurrent concurrent/futures encodings \ - email email/mime test/test_email test/test_email/data \ - ensurepip ensurepip/_bundled \ - html json test/test_json http dbm xmlrpc \ - sqlite3 sqlite3/test \ - logging csv wsgiref urllib \ - lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \ + test/test_email test/test_email/data \ + test/test_json \ + sqlite3/test \ + lib2to3/tests \ lib2to3/tests/data lib2to3/tests/data/fixers \ lib2to3/tests/data/fixers/myfixes \ - ctypes ctypes/test ctypes/macholib \ - idlelib idlelib/Icons idlelib/idle_test \ - distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \ + ctypes/test \ + idlelib/idle_test \ + distutils/tests \ test/test_peg_generator \ test/test_tools test/test_warnings test/test_warnings/data \ - turtledemo \ - multiprocessing multiprocessing/dummy \ - unittest unittest/test unittest/test/testmock \ - venv venv/scripts venv/scripts/common venv/scripts/posix \ - curses pydoc_data \ - zoneinfo + unittest/test unittest/test/testmock + +TEST_MODULES=@TEST_MODULES@ +ifeq ($(TEST_MODULES),yes) +LIBSUBDIRS += $(TESTSUBDIRS) +endif + libinstall: build_all $(srcdir)/Modules/xxmodule.c @for i in $(SCRIPTDIR) $(LIBDEST); \ do \ diff --git a/Misc/NEWS.d/next/Build/2020-12-22-17-57-04.bpo-31904.j3a8r0.rst b/Misc/NEWS.d/next/Build/2020-12-22-17-57-04.bpo-31904.j3a8r0.rst new file mode 100644 index 00000000000000..7835bdfae5c3cb --- /dev/null +++ b/Misc/NEWS.d/next/Build/2020-12-22-17-57-04.bpo-31904.j3a8r0.rst @@ -0,0 +1 @@ +Add --enable-test-modules option for configure. diff --git a/configure b/configure index f07edfff266a0e..aed2af9305961b 100755 --- a/configure +++ b/configure @@ -623,6 +623,7 @@ ac_includes_default="\ #endif" ac_subst_vars='LTLIBOBJS +TEST_MODULES OPENSSL_LDFLAGS OPENSSL_LIBS OPENSSL_INCLUDES @@ -852,6 +853,7 @@ with_openssl with_ssl_default_suites with_builtin_hashlib_hashes with_experimental_isolated_subinterpreters +enable_test_modules ' ac_precious_vars='build_alias host_alias @@ -1503,6 +1505,7 @@ Optional Features: --enable-big-digits[=15|30] use big digits (30 or 15 bits) for Python longs (default is system-dependent)] + --enable-test-modules enable test modules (default is yes) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -17723,6 +17726,20 @@ $as_echo "no" >&6; } fi +# check whether to disable test modules +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-test-modules" >&5 +$as_echo_n "checking for --enable-test-modules... " >&6; } +# Check whether --enable-test-modules was given. +if test "${enable_test_modules+set}" = set; then : + enableval=$enable_test_modules; TEST_MODULES="${enableval}" +else + TEST_MODULES=yes +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_test_modules" >&5 +$as_echo "$enable_test_modules" >&6; } + # generate output files ac_config_files="$ac_config_files Makefile.pre Misc/python.pc Misc/python-embed.pc Misc/python-config.sh" diff --git a/configure.ac b/configure.ac index ee5573cf644316..67d80b5882676b 100644 --- a/configure.ac +++ b/configure.ac @@ -5833,6 +5833,14 @@ else fi], [AC_MSG_RESULT(no)]) +# check whether to disable test modules +AC_MSG_CHECKING(for --enable-test-modules) +AC_ARG_ENABLE(test-modules, + AS_HELP_STRING([--enable-test-modules], [enable test modules (default is yes)]), + [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ]) +AC_SUBST(TEST_MODULES) +AC_MSG_RESULT($enable_test_modules) + # generate output files AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-embed.pc Misc/python-config.sh) diff --git a/setup.py b/setup.py index e055e44b0f1750..14077afa64dfd3 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,8 @@ # Compile extensions used to test Python? -TEST_EXTENSIONS = True +ENABLE_TEST_MODULES = (sysconfig.get_config_var('TEST_MODULES') == 'yes') +TEST_EXTENSIONS = (True if ENABLE_TEST_MODULES else False) # This global variable is used to hold the list of modules to be disabled. DISABLED_MODULE_LIST = [] From 9a2fcad6153ff03575e3e681b1ad5bd7d6ba6974 Mon Sep 17 00:00:00 2001 From: pxin Date: Thu, 24 Dec 2020 15:58:05 +0800 Subject: [PATCH 02/14] fix no result issues when checking --- configure | 13 ++++++++----- configure.ac | 10 +++++++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/configure b/configure index aed2af9305961b..d40a23e0884306 100755 --- a/configure +++ b/configure @@ -17731,14 +17731,17 @@ fi $as_echo_n "checking for --enable-test-modules... " >&6; } # Check whether --enable-test-modules was given. if test "${enable_test_modules+set}" = set; then : - enableval=$enable_test_modules; TEST_MODULES="${enableval}" -else - TEST_MODULES=yes + enableval=$enable_test_modules; fi +if test "$enable_test_modules" = no; then + TEST_MODULES=no +else + TEST_MODULES=yes +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_test_modules" >&5 -$as_echo "$enable_test_modules" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEST_MODULES" >&5 +$as_echo "$TEST_MODULES" >&6; } # generate output files diff --git a/configure.ac b/configure.ac index 67d80b5882676b..66a18aa15f18e0 100644 --- a/configure.ac +++ b/configure.ac @@ -5836,10 +5836,14 @@ fi], # check whether to disable test modules AC_MSG_CHECKING(for --enable-test-modules) AC_ARG_ENABLE(test-modules, - AS_HELP_STRING([--enable-test-modules], [enable test modules (default is yes)]), - [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ]) + AS_HELP_STRING([--enable-test-modules], [enable test modules (default is yes)])) +if test "$enable_test_modules" = no; then + TEST_MODULES=no +else + TEST_MODULES=yes +fi AC_SUBST(TEST_MODULES) -AC_MSG_RESULT($enable_test_modules) +AC_MSG_RESULT($TEST_MODULES) # generate output files From 3031f4264aa5a9f45b84f8dfadb58597e608f4d1 Mon Sep 17 00:00:00 2001 From: pxinwr Date: Mon, 28 Dec 2020 16:23:20 +0800 Subject: [PATCH 03/14] Update setup.py Co-authored-by: Victor Stinner --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 14077afa64dfd3..8598d2aa5dbceb 100644 --- a/setup.py +++ b/setup.py @@ -41,8 +41,7 @@ # Compile extensions used to test Python? -ENABLE_TEST_MODULES = (sysconfig.get_config_var('TEST_MODULES') == 'yes') -TEST_EXTENSIONS = (True if ENABLE_TEST_MODULES else False) +TEST_EXTENSIONS = (sysconfig.get_config_var('TEST_MODULES') == 'yes') # This global variable is used to hold the list of modules to be disabled. DISABLED_MODULE_LIST = [] From c4f193f541f693cac093976a33aebb6888145eed Mon Sep 17 00:00:00 2001 From: pxin Date: Mon, 28 Dec 2020 21:31:09 +0800 Subject: [PATCH 04/14] rename news file --- ...-31904.j3a8r0.rst => 2020-12-22-17-57-04.bpo-27640.j3a8r0.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Misc/NEWS.d/next/Build/{2020-12-22-17-57-04.bpo-31904.j3a8r0.rst => 2020-12-22-17-57-04.bpo-27640.j3a8r0.rst} (100%) diff --git a/Misc/NEWS.d/next/Build/2020-12-22-17-57-04.bpo-31904.j3a8r0.rst b/Misc/NEWS.d/next/Build/2020-12-22-17-57-04.bpo-27640.j3a8r0.rst similarity index 100% rename from Misc/NEWS.d/next/Build/2020-12-22-17-57-04.bpo-31904.j3a8r0.rst rename to Misc/NEWS.d/next/Build/2020-12-22-17-57-04.bpo-27640.j3a8r0.rst From 96bd20c95a080bca0f6f44678dffd07577cdd046 Mon Sep 17 00:00:00 2001 From: pxin Date: Mon, 28 Dec 2020 21:33:11 +0800 Subject: [PATCH 05/14] add info in whatsnew --- Doc/whatsnew/3.10.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index a6f9b0b1754d29..5c77fcda8af87f 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -553,6 +553,11 @@ Build Changes * The :mod:`atexit` module must now always be built as a built-in module. (Contributed by Victor Stinner in :issue:`42639`.) +* Added ``--enable-test-modules`` option to the ``configure`` script. If this + option is set to no, ``make install`` will not install test suites. Also setup.py + will not build test extension modules. + (Contributed by Peixing Xin in :issue:`27640`.) + C API Changes ============= From c6550757c7efe431e18b53782b102a1b15ea0cda Mon Sep 17 00:00:00 2001 From: pxin Date: Mon, 28 Dec 2020 21:34:23 +0800 Subject: [PATCH 06/14] elaborate the --enable-test-modules in comments --- configure.ac | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 66a18aa15f18e0..ccd6c76a445558 100644 --- a/configure.ac +++ b/configure.ac @@ -5833,7 +5833,9 @@ else fi], [AC_MSG_RESULT(no)]) -# check whether to disable test modules +# Check whether to enable test modules. Any values other than no will be treated as yes. +# If this option is set to no, "make install" will not install test suites. Also setup.py +# will not build test extension modules. AC_MSG_CHECKING(for --enable-test-modules) AC_ARG_ENABLE(test-modules, AS_HELP_STRING([--enable-test-modules], [enable test modules (default is yes)])) From cd21bd6169e87db9e4790072f0334ab97206c385 Mon Sep 17 00:00:00 2001 From: pxin Date: Mon, 28 Dec 2020 21:35:28 +0800 Subject: [PATCH 07/14] sort the directories listed in LIBSUBDIRS and TESTSUBDIRS --- Makefile.pre.in | 105 ++++++++++++++++++++++++++++-------------------- 1 file changed, 61 insertions(+), 44 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in index 98491e15b62021..b0c370360e5ae0 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1365,39 +1365,54 @@ maninstall: altmaninstall # Install the library XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax -LIBSUBDIRS= tkinter \ - site-packages \ - importlib \ - importlib/metadata \ - asyncio \ - collections concurrent concurrent/futures encodings \ +LIBSUBDIRS= asyncio \ + collections \ + concurrent concurrent/futures \ + csv \ + ctypes ctypes/macholib \ + curses \ + dbm \ + distutils distutils/command \ email email/mime \ + encodings \ ensurepip ensurepip/_bundled \ - html json http dbm xmlrpc \ - sqlite3 \ - logging csv wsgiref urllib \ - lib2to3 lib2to3/fixes lib2to3/pgen2 \ - ctypes ctypes/macholib \ + html \ + http \ idlelib idlelib/Icons \ - distutils distutils/command $(XMLLIBSUBDIRS) \ - turtledemo \ + importlib importlib/metadata \ + json \ + lib2to3 lib2to3/fixes lib2to3/pgen2 \ + logging \ multiprocessing multiprocessing/dummy \ + pydoc_data \ + site-packages \ + sqlite3 \ + tkinter \ + turtledemo \ unittest \ + urllib \ venv venv/scripts venv/scripts/common venv/scripts/posix \ - curses pydoc_data \ + wsgiref \ + $(XMLLIBSUBDIRS) \ + xmlrpc \ zoneinfo -TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ - tkinter/test/test_ttk test \ - test/audiodata \ - test/capath test/data \ - test/cjkencodings test/decimaltestdata \ - test/xmltestdata test/xmltestdata/c14n-20 \ - test/dtracedata \ - test/eintrdata \ - test/imghdrdata \ - test/libregrtest \ - test/subprocessdata test/sndhdrdata test/support \ - test/tracedmodules test/encoded_modules \ +TESTSUBDIRS= ctypes/test \ + distutils/tests \ + idlelib/idle_test \ + lib2to3/tests \ + lib2to3/tests/data \ + lib2to3/tests/data/fixers \ + lib2to3/tests/data/fixers/myfixes \ + sqlite3/test \ + test test/audiodata \ + test/capath test/cjkencodings \ + test/data test/decimaltestdata \ + test/dtracedata test/eintrdata \ + test/encoded_modules test/imghdrdata \ + test/libregrtest test/sndhdrdata \ + test/subprocessdata test/support \ + test/test_asyncio \ + test/test_email test/test_email/data \ test/test_import \ test/test_import/data \ test/test_import/data/circular_imports \ @@ -1443,27 +1458,19 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ test/test_importlib/source \ test/test_importlib/zipdata01 \ test/test_importlib/zipdata02 \ - test/test_zoneinfo test/test_zoneinfo/data \ - test/ziptestdata \ - test/test_asyncio \ - test/test_email test/test_email/data \ test/test_json \ - sqlite3/test \ - lib2to3/tests \ - lib2to3/tests/data lib2to3/tests/data/fixers \ - lib2to3/tests/data/fixers/myfixes \ - ctypes/test \ - idlelib/idle_test \ - distutils/tests \ test/test_peg_generator \ - test/test_tools test/test_warnings test/test_warnings/data \ + test/test_tools \ + test/test_warnings test/test_warnings/data \ + test/test_zoneinfo test/test_zoneinfo/data \ + test/tracedmodules \ + test/xmltestdata test/xmltestdata/c14n-20 \ + test/ziptestdata \ + tkinter/test tkinter/test/test_tkinter \ + tkinter/test/test_ttk \ unittest/test unittest/test/testmock TEST_MODULES=@TEST_MODULES@ -ifeq ($(TEST_MODULES),yes) -LIBSUBDIRS += $(TESTSUBDIRS) -endif - libinstall: build_all $(srcdir)/Modules/xxmodule.c @for i in $(SCRIPTDIR) $(LIBDEST); \ do \ @@ -1473,7 +1480,12 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c else true; \ fi; \ done - @for d in $(LIBSUBDIRS); \ + @if test "$(TEST_MODULES)" = yes; then \ + subdirs="$(LIBSUBDIRS) $(TESTSUBDIRS)"; \ + else \ + subdirs="$(LIBSUBDIRS)"; \ + fi; \ + for d in $$subdirs; \ do \ a=$(srcdir)/Lib/$$d; \ if test ! -d $$a; then continue; else true; fi; \ @@ -1494,7 +1506,12 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c echo $(INSTALL_DATA) $$i $(LIBDEST); \ fi; \ done - @for d in $(LIBSUBDIRS); \ + @if test "$(TEST_MODULES)" = yes; then \ + subdirs="$(LIBSUBDIRS) $(TESTSUBDIRS)"; \ + else \ + subdirs="$(LIBSUBDIRS)"; \ + fi; \ + for d in $$subdirs; \ do \ a=$(srcdir)/Lib/$$d; \ if test ! -d $$a; then continue; else true; fi; \ From f48d197a593735883d937606fd04fd1358745c0f Mon Sep 17 00:00:00 2001 From: pxin Date: Mon, 28 Dec 2020 21:38:56 +0800 Subject: [PATCH 08/14] regenerate configure --- configure | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure b/configure index d40a23e0884306..f0e7986d002e0b 100755 --- a/configure +++ b/configure @@ -17726,7 +17726,9 @@ $as_echo "no" >&6; } fi -# check whether to disable test modules +# Check whether to enable test modules. Any values other than no will be treated as yes. +# If this option is set to no, "make install" will not install test suites. Also setup.py +# will not build test extension modules. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-test-modules" >&5 $as_echo_n "checking for --enable-test-modules... " >&6; } # Check whether --enable-test-modules was given. From 2d5f0e304998d7db1520c5ad55229160fdf71356 Mon Sep 17 00:00:00 2001 From: pxin Date: Mon, 28 Dec 2020 22:01:46 +0800 Subject: [PATCH 09/14] update news --- .../next/Build/2020-12-22-17-57-04.bpo-27640.j3a8r0.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Build/2020-12-22-17-57-04.bpo-27640.j3a8r0.rst b/Misc/NEWS.d/next/Build/2020-12-22-17-57-04.bpo-27640.j3a8r0.rst index 7835bdfae5c3cb..965684b496cd8e 100644 --- a/Misc/NEWS.d/next/Build/2020-12-22-17-57-04.bpo-27640.j3a8r0.rst +++ b/Misc/NEWS.d/next/Build/2020-12-22-17-57-04.bpo-27640.j3a8r0.rst @@ -1 +1,3 @@ -Add --enable-test-modules option for configure. +Added ``--enable-test-modules`` option to the ``configure`` script. If this +option is set to no, ``make install`` will not install test suites. Also +setup.py will not build test extension modules. From 17c08ddf52d173e3f3515cf0f06c890579baa2f4 Mon Sep 17 00:00:00 2001 From: pxinwr Date: Wed, 30 Dec 2020 14:15:50 +0800 Subject: [PATCH 10/14] Improve Doc/whatsnew/3.10.rst Co-authored-by: Victor Stinner --- Doc/whatsnew/3.10.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 5c77fcda8af87f..104f41f745cfc2 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -553,9 +553,8 @@ Build Changes * The :mod:`atexit` module must now always be built as a built-in module. (Contributed by Victor Stinner in :issue:`42639`.) -* Added ``--enable-test-modules`` option to the ``configure`` script. If this - option is set to no, ``make install`` will not install test suites. Also setup.py - will not build test extension modules. +* Added ``--disable-test-modules`` option to the ``configure`` script: + don't build nor install test modules. (Contributed by Peixing Xin in :issue:`27640`.) From cdd5fa67d07e5bc2874224238d8a2ba87c8daf0b Mon Sep 17 00:00:00 2001 From: pxinwr Date: Wed, 30 Dec 2020 14:22:01 +0800 Subject: [PATCH 11/14] credit Xavier de Gaye and Thomas Petazzoni in Doc/whatsnew/3.10.rst Co-Authored-By: Thomas Petazzoni Co-Authored-By: Xavier de Gaye Co-authored-by: Victor Stinner --- Doc/whatsnew/3.10.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 104f41f745cfc2..bd0755a855e631 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -555,7 +555,7 @@ Build Changes * Added ``--disable-test-modules`` option to the ``configure`` script: don't build nor install test modules. - (Contributed by Peixing Xin in :issue:`27640`.) + (Contributed by Xavier de Gaye, Thomas Petazzoni and Peixing Xin in :issue:`27640`.) C API Changes From 23daf7a9d17361f20aab7cb84867340af1ef5d61 Mon Sep 17 00:00:00 2001 From: pxinwr Date: Wed, 30 Dec 2020 14:48:18 +0800 Subject: [PATCH 12/14] improve help string for the added option Co-authored-by: Victor Stinner --- configure.ac | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index ccd6c76a445558..108f2452012fc3 100644 --- a/configure.ac +++ b/configure.ac @@ -5838,7 +5838,7 @@ fi], # will not build test extension modules. AC_MSG_CHECKING(for --enable-test-modules) AC_ARG_ENABLE(test-modules, - AS_HELP_STRING([--enable-test-modules], [enable test modules (default is yes)])) + AS_HELP_STRING([--disable-test-modules], [don't build nor install test modules])) if test "$enable_test_modules" = no; then TEST_MODULES=no else @@ -5873,4 +5873,3 @@ if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then echo "" >&AS_MESSAGE_FD echo "" >&AS_MESSAGE_FD fi - From 90e411405072249945e8249c15d99f0fe98e9bba Mon Sep 17 00:00:00 2001 From: pxin Date: Wed, 30 Dec 2020 19:04:18 +0800 Subject: [PATCH 13/14] change the help and message for the new option --- configure | 18 +++++++++--------- configure.ac | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/configure b/configure index f0e7986d002e0b..da4f1b94628fdb 100755 --- a/configure +++ b/configure @@ -1505,7 +1505,7 @@ Optional Features: --enable-big-digits[=15|30] use big digits (30 or 15 bits) for Python longs (default is system-dependent)] - --enable-test-modules enable test modules (default is yes) + --disable-test-modules don't build nor install test modules Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -17726,11 +17726,10 @@ $as_echo "no" >&6; } fi -# Check whether to enable test modules. Any values other than no will be treated as yes. -# If this option is set to no, "make install" will not install test suites. Also setup.py -# will not build test extension modules. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-test-modules" >&5 -$as_echo_n "checking for --enable-test-modules... " >&6; } +# Check whether to disable test modules. Once set, setup.py will not build +# test extension modules and "make install" will not install test suites. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --disable-test-modules" >&5 +$as_echo_n "checking for --disable-test-modules... " >&6; } # Check whether --enable-test-modules was given. if test "${enable_test_modules+set}" = set; then : enableval=$enable_test_modules; @@ -17738,12 +17737,14 @@ fi if test "$enable_test_modules" = no; then TEST_MODULES=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else TEST_MODULES=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEST_MODULES" >&5 -$as_echo "$TEST_MODULES" >&6; } # generate output files @@ -19071,4 +19072,3 @@ if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then echo "" >&6 echo "" >&6 fi - diff --git a/configure.ac b/configure.ac index 108f2452012fc3..2823079cdc2865 100644 --- a/configure.ac +++ b/configure.ac @@ -5833,19 +5833,19 @@ else fi], [AC_MSG_RESULT(no)]) -# Check whether to enable test modules. Any values other than no will be treated as yes. -# If this option is set to no, "make install" will not install test suites. Also setup.py -# will not build test extension modules. -AC_MSG_CHECKING(for --enable-test-modules) +# Check whether to disable test modules. Once set, setup.py will not build +# test extension modules and "make install" will not install test suites. +AC_MSG_CHECKING(for --disable-test-modules) AC_ARG_ENABLE(test-modules, AS_HELP_STRING([--disable-test-modules], [don't build nor install test modules])) if test "$enable_test_modules" = no; then TEST_MODULES=no + AC_MSG_RESULT(yes) else TEST_MODULES=yes + AC_MSG_RESULT(no) fi AC_SUBST(TEST_MODULES) -AC_MSG_RESULT($TEST_MODULES) # generate output files From 9e5dada24bcbcd9402a26258825909c348915552 Mon Sep 17 00:00:00 2001 From: pxin Date: Wed, 30 Dec 2020 19:05:09 +0800 Subject: [PATCH 14/14] credit Xavier and Thomas in news --- .../next/Build/2020-12-22-17-57-04.bpo-27640.j3a8r0.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Misc/NEWS.d/next/Build/2020-12-22-17-57-04.bpo-27640.j3a8r0.rst b/Misc/NEWS.d/next/Build/2020-12-22-17-57-04.bpo-27640.j3a8r0.rst index 965684b496cd8e..142590d05ef85b 100644 --- a/Misc/NEWS.d/next/Build/2020-12-22-17-57-04.bpo-27640.j3a8r0.rst +++ b/Misc/NEWS.d/next/Build/2020-12-22-17-57-04.bpo-27640.j3a8r0.rst @@ -1,3 +1,3 @@ -Added ``--enable-test-modules`` option to the ``configure`` script. If this -option is set to no, ``make install`` will not install test suites. Also -setup.py will not build test extension modules. +Added ``--disable-test-modules`` option to the ``configure`` script: +don't build nor install test modules. +Patch by Xavier de Gaye, Thomas Petazzoni and Peixing Xin.