Skip to content

Commit abdd4c6

Browse files
johnslavikhugovk
andauthored
Recommend --config-cache for ./configure (#1794)
* gh-1547: Recommend --config-cache for configure Add ``--config-cache`` to all relevant ``./configure`` invocations in the front page and setup-building guide, matching what the WASM commands already do. Add a brief explanation noting that ``config.cache`` should be deleted when switching compilers or significantly changing the build environment. * gh-1547: Also mention --cache-file=config.cache alias * gh-1547: Remove --config-cache from platform-specific configure commands * gh-1547: Restructure --config-cache as optional speedup tip * gh-1547: Use tip admonition for --config-cache * gh-1547: Add --config-cache to macOS platform-specific configure commands * Apply suggestions from review Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com> --------- Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent f9c78a9 commit abdd4c6

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

getting-started/setup-building.rst

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,15 @@ Configuration is typically::
191191
More flags are available to ``configure``, but this is the minimum you should
192192
do to get a pydebug build of CPython.
193193

194+
.. tip::
195+
To speed up repeated ``configure`` runs, use ``--config-cache`` (equivalent to ``--cache-file=config.cache``, short: ``-C``)::
196+
197+
$ ./configure --config-cache --with-pydebug
198+
199+
This caches results in a :file:`config.cache` file. If you switch compilers or
200+
significantly change your build environment, delete :file:`config.cache` before
201+
re-running ``configure``.
202+
194203
.. note::
195204
You might need to run ``make clean`` before or after re-running ``configure``
196205
in a particular build directory.
@@ -856,7 +865,8 @@ some of CPython's modules (for example, ``zlib``).
856865

857866
$ GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
858867
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
859-
./configure --with-pydebug \
868+
./configure --config-cache \
869+
--with-pydebug \
860870
--with-openssl="$(brew --prefix openssl@3)"
861871

862872
.. tab:: Python 3.10
@@ -865,7 +875,8 @@ some of CPython's modules (for example, ``zlib``).
865875

866876
$ CPPFLAGS="-I$(brew --prefix gdbm)/include -I$(brew --prefix xz)/include" \
867877
LDFLAGS="-L$(brew --prefix gdbm)/lib -L$(brew --prefix xz)/lib" \
868-
./configure --with-pydebug \
878+
./configure --config-cache \
879+
--with-pydebug \
869880
--with-openssl="$(brew --prefix openssl@3)" \
870881
--with-tcltk-libs="$(pkg-config --libs tcl tk)" \
871882
--with-tcltk-includes="$(pkg-config --cflags tcl tk)" \
@@ -887,7 +898,8 @@ some of CPython's modules (for example, ``zlib``).
887898

888899
$ GDBM_CFLAGS="-I$(dirname $(dirname $(which port)))/include" \
889900
GDBM_LIBS="-L$(dirname $(dirname $(which port)))/lib -lgdbm" \
890-
./configure --with-pydebug \
901+
./configure --config-cache \
902+
--with-pydebug \
891903
--with-system-libmpdec
892904

893905
.. tab:: Python 3.11-3.12
@@ -896,7 +908,8 @@ some of CPython's modules (for example, ``zlib``).
896908

897909
$ GDBM_CFLAGS="-I$(dirname $(dirname $(which port)))/include" \
898910
GDBM_LIBS="-L$(dirname $(dirname $(which port)))/lib -lgdbm" \
899-
./configure --with-pydebug
911+
./configure --config-cache \
912+
--with-pydebug
900913

901914
And finally, run ``make``::
902915

index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ instructions please see the :ref:`setup guide <setup>`.
9595

9696
.. code-block:: shell
9797
98-
./configure --with-pydebug && make -j $(nproc)
98+
./configure --config-cache --with-pydebug && make -j $(nproc)
9999
100100
.. tab:: macOS
101101

102102
.. code-block:: shell
103103
104-
./configure --with-pydebug && make -j8
104+
./configure --config-cache --with-pydebug && make -j8
105105
106106
.. tab:: Windows
107107

0 commit comments

Comments
 (0)