Skip to content

Commit cf8362d

Browse files
committed
distutils: add build root to libdirs when building uninstalled
The distutils test suite builds extensions which need to link to libpython despite it being uninstalled. The code currently assumes that the working directory is the build root, but that is not the case in the tests (it's in some temp dir). Explicitely pass the build root instead where the uninstalled libpython can be found.
1 parent 7d483ba commit cf8362d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/distutils/command/build_ext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def finalize_options(self):
227227
config_dir_name))
228228
else:
229229
# building python standard extensions
230-
self.library_dirs.append('.')
230+
self.library_dirs.append(sysconfig.project_base)
231231

232232
# For building extensions with a shared Python library,
233233
# Python's library directory must be appended to library_dirs
@@ -238,7 +238,7 @@ def finalize_options(self):
238238
self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))
239239
else:
240240
# building python standard extensions
241-
self.library_dirs.append('.')
241+
self.library_dirs.append(sysconfig.project_base)
242242

243243
# The argument parsing will result in self.define being a string, but
244244
# it has to be a list of 2-tuples. All the preprocessor symbols

0 commit comments

Comments
 (0)