◐ Shell
clean mode source ↗

bpo-45548: Some test modules must be built as shared libs (GH-29268) by tiran · Pull Request #29268 · python/cpython

Expand Up @@ -426,12 +426,13 @@ def update_sources_depends(self): # re-compile extensions if a header file has been changed ext.depends.extend(headers)
def remove_configured_extensions(self): def handle_configured_extensions(self): # The sysconfig variables built by makesetup that list the already # built modules and the disabled modules as configured by the Setup # files. sysconf_built = sysconfig.get_config_var('MODBUILT_NAMES').split() sysconf_dis = sysconfig.get_config_var('MODDISABLED_NAMES').split() sysconf_built = set(sysconfig.get_config_var('MODBUILT_NAMES').split()) sysconf_shared = set(sysconfig.get_config_var('MODSHARED_NAMES').split()) sysconf_dis = set(sysconfig.get_config_var('MODDISABLED_NAMES').split())
mods_built = [] mods_disabled = [] Expand All @@ -449,11 +450,15 @@ def remove_configured_extensions(self): mods_configured] # Remove the shared libraries built by a previous build. for ext in mods_configured: # Don't remove shared extensions which have been built # by Modules/Setup if ext.name in sysconf_shared: continue fullpath = self.get_ext_fullpath(ext.name) if os.path.exists(fullpath): if os.path.lexists(fullpath): os.unlink(fullpath)
return (mods_built, mods_disabled) return mods_built, mods_disabled
def set_compiler_executables(self): # When you run "make CC=altcc" or something similar, you really want Expand All @@ -478,7 +483,7 @@ def build_extensions(self): self.remove_disabled()
self.update_sources_depends() mods_built, mods_disabled = self.remove_configured_extensions() mods_built, mods_disabled = self.handle_configured_extensions() self.set_compiler_executables()
if LIST_MODULE_NAMES: Expand Down