[Python-checkins] [3.12] gh-103186: In test_tools.freeze, fetch CONFIG_ARGS from original source directory (GH-103213) (#106667)

kumaraditya303 webhook-mailer at python.org
Wed Jul 12 03:32:54 EDT 2023


https://github.com/python/cpython/commit/af06a8ad4d94f78d86d59a6268b3f38543921beb
commit: af06a8ad4d94f78d86d59a6268b3f38543921beb
branch: 3.12
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: kumaraditya303 <kumaraditya at python.org>
date: 2023-07-12T07:32:51Z
summary:

[3.12] gh-103186: In test_tools.freeze, fetch CONFIG_ARGS from original source directory (GH-103213) (#106667)

gh-103186: In test_tools.freeze, fetch CONFIG_ARGS from original source directory (GH-103213)

Fetch CONFIG_ARGS from the original source directory, instead of from
the copied source tree. When "make clean" is executed in the copied
source tree, the build directory is cleared and the configure argument
lookup fails. However, the original source directory still contains this
information.
(cherry picked from commit de827322ca47e51d52ff44536a7c3fd44648383a)

Co-authored-by: Ijtaba Hussain <ijtabahussain at live.com>

files:
A Misc/NEWS.d/next/Tools-Demos/2023-04-05-07-19-36.gh-issue-103186.yEozgK.rst
M Tools/freeze/test/freeze.py

diff --git a/Misc/NEWS.d/next/Tools-Demos/2023-04-05-07-19-36.gh-issue-103186.yEozgK.rst b/Misc/NEWS.d/next/Tools-Demos/2023-04-05-07-19-36.gh-issue-103186.yEozgK.rst
new file mode 100644
index 0000000000000..7e28ba6963216
--- /dev/null
+++ b/Misc/NEWS.d/next/Tools-Demos/2023-04-05-07-19-36.gh-issue-103186.yEozgK.rst
@@ -0,0 +1,2 @@
+``freeze`` now fetches ``CONFIG_ARGS`` from the original CPython instance
+the Makefile uses to call utility scripts. Patch by Ijtaba Hussain.
diff --git a/Tools/freeze/test/freeze.py b/Tools/freeze/test/freeze.py
index f6a5adb4519fd..92e97cb261719 100644
--- a/Tools/freeze/test/freeze.py
+++ b/Tools/freeze/test/freeze.py
@@ -153,7 +153,7 @@ def prepare(script=None, outdir=None):
     print(f'configuring python in {builddir}...')
     cmd = [
         os.path.join(srcdir, 'configure'),
-        *shlex.split(get_config_var(srcdir, 'CONFIG_ARGS') or ''),
+        *shlex.split(get_config_var(SRCDIR, 'CONFIG_ARGS') or ''),
     ]
     ensure_opt(cmd, 'cache-file', os.path.join(outdir, 'python-config.cache'))
     prefix = os.path.join(outdir, 'python-installation')



More information about the Python-checkins mailing list