This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ./configure, pydebug and pymalloc
Type: Stage:
Components: Build Versions:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: dilyan.palauzov, vstinner
Priority: normal Keywords:

Created on 2017-05-07 07:58 by dilyan.palauzov, last changed 2022-04-11 14:58 by admin.

Messages (2)
msg293182 - (view) Author: Дилян Палаузов (dilyan.palauzov) Date: 2017-05-07 07:58
Providing that during ./configure Py_DEBUG can either be set or not, but there is no third state, which third state would justify calling ./configure --with-pydebug=lambda, --with-pydebug shall be renamed to --enable-pydebug .

Likewise for --with-pymalloc , but it is more tricky.  Currently ./configure --help emits "--with(out)-pymalloc    disable/enable specialized mallocs".  Usually from the output of ./configure --help one shall be able to conclude, whether a switch is on or off by default, if it is not provided.  E.g. if it is by default off, then "--enable-X   enable feature X" is printed; and "--disable-Y disable feature-Y" is printed when by default the feature is on.

The code says, that if pymalloc is enabled implicitly, if neither --with-pymalloc nor --without-pymalloc is provided.  Let's update the AS_HELP_STRING to show the default and also shorten the code, which makes it also easier to understand (for me at least)
which makes it also easier to understand (for me at least):

diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -3290,12 +3290,7 @@ AC_MSG_RESULT($with_doc_strings)
 # Check for Python-specific malloc support
 AC_MSG_CHECKING(for --with-pymalloc)
 AC_ARG_WITH(pymalloc,
-            AS_HELP_STRING([--with(out)-pymalloc], [disable/enable specialized mallocs]))
-
-if test -z "$with_pymalloc"
-then
-    with_pymalloc="yes"
-fi
+            AS_HELP_STRING([--without-pymalloc], [disable specialized mallocs]),,with_pymalloc=yes)
 if test "$with_pymalloc" != "no"
 then
     AC_DEFINE(WITH_PYMALLOC, 1,

configure.ac:4629  mentions "# * --with-wide-unicode (adds a 'u')", but since commit d63a3b8beb4a0841cb59fb3515347ccaab34b733 "Implement PEP 393", one cannot pass --with-wide-unicode to ./configure.
msg293183 - (view) Author: Дилян Палаузов (dilyan.palauzov) Date: 2017-05-07 08:12
./configure --help also does not indicate, whether just "./configure" enables or disables IPv6, thread support, dtrace*, computed-gotos*, doc-strings*.

The asterisk features, suggest replacing AC_ARG_WITH with AC_ARG_ENABLE, as there are only two states.

For ensurepip, AS_HELP_STRING shall be "[--with-ensurepip=@<:@=upgrade@:>@]".

AC_ARG_WITH(lto, AS_HELP_STRING([--with-lto], [Enable Link Time Optimization in PGO builds. Disabled by default.]),

Here you see the whole point of the logic, that by inspecting the "--with-"/"--without-" status of ./configure --help, one can conclude what the defaults are.  "Disabled by default" is redundant.
History
Date User Action Args
2022-04-11 14:58:46adminsetgithub: 74480
2017-05-11 00:36:56vstinnersetnosy: + vstinner
2017-05-07 08:12:35dilyan.palauzovsetmessages: + msg293183
2017-05-07 07:58:03dilyan.palauzovcreate