From 86ca5e56a4b376dda485d56edf520c4874a13afa Mon Sep 17 00:00:00 2001 From: jamesclement1776 Date: Thu, 4 Dec 2025 13:33:51 -0600 Subject: [PATCH] Document quick compile check steps --- Python/compile.c | 6 ++++-- README.rst | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Python/compile.c b/Python/compile.c index fbdc944110b2dd..0c1a908841f308 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -137,7 +137,8 @@ compiler_setup(compiler *c, mod_ty mod, PyObject *filename, c->c_optimize = (optimize == -1) ? _Py_GetConfig()->optimization_level : optimize; c->c_save_nested_seqs = false; - if (!_PyAST_Preprocess(mod, arena, filename, c->c_optimize, merged, 0)) { + if (!_PyAST_Preprocess(mod, arena, filename, + c->c_optimize, merged, 0, 1)) { return ERROR; } c->c_st = _PySymtable_Build(mod, filename, &c->c_future); @@ -1518,7 +1519,8 @@ _PyCompile_AstPreprocess(mod_ty mod, PyObject *filename, PyCompilerFlags *cf, if (optimize == -1) { optimize = _Py_GetConfig()->optimization_level; } - if (!_PyAST_Preprocess(mod, arena, filename, optimize, flags, no_const_folding)) { + if (!_PyAST_Preprocess(mod, arena, filename, + optimize, flags, no_const_folding, 1)) { return -1; } return 0; diff --git a/README.rst b/README.rst index b68849a1a79235..51bc041ec57835 100644 --- a/README.rst +++ b/README.rst @@ -57,6 +57,12 @@ On Unix, Linux, BSD, macOS, and Cygwin:: This will install Python as ``python3``. +Quickly checking that a source change still compiles requires only the first +two steps above: run ``./configure`` once (or reuse a previous build directory), +then run ``make -j`` from the top level to rebuild the changed files. If you +want to be sure no stale artifacts interfere, run ``make clean`` before the +``make`` step. + You can pass many options to the configure script; run ``./configure --help`` to find out more. On macOS case-insensitive file systems and on Cygwin, the executable is called ``python.exe``; elsewhere it's just ``python``.