https://github.com/python/cpython/commit/5f1997896d9c3ecf92e9863177c452b468a6a2c8
commit: 5f1997896d9c3ecf92e9863177c452b468a6a2c8
branch: main
author: Sam Gross <colesb...@gmail.com>
committer: zooba <steve.do...@microsoft.com>
date: 2024-01-23T18:05:15Z
summary:

gh-112984: Fix link error on free-threaded Windows build (GH-114455)

The test_peg_generator test tried to link the python313_d.lib library,
which failed because the library is now named python313t_d.lib. The
underlying problem is that the "compiler" attribute was not set when
we call get_libraries() from distutils.

files:
M Tools/peg_generator/pegen/build.py

diff --git a/Tools/peg_generator/pegen/build.py 
b/Tools/peg_generator/pegen/build.py
index 00295c984d1bb6..67a7c0c4788e9d 100644
--- a/Tools/peg_generator/pegen/build.py
+++ b/Tools/peg_generator/pegen/build.py
@@ -220,6 +220,9 @@ def compile_c_extension(
         )
     else:
         objects = compiler.object_filenames(extension.sources, 
output_dir=cmd.build_temp)
+    # The cmd.get_libraries() call needs a valid compiler attribute or we will
+    # get an incorrect library name on the free-threaded Windows build.
+    cmd.compiler = compiler
     # Now link the object files together into a "shared object"
     compiler.link_shared_object(
         objects,

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to