Skip to content

Commit

Permalink
distutils: add build root to libdirs when building uninstalled
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lazka committed Jul 19, 2023
1 parent 7d483ba commit cf8362d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/distutils/command/build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def finalize_options(self):
config_dir_name))
else:
# building python standard extensions
self.library_dirs.append('.')
self.library_dirs.append(sysconfig.project_base)

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

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

0 comments on commit cf8362d

Please sign in to comment.