Skip to content

Commit 100d335

Browse files
committed
bpo-41282: Fix broken make install
A previous commit broke a check in sysconfig when building cpython itself. This caused builds of the standard library modules to search a wrong location (the installed location rather than the source directory) for header files with the net effect that a ``make install`` incorrectly caused all extension modules to be rebuilt again and with incorrect include file paths.
1 parent 3ad101b commit 100d335

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

Lib/distutils/command/install.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,9 @@ def finalize_options(self):
316316
self.config_vars['userbase'] = self.install_userbase
317317
self.config_vars['usersite'] = self.install_usersite
318318

319+
if sysconfig.is_python_build(True):
320+
self.config_vars['srcdir'] = sysconfig.get_config_var('srcdir')
321+
319322
self.expand_basedirs()
320323

321324
self.dump_dirs("post-expand_basedirs()")

Lib/sysconfig.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ def is_python_build(check_home=False):
182182

183183
_PYTHON_BUILD = is_python_build(True)
184184

185+
if _PYTHON_BUILD:
186+
for scheme in ('posix_prefix', 'posix_home'):
187+
_INSTALL_SCHEMES[scheme]['include'] = '{srcdir}/Include'
188+
_INSTALL_SCHEMES[scheme]['platinclude'] = '{projectbase}/.'
189+
190+
185191
def _subst_vars(s, local_vars):
186192
try:
187193
return s.format(**local_vars)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix broken ``make install`` that caused standard library extension modules
2+
to be unnecessarily and incorrectly rebuilt during the install phase of
3+
cpython.

0 commit comments

Comments
 (0)