Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 17 additions & 18 deletions easybuild/easyblocks/p/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,24 +366,23 @@ def patch_step(self, *args, **kwargs):
ctypes_util_py = os.path.join("Lib", "ctypes", "util.py")
orig_gcc_so_name = None
# Let's do this incrementally since we are going back in time
if LooseVersion(self.version) >= "3.9.1":
# From 3.9.1 to at least v3.12.4 there is only one match for this line
orig_gcc_so_name = "_get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name))"
if orig_gcc_so_name:
orig_gcc_so_name_regex = r'(\s*)' + re.escape(orig_gcc_so_name) + r'(\s*)'
# _get_soname() takes the full path as an argument and uses objdump to get the SONAME field from
# the shared object file. The presence or absence of the SONAME field in the ELF header of a shared
# library is influenced by how the library is compiled and linked. For manually built libraries we
# may be lacking this field, this approach also solves that problem.
updated_gcc_so_name = (
"_findLib_gcc(name) or _findLib_ld(name)"
)
apply_regex_substitutions(
ctypes_util_py,
[(orig_gcc_so_name_regex, r'\1' + updated_gcc_so_name + r'\2')],
on_missing_match=ERROR
)

# if LooseVersion(self.version) >= "3.9.1":
# # From 3.9.1 to at least v3.12.4 there is only one match for this line
# orig_gcc_so_name = "_get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name))"
# if orig_gcc_so_name:
# orig_gcc_so_name_regex = r'(\s*)' + re.escape(orig_gcc_so_name) + r'(\s*)'
# # _get_soname() takes the full path as an argument and uses objdump to get the SONAME field from
# # the shared object file. The presence or absence of the SONAME field in the ELF header of a shared
# # library is influenced by how the library is compiled and linked. For manually built libraries we
# # may be lacking this field, this approach also solves that problem.
# updated_gcc_so_name = (
# "_findLib_gcc(name) or _findLib_ld(name)"
# )
# apply_regex_substitutions(
# ctypes_util_py,
# [(orig_gcc_so_name_regex, r'\1' + updated_gcc_so_name + r'\2')],
# on_missing_match=ERROR
# )
# if we're installing Python with an alternate sysroot,
# we need to patch setup.py which includes hardcoded paths like /usr/include and /lib64;
# this fixes problems like not being able to build the _ssl module ("Could not build the ssl module")
Expand Down
Loading