Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
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.
  • Loading branch information
johnslavik committed Apr 22, 2026
commit 30a3410ad2186c365914e20a583b979dc3fb9c88
21 changes: 15 additions & 6 deletions getting-started/setup-building.rst
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you click macOS from the front page:

See also more detailed instructions, how to install and build dependencies, and the platform-specific pages for Unix, macOS, and Windows.

That takes you to this tab:

https://cpython-devguide--1794.org.readthedocs.build/getting-started/setup-building/#macos

Which includes this (and a 3.10 version):

$ GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
   GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
   ./configure --with-pydebug \
               --with-openssl="$(brew --prefix openssl@3)"

Let's include --config-cache in those:

$ GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
   GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
   ./configure --config-cache \
               --with-pydebug \
               --with-openssl="$(brew --prefix openssl@3)"

Copy link
Copy Markdown
Member Author

@johnslavik johnslavik Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I just reverted that in 69463e6. If you want me to add these back, I'll add.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add it back, it's good to have useful snippets because people will copy and paste them (at least I do :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added back to all 4 (brew, macports).

Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,12 @@ for development is to configure it and then compile it.

Configuration is typically::

$ ./configure --with-pydebug
$ ./configure --config-cache --with-pydebug

The ``--config-cache`` (``-C``) option speeds up repeated ``configure`` runs
by caching results in a ``config.cache`` file. If you switch compilers or
significantly change your build environment, delete ``config.cache`` before
re-running ``configure``.

More flags are available to ``configure``, but this is the minimum you should
do to get a pydebug build of CPython.
Expand Down Expand Up @@ -283,7 +288,7 @@ to learn more about these options.

.. code:: console

$ ./configure --enable-optimizations --with-lto
$ ./configure --config-cache --enable-optimizations --with-lto

.. _windows-compiling:

Expand Down Expand Up @@ -864,7 +869,8 @@ some of CPython's modules (for example, ``zlib``).

$ GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
./configure --with-pydebug \
./configure --config-cache \
--with-pydebug \
--with-openssl="$(brew --prefix openssl@3)"

.. tab:: Python 3.10
Expand All @@ -873,7 +879,8 @@ some of CPython's modules (for example, ``zlib``).

$ CPPFLAGS="-I$(brew --prefix gdbm)/include -I$(brew --prefix xz)/include" \
LDFLAGS="-L$(brew --prefix gdbm)/lib -L$(brew --prefix xz)/lib" \
./configure --with-pydebug \
./configure --config-cache \
--with-pydebug \
--with-openssl="$(brew --prefix openssl@3)" \
--with-tcltk-libs="$(pkg-config --libs tcl tk)" \
--with-tcltk-includes="$(pkg-config --cflags tcl tk)" \
Expand All @@ -895,7 +902,8 @@ some of CPython's modules (for example, ``zlib``).

$ GDBM_CFLAGS="-I$(dirname $(dirname $(which port)))/include" \
GDBM_LIBS="-L$(dirname $(dirname $(which port)))/lib -lgdbm" \
./configure --with-pydebug \
./configure --config-cache \
--with-pydebug \
--with-system-libmpdec

.. tab:: Python 3.11-3.12
Expand All @@ -904,7 +912,8 @@ some of CPython's modules (for example, ``zlib``).

$ GDBM_CFLAGS="-I$(dirname $(dirname $(which port)))/include" \
GDBM_LIBS="-L$(dirname $(dirname $(which port)))/lib -lgdbm" \
./configure --with-pydebug
./configure --config-cache \
--with-pydebug

And finally, run ``make``::

Expand Down
4 changes: 2 additions & 2 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ instructions please see the :ref:`setup guide <setup>`.

.. code-block:: shell

./configure --with-pydebug && make -j $(nproc)
./configure --config-cache --with-pydebug && make -j $(nproc)

.. tab:: macOS

.. code-block:: shell

./configure --with-pydebug && make -j8
./configure --config-cache --with-pydebug && make -j8

.. tab:: Windows

Expand Down