From f750fa4fdf2059fa954ab1e750b026a0bafde689 Mon Sep 17 00:00:00 2001 From: Danilo Gonzalez Date: Thu, 5 Jun 2025 12:44:25 +0200 Subject: [PATCH 01/25] Add a patch that enable to use libraries exposed via LIBRARY_PATH or relies on prefix provided ldconfig --- .../p/Python/Python-3.11.5-GCCcore-13.2.0.eb | 6 ++- .../Python/Python-3.11.5-custom-ctypes.patch | 52 +++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb index 80e5335b710b..f59b52181ae6 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb @@ -10,7 +10,11 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -checksums = ['a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58'] +patches = ['Python-3.11.5-custom-ctypes.patch'] +checksums = [ + {'Python-3.11.5.tgz': 'a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58'}, + {'Python-3.11.5-custom-ctypes.patch': 'fd56e81986051f22304dfc88953f5a5aad0c060f8e8649faa3633de644f5a61d'}, +] builddependencies = [ ('UnZip', '6.0'), diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch new file mode 100644 index 000000000000..db295f991998 --- /dev/null +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch @@ -0,0 +1,52 @@ +diff -ruN Python-3.11.5.orig/Lib/ctypes/__init__.py Python-3.11.5/Lib/ctypes/__init__.py +--- Python-3.11.5.orig/Lib/ctypes/__init__.py 2025-06-03 17:24:09.817225787 +0200 ++++ Python-3.11.5/Lib/ctypes/__init__.py 2025-06-03 17:26:02.851166381 +0200 +@@ -13,6 +13,8 @@ + from _ctypes import ArgumentError + + from struct import calcsize as _calcsize ++from ctypes import util ++import re + + if __version__ != _ctypes_version: + raise Exception("Version number mismatch", __version__, _ctypes_version) +@@ -349,6 +351,11 @@ + flags |= _FUNCFLAG_USE_ERRNO + if use_last_error: + flags |= _FUNCFLAG_USE_LASTERROR ++ if _os.name == "posix": ++ if name and name.endswith(".so"): ++ s = re.sub(r'lib', '', name) ++ s = re.sub(r'\..*', '', s) ++ self._name=util._findLib_ld(s) + if _sys.platform.startswith("aix"): + """When the name contains ".a(" and ends with ")", + e.g., "libFOO.a(libFOO.so)" - this is taken to be an +diff -ruN Python-3.11.5.orig/Lib/ctypes/util.py Python-3.11.5/Lib/ctypes/util.py +--- Python-3.11.5.orig/Lib/ctypes/util.py 2025-06-03 17:24:09.816225753 +0200 ++++ Python-3.11.5/Lib/ctypes/util.py 2025-06-03 17:28:52.212009753 +0200 +@@ -209,7 +209,7 @@ + expr = os.fsencode(expr) + + try: +- proc = subprocess.Popen(('/sbin/ldconfig', '-r'), ++ proc = subprocess.Popen((os.environ.get('EPREFIX') + '/sbin/ldconfig', '-r'), + stdout=subprocess.PIPE, + stderr=subprocess.DEVNULL) + except OSError: # E.g. command not found +@@ -301,7 +301,14 @@ + # See issue #9998 for why this is needed + expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) + cmd = ['ld', '-t'] +- libpath = os.environ.get('LD_LIBRARY_PATH') ++ libpath = [] ++ if os.getenv('EPREFIX'): ++ libpath.append(os.getenv('EPREFIX')) ++ if os.getenv('LD_LIBRARY_PATH'): ++ libpath.append(os.getenv('LD_LIBRARY_PATH')) ++ if os.getenv('LIBRARY_PATH'): ++ libpath.append(os.getenv('LIBRARY_PATH')) ++ libpath = ':'.join(libpath) + if libpath: + for d in libpath.split(':'): + cmd.extend(['-L', d]) From 98c9e64f96945f6c6d1c83c917d8db169b522b3e Mon Sep 17 00:00:00 2001 From: Danilo Gonzalez Date: Fri, 6 Jun 2025 16:12:10 +0200 Subject: [PATCH 02/25] remove eprefix definitions --- .../p/Python/Python-3.11.5-GCCcore-13.2.0.eb | 2 +- .../p/Python/Python-3.11.5-custom-ctypes.patch | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb index f59b52181ae6..c468b1752b5f 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb @@ -13,7 +13,7 @@ sources = [SOURCE_TGZ] patches = ['Python-3.11.5-custom-ctypes.patch'] checksums = [ {'Python-3.11.5.tgz': 'a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58'}, - {'Python-3.11.5-custom-ctypes.patch': 'fd56e81986051f22304dfc88953f5a5aad0c060f8e8649faa3633de644f5a61d'}, + {'Python-3.11.5-custom-ctypes.patch': '69744e7f694e349ce6aee0659ab771936f3f7daf1043275df2966f9f8b6cbb2e'}, ] builddependencies = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch index db295f991998..5a73d201a118 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch @@ -25,15 +25,6 @@ diff -ruN Python-3.11.5.orig/Lib/ctypes/__init__.py Python-3.11.5/Lib/ctypes/__i diff -ruN Python-3.11.5.orig/Lib/ctypes/util.py Python-3.11.5/Lib/ctypes/util.py --- Python-3.11.5.orig/Lib/ctypes/util.py 2025-06-03 17:24:09.816225753 +0200 +++ Python-3.11.5/Lib/ctypes/util.py 2025-06-03 17:28:52.212009753 +0200 -@@ -209,7 +209,7 @@ - expr = os.fsencode(expr) - - try: -- proc = subprocess.Popen(('/sbin/ldconfig', '-r'), -+ proc = subprocess.Popen((os.environ.get('EPREFIX') + '/sbin/ldconfig', '-r'), - stdout=subprocess.PIPE, - stderr=subprocess.DEVNULL) - except OSError: # E.g. command not found @@ -301,7 +301,14 @@ # See issue #9998 for why this is needed expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) @@ -41,7 +32,7 @@ diff -ruN Python-3.11.5.orig/Lib/ctypes/util.py Python-3.11.5/Lib/ctypes/util.py - libpath = os.environ.get('LD_LIBRARY_PATH') + libpath = [] + if os.getenv('EPREFIX'): -+ libpath.append(os.getenv('EPREFIX')) ++ libpath.append(os.getenv('EPREFIX' + '/usr/lib64')) + if os.getenv('LD_LIBRARY_PATH'): + libpath.append(os.getenv('LD_LIBRARY_PATH')) + if os.getenv('LIBRARY_PATH'): From 292f388dcca747238d5e98ac7a27baec8eae3bce Mon Sep 17 00:00:00 2001 From: Danilo Gonzalez Date: Fri, 25 Jul 2025 15:30:06 +0200 Subject: [PATCH 03/25] Update custom patch adding additional function for libraries with full name --- .../p/Python/Python-3.11.5-GCCcore-13.2.0.eb | 2 +- .../Python/Python-3.11.5-custom-ctypes.patch | 115 +++++++++++++++--- 2 files changed, 98 insertions(+), 19 deletions(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb index c468b1752b5f..648dc05718a9 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb @@ -13,7 +13,7 @@ sources = [SOURCE_TGZ] patches = ['Python-3.11.5-custom-ctypes.patch'] checksums = [ {'Python-3.11.5.tgz': 'a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58'}, - {'Python-3.11.5-custom-ctypes.patch': '69744e7f694e349ce6aee0659ab771936f3f7daf1043275df2966f9f8b6cbb2e'}, + {'Python-3.11.5-custom-ctypes.patch': 'f145f6daf11f430da45c1da77f1795e4793ee170178a3e97a8286c3c5468f997'}, ] builddependencies = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch index 5a73d201a118..5c502d492398 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch @@ -1,43 +1,122 @@ diff -ruN Python-3.11.5.orig/Lib/ctypes/__init__.py Python-3.11.5/Lib/ctypes/__init__.py --- Python-3.11.5.orig/Lib/ctypes/__init__.py 2025-06-03 17:24:09.817225787 +0200 +++ Python-3.11.5/Lib/ctypes/__init__.py 2025-06-03 17:26:02.851166381 +0200 -@@ -13,6 +13,8 @@ - from _ctypes import ArgumentError +@@ -14,6 +14,8 @@ from struct import calcsize as _calcsize -+from ctypes import util -+import re ++from ctypes import util ++ if __version__ != _ctypes_version: raise Exception("Version number mismatch", __version__, _ctypes_version) -@@ -349,6 +351,11 @@ + +@@ -349,6 +351,9 @@ flags |= _FUNCFLAG_USE_ERRNO if use_last_error: flags |= _FUNCFLAG_USE_LASTERROR + if _os.name == "posix": -+ if name and name.endswith(".so"): -+ s = re.sub(r'lib', '', name) -+ s = re.sub(r'\..*', '', s) -+ self._name=util._findLib_ld(s) ++ if name: ++ self._name = util.find_library(name) if _sys.platform.startswith("aix"): """When the name contains ".a(" and ends with ")", e.g., "libFOO.a(libFOO.so)" - this is taken to be an diff -ruN Python-3.11.5.orig/Lib/ctypes/util.py Python-3.11.5/Lib/ctypes/util.py --- Python-3.11.5.orig/Lib/ctypes/util.py 2025-06-03 17:24:09.816225753 +0200 +++ Python-3.11.5/Lib/ctypes/util.py 2025-06-03 17:28:52.212009753 +0200 -@@ -301,7 +301,14 @@ +@@ -149,6 +149,54 @@ + return os.fsdecode(file) + + ++ def _findLib_gcc_fullname(name): ++ # Run GCC's linker with the -t (aka --trace) option and examine the ++ # library name it prints out. The GCC command will fail because we ++ # haven't supplied a proper program with main(), but that does not ++ # matter. ++ expr = r'^.*%s.*$' % re.escape(name) ++ c_compiler = shutil.which('gcc') ++ if not c_compiler: ++ c_compiler = shutil.which('cc') ++ if not c_compiler: ++ # No C compiler available, give up ++ return None ++ ++ temp = tempfile.NamedTemporaryFile() ++ try: ++ args = [c_compiler, '-Wl,-t', '-o', temp.name, '-l:' + name] ++ # print(args) ++ env = dict(os.environ) ++ env['LC_ALL'] = 'C' ++ env['LANG'] = 'C' ++ try: ++ proc = subprocess.Popen(args, ++ stdout=subprocess.PIPE, ++ stderr=subprocess.STDOUT, ++ env=env) ++ except OSError: # E.g. bad executable ++ return None ++ with proc: ++ trace = proc.stdout.read().decode() ++ finally: ++ try: ++ temp.close() ++ except FileNotFoundError: ++ # Raised if the file was already removed, which is the normal ++ # behaviour of GCC if linking fails ++ pass ++ res = re.findall(expr, trace, re.MULTILINE) ++ if not res: ++ return None ++ ++ for file in res: ++ # Check if the given file is an elf file: gcc can report ++ # some files that are linker scripts and not actual ++ # shared objects. See bpo-41976 for more details ++ if not _is_elf(file): ++ continue ++ return file ++ + if sys.platform == "sunos5": + # use /usr/ccs/bin/dump on solaris + def _get_soname(f): +@@ -283,7 +331,7 @@ + abi_type = mach_map.get(machine, 'libc6') + + # XXX assuming GLIBC's ldconfig (with option -p) +- regex = r'\s+(lib%s\.[^\s]+)\s+\(%s' ++ regex = r'\s+(lib%s\.[^\s]+)\s+\(%s\)\s+=>\s+(\S+)' + regex = os.fsencode(regex % (re.escape(name), abi_type)) + try: + with subprocess.Popen(['/cvmfs/software.eessi.io/versions/2023.06/compat/linux/x86_64/sbin/ldconfig', '-p'], +@@ -293,7 +341,7 @@ + env={'LC_ALL': 'C', 'LANG': 'C'}) as p: + res = re.search(regex, p.stdout.read()) + if res: +- return os.fsdecode(res.group(1)) ++ return os.fsdecode(res.group(2)) + except OSError: + pass + +@@ -301,7 +349,7 @@ # See issue #9998 for why this is needed expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) cmd = ['ld', '-t'] - libpath = os.environ.get('LD_LIBRARY_PATH') -+ libpath = [] -+ if os.getenv('EPREFIX'): -+ libpath.append(os.getenv('EPREFIX' + '/usr/lib64')) -+ if os.getenv('LD_LIBRARY_PATH'): -+ libpath.append(os.getenv('LD_LIBRARY_PATH')) -+ if os.getenv('LIBRARY_PATH'): -+ libpath.append(os.getenv('LIBRARY_PATH')) -+ libpath = ':'.join(libpath) ++ libpath = os.environ.get('LIBRARY_PATH') if libpath: for d in libpath.split(':'): cmd.extend(['-L', d]) +@@ -326,8 +326,12 @@ + + def find_library(name): + # See issue #9998 +- return _findSoname_ldconfig(name) or \ +- _get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name)) ++ if os.path.exists(name): ++ return name ++ else: ++ return _findSoname_ldconfig(name) or \ ++ _findLib_gcc(name) or _findLib_ld(name) or \ ++ _findLib_gcc_fullname(name) + + ################################################################ + # test code From 115f7b0200c1fb51cf90e9fc1333dd928e8ffb09 Mon Sep 17 00:00:00 2001 From: casparvl casparvl Date: Wed, 30 Jul 2025 09:35:06 +0000 Subject: [PATCH 04/25] Changed EasyConfig to use custom keywords from https://github.com/easybuilders/easybuild-easyblocks/pull/3860 --- .../easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb index 648dc05718a9..b7c4c3c1a81e 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb @@ -10,12 +10,18 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -patches = ['Python-3.11.5-custom-ctypes.patch'] checksums = [ {'Python-3.11.5.tgz': 'a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58'}, {'Python-3.11.5-custom-ctypes.patch': 'f145f6daf11f430da45c1da77f1795e4793ee170178a3e97a8286c3c5468f997'}, ] +# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRRY_PATH to find libraries +patches_filter_ld_library_path = ['Python-3.11.5-custom-ctypes.patch'] +checksums_filter_ld_library_path = [ + {'Python-3.11.5-custom-ctypes.patch': 'f145f6daf11f430da45c1da77f1795e4793ee170178a3e97a8286c3c5468f997'}, +] + builddependencies = [ ('UnZip', '6.0'), ('pkgconf', '2.0.3'), From d6088b10d983905a10714db76480a3fbb60b8c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danilo=20Gonz=C3=A1lez?= Date: Wed, 30 Jul 2025 12:05:40 +0200 Subject: [PATCH 05/25] prevent none as fullpath, use a robust regex for __findLib_gcc_fullname, remove sysroot info --- .../p/Python/Python-3.11.5-custom-ctypes.patch | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch index 5c502d492398..2093356568c1 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch @@ -10,13 +10,15 @@ diff -ruN Python-3.11.5.orig/Lib/ctypes/__init__.py Python-3.11.5/Lib/ctypes/__i if __version__ != _ctypes_version: raise Exception("Version number mismatch", __version__, _ctypes_version) -@@ -349,6 +351,9 @@ +@@ -349,6 +351,11 @@ flags |= _FUNCFLAG_USE_ERRNO if use_last_error: flags |= _FUNCFLAG_USE_LASTERROR + if _os.name == "posix": + if name: -+ self._name = util.find_library(name) ++ fullpath = util.find_library(name) ++ if fullpath is not None: ++ self._name = fullpath if _sys.platform.startswith("aix"): """When the name contains ".a(" and ends with ")", e.g., "libFOO.a(libFOO.so)" - this is taken to be an @@ -32,7 +34,7 @@ diff -ruN Python-3.11.5.orig/Lib/ctypes/util.py Python-3.11.5/Lib/ctypes/util.py + # library name it prints out. The GCC command will fail because we + # haven't supplied a proper program with main(), but that does not + # matter. -+ expr = r'^.*%s.*$' % re.escape(name) ++ expr = os.fsencode(r'^[^\(\)\s]*%s[^\(\)\s]*' % re.escape(name)) + c_compiler = shutil.which('gcc') + if not c_compiler: + c_compiler = shutil.which('cc') @@ -86,7 +88,7 @@ diff -ruN Python-3.11.5.orig/Lib/ctypes/util.py Python-3.11.5/Lib/ctypes/util.py + regex = r'\s+(lib%s\.[^\s]+)\s+\(%s\)\s+=>\s+(\S+)' regex = os.fsencode(regex % (re.escape(name), abi_type)) try: - with subprocess.Popen(['/cvmfs/software.eessi.io/versions/2023.06/compat/linux/x86_64/sbin/ldconfig', '-p'], + with subprocess.Popen(['/sbin/ldconfig', '-p'], @@ -293,7 +341,7 @@ env={'LC_ALL': 'C', 'LANG': 'C'}) as p: res = re.search(regex, p.stdout.read()) From b688107a3ba98a8c38e209a22db5e107a73a9335 Mon Sep 17 00:00:00 2001 From: Danilo Gonzalez Date: Wed, 30 Jul 2025 18:12:34 +0200 Subject: [PATCH 06/25] update patch and recipe --- .../p/Python/Python-3.11.5-GCCcore-13.2.0.eb | 12 ++--- .../Python/Python-3.11.5-custom-ctypes.patch | 54 ++++++++++++------- 2 files changed, 40 insertions(+), 26 deletions(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb index b7c4c3c1a81e..958e8826de8b 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb @@ -10,18 +10,16 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] +patches_filter_ld_library_path = ['Python-3.11.5-custom-ctypes.patch'] +checksums_filter_ld_library_path = [ + {'Python-3.11.5-custom-ctypes.patch': '74160b6b86c309222467157909d998cfae0a1f89e604fd3273e9b2db2c5a2929'} +] checksums = [ {'Python-3.11.5.tgz': 'a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58'}, - {'Python-3.11.5-custom-ctypes.patch': 'f145f6daf11f430da45c1da77f1795e4793ee170178a3e97a8286c3c5468f997'}, ] # Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH -# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRRY_PATH to find libraries -patches_filter_ld_library_path = ['Python-3.11.5-custom-ctypes.patch'] -checksums_filter_ld_library_path = [ - {'Python-3.11.5-custom-ctypes.patch': 'f145f6daf11f430da45c1da77f1795e4793ee170178a3e97a8286c3c5468f997'}, -] - +# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries builddependencies = [ ('UnZip', '6.0'), ('pkgconf', '2.0.3'), diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch index 2093356568c1..804071aac154 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch @@ -1,19 +1,24 @@ -diff -ruN Python-3.11.5.orig/Lib/ctypes/__init__.py Python-3.11.5/Lib/ctypes/__init__.py ---- Python-3.11.5.orig/Lib/ctypes/__init__.py 2025-06-03 17:24:09.817225787 +0200 -+++ Python-3.11.5/Lib/ctypes/__init__.py 2025-06-03 17:26:02.851166381 +0200 -@@ -14,6 +14,8 @@ +Override ctypes behavior to enable support for EB provided libraries. +This should be only applied if LD_LIBRARY_PATH is disabled. +Authors: Danilo Gonzalez (DoItNow group), Caspar van Leeuwen (SURF) and Alan O'cais (CECAM) +diff -ruN Python-3.11.5/Lib/ctypes/__init__.py Python-3.11.5.patched/Lib/ctypes/__init__.py +--- Python-3.11.5/Lib/ctypes/__init__.py 2023-08-24 14:09:18.000000000 +0200 ++++ Python-3.11.5.patched/Lib/ctypes/__init__.py 2025-07-30 16:29:40.600331232 +0200 +@@ -14,6 +14,9 @@ from struct import calcsize as _calcsize ++# Add util to use find_library capabilities +from ctypes import util + if __version__ != _ctypes_version: raise Exception("Version number mismatch", __version__, _ctypes_version) -@@ -349,6 +351,11 @@ +@@ -349,6 +352,12 @@ flags |= _FUNCFLAG_USE_ERRNO if use_last_error: flags |= _FUNCFLAG_USE_LASTERROR ++ # define CDLL instance name as fullpath + if _os.name == "posix": + if name: + fullpath = util.find_library(name) @@ -22,18 +27,18 @@ diff -ruN Python-3.11.5.orig/Lib/ctypes/__init__.py Python-3.11.5/Lib/ctypes/__i if _sys.platform.startswith("aix"): """When the name contains ".a(" and ends with ")", e.g., "libFOO.a(libFOO.so)" - this is taken to be an -diff -ruN Python-3.11.5.orig/Lib/ctypes/util.py Python-3.11.5/Lib/ctypes/util.py ---- Python-3.11.5.orig/Lib/ctypes/util.py 2025-06-03 17:24:09.816225753 +0200 -+++ Python-3.11.5/Lib/ctypes/util.py 2025-06-03 17:28:52.212009753 +0200 -@@ -149,6 +149,54 @@ +diff -ruN Python-3.11.5/Lib/ctypes/util.py Python-3.11.5.patched/Lib/ctypes/util.py +--- Python-3.11.5/Lib/ctypes/util.py 2023-08-24 14:09:18.000000000 +0200 ++++ Python-3.11.5.patched/Lib/ctypes/util.py 2025-07-30 16:39:37.423162529 +0200 +@@ -148,6 +148,53 @@ + continue return os.fsdecode(file) - + def _findLib_gcc_fullname(name): + # Run GCC's linker with the -t (aka --trace) option and examine the + # library name it prints out. The GCC command will fail because we + # haven't supplied a proper program with main(), but that does not -+ # matter. ++ # matter. This function will return the full path of the requested library + expr = os.fsencode(r'^[^\(\)\s]*%s[^\(\)\s]*' % re.escape(name)) + c_compiler = shutil.which('gcc') + if not c_compiler: @@ -76,43 +81,54 @@ diff -ruN Python-3.11.5.orig/Lib/ctypes/util.py Python-3.11.5/Lib/ctypes/util.py + if not _is_elf(file): + continue + return file -+ + if sys.platform == "sunos5": # use /usr/ccs/bin/dump on solaris - def _get_soname(f): -@@ -283,7 +331,7 @@ +@@ -283,7 +330,8 @@ abi_type = mach_map.get(machine, 'libc6') # XXX assuming GLIBC's ldconfig (with option -p) - regex = r'\s+(lib%s\.[^\s]+)\s+\(%s' ++ # Regular expresion that captures complete line of ldconfig -p output that matches with library name. + regex = r'\s+(lib%s\.[^\s]+)\s+\(%s\)\s+=>\s+(\S+)' regex = os.fsencode(regex % (re.escape(name), abi_type)) try: with subprocess.Popen(['/sbin/ldconfig', '-p'], -@@ -293,7 +341,7 @@ +@@ -293,7 +341,8 @@ env={'LC_ALL': 'C', 'LANG': 'C'}) as p: res = re.search(regex, p.stdout.read()) if res: - return os.fsdecode(res.group(1)) ++ # return the regex second group, that is the library fullpath + return os.fsdecode(res.group(2)) except OSError: pass -@@ -301,7 +349,7 @@ +@@ -301,10 +350,12 @@ # See issue #9998 for why this is needed expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) cmd = ['ld', '-t'] - libpath = os.environ.get('LD_LIBRARY_PATH') ++ # use LIBRARY_PATH instead of LD_LIBRARY_PATH to use EB provided shared libraries + libpath = os.environ.get('LIBRARY_PATH') if libpath: for d in libpath.split(':'): - cmd.extend(['-L', d]) -@@ -326,8 +326,12 @@ +- cmd.extend(['-L', d]) ++ if stubs not in d.split('/'): ++ cmd.extend(['-L', d]) + cmd.extend(['-o', os.devnull, '-l%s' % name]) + result = None + try: +@@ -325,9 +375,15 @@ + return result def find_library(name): - # See issue #9998 +- # See issue #9998 - return _findSoname_ldconfig(name) or \ - _get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name)) ++ # Redefine find_library function, it will return the provided name if ++ # path exist, else it will use the set of functions to find the full library path. ++ # it will return the one that has a match. + if os.path.exists(name): + return name + else: From bd6e6164e893c7ca00d6714e0dea79467a8517c0 Mon Sep 17 00:00:00 2001 From: Danilo Gonzalez Date: Thu, 31 Jul 2025 10:05:26 +0200 Subject: [PATCH 07/25] Remove regex encoding to ensure compatibility with decoded output, fix typo --- .../easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb | 2 +- .../easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb index 958e8826de8b..0207bc730c1d 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb @@ -12,7 +12,7 @@ source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] patches_filter_ld_library_path = ['Python-3.11.5-custom-ctypes.patch'] checksums_filter_ld_library_path = [ - {'Python-3.11.5-custom-ctypes.patch': '74160b6b86c309222467157909d998cfae0a1f89e604fd3273e9b2db2c5a2929'} + {'Python-3.11.5-custom-ctypes.patch': '33b5e8612db313a54883c3c3539e84d996e31201ac9a340bec30c1e43cd3d4ac'} ] checksums = [ {'Python-3.11.5.tgz': 'a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58'}, diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch index 804071aac154..95aeffcf7da1 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch @@ -39,7 +39,7 @@ diff -ruN Python-3.11.5/Lib/ctypes/util.py Python-3.11.5.patched/Lib/ctypes/util + # library name it prints out. The GCC command will fail because we + # haven't supplied a proper program with main(), but that does not + # matter. This function will return the full path of the requested library -+ expr = os.fsencode(r'^[^\(\)\s]*%s[^\(\)\s]*' % re.escape(name)) ++ expr = r'^[^\(\)\s]*%s[^\(\)\s]*' % re.escape(name) + c_compiler = shutil.which('gcc') + if not c_compiler: + c_compiler = shutil.which('cc') @@ -114,7 +114,7 @@ diff -ruN Python-3.11.5/Lib/ctypes/util.py Python-3.11.5.patched/Lib/ctypes/util if libpath: for d in libpath.split(':'): - cmd.extend(['-L', d]) -+ if stubs not in d.split('/'): ++ if 'stubs' not in d.split('/'): + cmd.extend(['-L', d]) cmd.extend(['-o', os.devnull, '-l%s' % name]) result = None From d85a792de10d5878af39e976cbe7a0d5bc0b444b Mon Sep 17 00:00:00 2001 From: Danilo Gonzalez Date: Thu, 31 Jul 2025 16:10:26 +0200 Subject: [PATCH 08/25] Add comment about stubs and update checksum --- easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb | 2 +- .../easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb index 0207bc730c1d..dca78c6f7e81 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb @@ -12,7 +12,7 @@ source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] patches_filter_ld_library_path = ['Python-3.11.5-custom-ctypes.patch'] checksums_filter_ld_library_path = [ - {'Python-3.11.5-custom-ctypes.patch': '33b5e8612db313a54883c3c3539e84d996e31201ac9a340bec30c1e43cd3d4ac'} + {'Python-3.11.5-custom-ctypes.patch': '8de60dc08e736d416b026bc33d7d50dffb4469eb2b1f5bd0b2b54d4029194e68'} ] checksums = [ {'Python-3.11.5.tgz': 'a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58'}, diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch index 95aeffcf7da1..b1528ddfdd46 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch @@ -104,7 +104,7 @@ diff -ruN Python-3.11.5/Lib/ctypes/util.py Python-3.11.5.patched/Lib/ctypes/util except OSError: pass -@@ -301,10 +350,12 @@ +@@ -301,10 +350,13 @@ # See issue #9998 for why this is needed expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) cmd = ['ld', '-t'] @@ -114,6 +114,7 @@ diff -ruN Python-3.11.5/Lib/ctypes/util.py Python-3.11.5.patched/Lib/ctypes/util if libpath: for d in libpath.split(':'): - cmd.extend(['-L', d]) ++ # Needed to avoid searching on CUDA stubs + if 'stubs' not in d.split('/'): + cmd.extend(['-L', d]) cmd.extend(['-o', os.devnull, '-l%s' % name]) From 2804386f617904f6ec076fc0377d69b2573458fc Mon Sep 17 00:00:00 2001 From: Danilo Gonzalez Date: Thu, 7 Aug 2025 16:50:57 +0200 Subject: [PATCH 09/25] Enhance regex to filter stubs on gcc based library search --- .../p/Python/Python-3.11.5-GCCcore-13.2.0.eb | 2 +- .../Python/Python-3.11.5-custom-ctypes.patch | 22 +++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb index dca78c6f7e81..ae1e996cb0ef 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb @@ -12,7 +12,7 @@ source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] patches_filter_ld_library_path = ['Python-3.11.5-custom-ctypes.patch'] checksums_filter_ld_library_path = [ - {'Python-3.11.5-custom-ctypes.patch': '8de60dc08e736d416b026bc33d7d50dffb4469eb2b1f5bd0b2b54d4029194e68'} + {'Python-3.11.5-custom-ctypes.patch': '8ae3efc47dd202b600de8249df31b8be252814933b8339ba42fe5c2e0d9adb14'} ] checksums = [ {'Python-3.11.5.tgz': 'a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58'}, diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch index b1528ddfdd46..7e73f4a47dc8 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch @@ -29,10 +29,16 @@ diff -ruN Python-3.11.5/Lib/ctypes/__init__.py Python-3.11.5.patched/Lib/ctypes/ e.g., "libFOO.a(libFOO.so)" - this is taken to be an diff -ruN Python-3.11.5/Lib/ctypes/util.py Python-3.11.5.patched/Lib/ctypes/util.py --- Python-3.11.5/Lib/ctypes/util.py 2023-08-24 14:09:18.000000000 +0200 -+++ Python-3.11.5.patched/Lib/ctypes/util.py 2025-07-30 16:39:37.423162529 +0200 -@@ -148,6 +148,53 @@ ++++ Python-3.11.5.patched/Lib/ctypes/util.py 2025-08-07 16:37:14.337414617 +0200 +@@ -146,8 +146,60 @@ + # shared objects. See bpo-41976 for more details + if not _is_elf(file): continue - return os.fsdecode(file) +- return os.fsdecode(file) ++ file = os.fsdecode(file) ++ if re.search(r'cuda.*stubs', file, re.IGNORECASE): ++ continue ++ return file + def _findLib_gcc_fullname(name): + # Run GCC's linker with the -t (aka --trace) option and examine the @@ -80,11 +86,13 @@ diff -ruN Python-3.11.5/Lib/ctypes/util.py Python-3.11.5.patched/Lib/ctypes/util + # shared objects. See bpo-41976 for more details + if not _is_elf(file): + continue ++ if re.search(r'cuda.*stubs', file, re.IGNORECASE): ++ continue + return file if sys.platform == "sunos5": # use /usr/ccs/bin/dump on solaris -@@ -283,7 +330,8 @@ +@@ -283,7 +335,8 @@ abi_type = mach_map.get(machine, 'libc6') # XXX assuming GLIBC's ldconfig (with option -p) @@ -94,7 +102,7 @@ diff -ruN Python-3.11.5/Lib/ctypes/util.py Python-3.11.5.patched/Lib/ctypes/util regex = os.fsencode(regex % (re.escape(name), abi_type)) try: with subprocess.Popen(['/sbin/ldconfig', '-p'], -@@ -293,7 +341,8 @@ +@@ -293,7 +346,8 @@ env={'LC_ALL': 'C', 'LANG': 'C'}) as p: res = re.search(regex, p.stdout.read()) if res: @@ -104,7 +112,7 @@ diff -ruN Python-3.11.5/Lib/ctypes/util.py Python-3.11.5.patched/Lib/ctypes/util except OSError: pass -@@ -301,10 +350,13 @@ +@@ -301,10 +355,13 @@ # See issue #9998 for why this is needed expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) cmd = ['ld', '-t'] @@ -120,7 +128,7 @@ diff -ruN Python-3.11.5/Lib/ctypes/util.py Python-3.11.5.patched/Lib/ctypes/util cmd.extend(['-o', os.devnull, '-l%s' % name]) result = None try: -@@ -325,9 +375,15 @@ +@@ -325,9 +382,15 @@ return result def find_library(name): From ac3dd005ed9a1c9f1bf62938c658502ab8273153 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Wed, 27 Aug 2025 11:58:16 +0200 Subject: [PATCH 10/25] Reduce to a single custom keyword --- .../p/Python/Python-3.11.5-GCCcore-13.2.0.eb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb index ae1e996cb0ef..cef95b2c6065 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb @@ -10,16 +10,16 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -patches_filter_ld_library_path = ['Python-3.11.5-custom-ctypes.patch'] -checksums_filter_ld_library_path = [ - {'Python-3.11.5-custom-ctypes.patch': '8ae3efc47dd202b600de8249df31b8be252814933b8339ba42fe5c2e0d9adb14'} -] + +# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +patch_custom_ctypes = ['Python-3.11.5-custom-ctypes.patch'] + checksums = [ {'Python-3.11.5.tgz': 'a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58'}, + {'Python-3.11.5-custom-ctypes.patch': '8ae3efc47dd202b600de8249df31b8be252814933b8339ba42fe5c2e0d9adb14'} ] -# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH -# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries builddependencies = [ ('UnZip', '6.0'), ('pkgconf', '2.0.3'), From b9c908632e7686943d25d33c9e3614d4ae69d55e Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Wed, 27 Aug 2025 12:59:15 +0200 Subject: [PATCH 11/25] adapt to the fact that the patch_custom_ctypes is now a string, not a list --- easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb index cef95b2c6065..4bfacb46c174 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb @@ -13,7 +13,7 @@ sources = [SOURCE_TGZ] # Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH # In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries -patch_custom_ctypes = ['Python-3.11.5-custom-ctypes.patch'] +patch_custom_ctypes = 'Python-3.11.5-custom-ctypes.patch' checksums = [ {'Python-3.11.5.tgz': 'a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58'}, From bd768bd82b9730cf4861edc13d006aec754a158a Mon Sep 17 00:00:00 2001 From: Danilo Gonzalez Date: Wed, 27 Aug 2025 17:37:21 +0200 Subject: [PATCH 12/25] Add comment about preventing using stubs provided cuda libraries --- .../p/Python/Python-3.11.5-custom-ctypes.patch | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch index 7e73f4a47dc8..f4fc2b6fecb4 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch @@ -29,13 +29,14 @@ diff -ruN Python-3.11.5/Lib/ctypes/__init__.py Python-3.11.5.patched/Lib/ctypes/ e.g., "libFOO.a(libFOO.so)" - this is taken to be an diff -ruN Python-3.11.5/Lib/ctypes/util.py Python-3.11.5.patched/Lib/ctypes/util.py --- Python-3.11.5/Lib/ctypes/util.py 2023-08-24 14:09:18.000000000 +0200 -+++ Python-3.11.5.patched/Lib/ctypes/util.py 2025-08-07 16:37:14.337414617 +0200 -@@ -146,8 +146,60 @@ ++++ Python-3.11.5.patched/Lib/ctypes/util.py 2025-08-27 17:30:51.896990336 +0200 +@@ -146,8 +146,61 @@ # shared objects. See bpo-41976 for more details if not _is_elf(file): continue - return os.fsdecode(file) + file = os.fsdecode(file) ++ # Prevent using CUDA libraries provided on stubs + if re.search(r'cuda.*stubs', file, re.IGNORECASE): + continue + return file @@ -92,7 +93,7 @@ diff -ruN Python-3.11.5/Lib/ctypes/util.py Python-3.11.5.patched/Lib/ctypes/util if sys.platform == "sunos5": # use /usr/ccs/bin/dump on solaris -@@ -283,7 +335,8 @@ +@@ -283,7 +336,8 @@ abi_type = mach_map.get(machine, 'libc6') # XXX assuming GLIBC's ldconfig (with option -p) @@ -102,7 +103,7 @@ diff -ruN Python-3.11.5/Lib/ctypes/util.py Python-3.11.5.patched/Lib/ctypes/util regex = os.fsencode(regex % (re.escape(name), abi_type)) try: with subprocess.Popen(['/sbin/ldconfig', '-p'], -@@ -293,7 +346,8 @@ +@@ -293,7 +347,8 @@ env={'LC_ALL': 'C', 'LANG': 'C'}) as p: res = re.search(regex, p.stdout.read()) if res: @@ -112,7 +113,7 @@ diff -ruN Python-3.11.5/Lib/ctypes/util.py Python-3.11.5.patched/Lib/ctypes/util except OSError: pass -@@ -301,10 +355,13 @@ +@@ -301,10 +356,13 @@ # See issue #9998 for why this is needed expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) cmd = ['ld', '-t'] @@ -128,7 +129,7 @@ diff -ruN Python-3.11.5/Lib/ctypes/util.py Python-3.11.5.patched/Lib/ctypes/util cmd.extend(['-o', os.devnull, '-l%s' % name]) result = None try: -@@ -325,9 +382,15 @@ +@@ -325,9 +383,15 @@ return result def find_library(name): From aef6e5393006d5318b51740cfb2e740a621ca530 Mon Sep 17 00:00:00 2001 From: Danilo Gonzalez Date: Wed, 27 Aug 2025 17:42:16 +0200 Subject: [PATCH 13/25] update patch checksum --- easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb index 4bfacb46c174..38ec54396952 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb @@ -17,7 +17,7 @@ patch_custom_ctypes = 'Python-3.11.5-custom-ctypes.patch' checksums = [ {'Python-3.11.5.tgz': 'a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58'}, - {'Python-3.11.5-custom-ctypes.patch': '8ae3efc47dd202b600de8249df31b8be252814933b8339ba42fe5c2e0d9adb14'} + {'Python-3.11.5-custom-ctypes.patch': '08ff708ae275ef2c6ccf4d73671e535840b72566b8649f855f954700ba9aaedd'} ] builddependencies = [ From 05a15b3a0c443dfe87f51fab1d87fc19d2200287 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Mon, 13 Oct 2025 17:20:22 +0200 Subject: [PATCH 14/25] Deduplicate _findLib_gcc and _findLib_gcc_fullname functions. Also, rename the custom keyword in the EasyConfig --- .../p/Python/Python-3.11.5-GCCcore-13.2.0.eb | 2 +- .../Python/Python-3.11.5-custom-ctypes.patch | 144 +++++++++--------- 2 files changed, 73 insertions(+), 73 deletions(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb index 38ec54396952..947df866a9a1 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb @@ -13,7 +13,7 @@ sources = [SOURCE_TGZ] # Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH # In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries -patch_custom_ctypes = 'Python-3.11.5-custom-ctypes.patch' +patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ {'Python-3.11.5.tgz': 'a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58'}, diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch index f4fc2b6fecb4..a3190a0e6f26 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch @@ -1,9 +1,6 @@ -Override ctypes behavior to enable support for EB provided libraries. -This should be only applied if LD_LIBRARY_PATH is disabled. -Authors: Danilo Gonzalez (DoItNow group), Caspar van Leeuwen (SURF) and Alan O'cais (CECAM) -diff -ruN Python-3.11.5/Lib/ctypes/__init__.py Python-3.11.5.patched/Lib/ctypes/__init__.py ---- Python-3.11.5/Lib/ctypes/__init__.py 2023-08-24 14:09:18.000000000 +0200 -+++ Python-3.11.5.patched/Lib/ctypes/__init__.py 2025-07-30 16:29:40.600331232 +0200 +diff -Nru Python-3.11.5.orig/Lib/ctypes/__init__.py Python-3.11.5/Lib/ctypes/__init__.py +--- Python-3.11.5.orig/Lib/ctypes/__init__.py 2025-10-13 15:58:38.405564000 +0200 ++++ Python-3.11.5/Lib/ctypes/__init__.py 2025-10-13 16:01:08.717507706 +0200 @@ -14,6 +14,9 @@ from struct import calcsize as _calcsize @@ -27,93 +24,92 @@ diff -ruN Python-3.11.5/Lib/ctypes/__init__.py Python-3.11.5.patched/Lib/ctypes/ if _sys.platform.startswith("aix"): """When the name contains ".a(" and ends with ")", e.g., "libFOO.a(libFOO.so)" - this is taken to be an -diff -ruN Python-3.11.5/Lib/ctypes/util.py Python-3.11.5.patched/Lib/ctypes/util.py ---- Python-3.11.5/Lib/ctypes/util.py 2023-08-24 14:09:18.000000000 +0200 -+++ Python-3.11.5.patched/Lib/ctypes/util.py 2025-08-27 17:30:51.896990336 +0200 -@@ -146,8 +146,61 @@ +diff -Nru Python-3.11.5.orig/Lib/ctypes/util.py Python-3.11.5/Lib/ctypes/util.py +--- Python-3.11.5.orig/Lib/ctypes/util.py 2025-10-13 15:58:38.306949000 +0200 ++++ Python-3.11.5/Lib/ctypes/util.py 2025-10-13 17:17:07.589997890 +0200 +@@ -99,12 +99,19 @@ + with open(filename, 'br') as thefile: + return thefile.read(4) == elf_header + +- def _findLib_gcc(name): ++ def _findLib_gcc(name, name_is_fullname=False): + # Run GCC's linker with the -t (aka --trace) option and examine the + # library name it prints out. The GCC command will fail because we + # haven't supplied a proper program with main(), but that does not + # matter. +- expr = os.fsencode(r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)) ++ # If the name is a full library name (e.g. libfoo.so), this function calls gcc with -l: instead of ++ # -l and uses a slightly more strict regular expression to avoid matching the error ++ # '/path/to/ld: cannot find -l:libfoo.so: No such file or directory' ++ # since we only want a regex match if the library exists ++ if name_is_fullname: ++ expr = os.fsencode(r'^[^\(\)\s]*%s[^\(\)\s]*' % re.escape(name)) ++ else: ++ expr = os.fsencode(r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)) + + c_compiler = shutil.which('gcc') + if not c_compiler: +@@ -115,7 +122,10 @@ + + temp = tempfile.NamedTemporaryFile() + try: +- args = [c_compiler, '-Wl,-t', '-o', temp.name, '-l' + name] ++ if name_is_fullname: ++ args = [c_compiler, '-Wl,-t', '-o', temp.name, '-l:' + name] ++ else: ++ args = [c_compiler, '-Wl,-t', '-o', temp.name, '-l' + name] + + env = dict(os.environ) + env['LC_ALL'] = 'C' +@@ -136,7 +146,12 @@ + # Raised if the file was already removed, which is the normal + # behaviour of GCC if linking fails + pass +- res = re.findall(expr, trace) ++ # If name_is_fullname, the regex in expr starts wity ^. ++ # Use re.MULTILINE, to make surethat ^ matches the start of EACH line in trace ++ if name_is_fullname: ++ res = re.findall(expr, trace, re.MULTILINE) ++ else: ++ res = re.findall(expr, trace) + if not res: + return None + +@@ -146,8 +161,11 @@ # shared objects. See bpo-41976 for more details if not _is_elf(file): continue - return os.fsdecode(file) +- + file = os.fsdecode(file) -+ # Prevent using CUDA libraries provided on stubs -+ if re.search(r'cuda.*stubs', file, re.IGNORECASE): -+ continue -+ return file - -+ def _findLib_gcc_fullname(name): -+ # Run GCC's linker with the -t (aka --trace) option and examine the -+ # library name it prints out. The GCC command will fail because we -+ # haven't supplied a proper program with main(), but that does not -+ # matter. This function will return the full path of the requested library -+ expr = r'^[^\(\)\s]*%s[^\(\)\s]*' % re.escape(name) -+ c_compiler = shutil.which('gcc') -+ if not c_compiler: -+ c_compiler = shutil.which('cc') -+ if not c_compiler: -+ # No C compiler available, give up -+ return None -+ -+ temp = tempfile.NamedTemporaryFile() -+ try: -+ args = [c_compiler, '-Wl,-t', '-o', temp.name, '-l:' + name] -+ # print(args) -+ env = dict(os.environ) -+ env['LC_ALL'] = 'C' -+ env['LANG'] = 'C' -+ try: -+ proc = subprocess.Popen(args, -+ stdout=subprocess.PIPE, -+ stderr=subprocess.STDOUT, -+ env=env) -+ except OSError: # E.g. bad executable -+ return None -+ with proc: -+ trace = proc.stdout.read().decode() -+ finally: -+ try: -+ temp.close() -+ except FileNotFoundError: -+ # Raised if the file was already removed, which is the normal -+ # behaviour of GCC if linking fails -+ pass -+ res = re.findall(expr, trace, re.MULTILINE) -+ if not res: -+ return None -+ -+ for file in res: -+ # Check if the given file is an elf file: gcc can report -+ # some files that are linker scripts and not actual -+ # shared objects. See bpo-41976 for more details -+ if not _is_elf(file): -+ continue ++ # Avoid returning CUDA stubs libraries, as those are not intended for runtime use + if re.search(r'cuda.*stubs', file, re.IGNORECASE): + continue + return file if sys.platform == "sunos5": # use /usr/ccs/bin/dump on solaris -@@ -283,7 +336,8 @@ +@@ -283,7 +301,8 @@ abi_type = mach_map.get(machine, 'libc6') # XXX assuming GLIBC's ldconfig (with option -p) - regex = r'\s+(lib%s\.[^\s]+)\s+\(%s' -+ # Regular expresion that captures complete line of ldconfig -p output that matches with library name. ++ # Regular expresion that captures complete line of ldconfig -p output that matches with library name. + regex = r'\s+(lib%s\.[^\s]+)\s+\(%s\)\s+=>\s+(\S+)' regex = os.fsencode(regex % (re.escape(name), abi_type)) try: with subprocess.Popen(['/sbin/ldconfig', '-p'], -@@ -293,7 +347,8 @@ +@@ -293,7 +312,8 @@ env={'LC_ALL': 'C', 'LANG': 'C'}) as p: res = re.search(regex, p.stdout.read()) if res: - return os.fsdecode(res.group(1)) -+ # return the regex second group, that is the library fullpath ++ # return the regex second group, that is the full path to the library + return os.fsdecode(res.group(2)) except OSError: pass -@@ -301,10 +356,13 @@ +@@ -301,10 +321,17 @@ # See issue #9998 for why this is needed expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) cmd = ['ld', '-t'] @@ -123,13 +119,17 @@ diff -ruN Python-3.11.5/Lib/ctypes/util.py Python-3.11.5.patched/Lib/ctypes/util if libpath: for d in libpath.split(':'): - cmd.extend(['-L', d]) -+ # Needed to avoid searching on CUDA stubs -+ if 'stubs' not in d.split('/'): ++ # Avoid picking up CUDA stubs libraries, as those are not intended for runtime use ++ parts = d.split('/') ++ # We want to add 'd' in all cases EXCEPT if the path contains both CUDA (as partial ++ # directory name) and stubs (as full directory name). I.e. /my/bar/stubs and /my/cudafoo ++ # will be added to cmd, but /my/cudafoo/bar/stubs won't be ++ if not (any('cuda' in p.lower() for p in parts) and 'stubs' in parts): + cmd.extend(['-L', d]) cmd.extend(['-o', os.devnull, '-l%s' % name]) result = None try: -@@ -325,9 +383,15 @@ +@@ -325,9 +352,15 @@ return result def find_library(name): @@ -137,14 +137,14 @@ diff -ruN Python-3.11.5/Lib/ctypes/util.py Python-3.11.5.patched/Lib/ctypes/util - return _findSoname_ldconfig(name) or \ - _get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name)) + # Redefine find_library function, it will return the provided name if -+ # path exist, else it will use the set of functions to find the full library path. -+ # it will return the one that has a match. ++ # path exist, else it will use the set of functions to find the full library path. ++ # it will return the one that has a match. + if os.path.exists(name): + return name + else: + return _findSoname_ldconfig(name) or \ + _findLib_gcc(name) or _findLib_ld(name) or \ -+ _findLib_gcc_fullname(name) ++ _findLib_gcc(name, name_is_fullname=True) ################################################################ # test code From f7e8762970e9d7af1ceb180a2b4b73b8050557ce Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Tue, 14 Oct 2025 10:57:58 +0200 Subject: [PATCH 15/25] Update checksum for new patch --- easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb index 947df866a9a1..780c062109dd 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb @@ -17,7 +17,7 @@ patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ {'Python-3.11.5.tgz': 'a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58'}, - {'Python-3.11.5-custom-ctypes.patch': '08ff708ae275ef2c6ccf4d73671e535840b72566b8649f855f954700ba9aaedd'} + {'Python-3.11.5-custom-ctypes.patch': '595363e67921ee1fa91ee6b62d1c240cc1649334fef312925fc3811f8d96115c'} ] builddependencies = [ From 7c0df89fd4d567eabec40b81f0947e8ea7885c10 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Tue, 14 Oct 2025 11:45:43 +0200 Subject: [PATCH 16/25] Update patch description. Update checksum for patch --- .../p/Python/Python-3.11.5-GCCcore-13.2.0.eb | 2 +- .../p/Python/Python-3.11.5-custom-ctypes.patch | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb index 780c062109dd..d5516ea39750 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb @@ -17,7 +17,7 @@ patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ {'Python-3.11.5.tgz': 'a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58'}, - {'Python-3.11.5-custom-ctypes.patch': '595363e67921ee1fa91ee6b62d1c240cc1649334fef312925fc3811f8d96115c'} + {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} ] builddependencies = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch index a3190a0e6f26..a9f21a4c9fca 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch @@ -1,3 +1,15 @@ +Ctypes heavily relies on LD_LIBRARY_PATH in it's find_library, ctypes.CDLL, ctypes.cdll.LoadLibrary functions. +This patch is meant for systems where LD_LIBRARY_PATH is filtered. It will rely on LIBRARY_PATH instead. +It makes the following essential changes: +- Whereever find_library searched LD_LIBRARY_PATH, LIBRARY_PATH will be searched instead +- find_library is adapted so that it returns the full library path, not just the library name, which replaces + https://github.com/easybuilders/easybuild-easyblocks/pull/3352 +- The internal function _findLib_gcc, one of the functions called by find_library to locate libraries, is adapted + so that it also works when called by full library name (e.g. libfoo.so.1) instead of the short name (foo) only + This is necessary since CDLL is typically called by full name, and needs to be able to call find_library 9see below) +- The initialization of CDLL is adapted so that it calls find_library. Then, it overwrites the name + with the full library path. This defers all the library localization issues to the (patched) find_library +Authors: Danilo Gonzalez (DoItNow group), Caspar van Leeuwen (SURF) and Alan O'cais (CECAM) diff -Nru Python-3.11.5.orig/Lib/ctypes/__init__.py Python-3.11.5/Lib/ctypes/__init__.py --- Python-3.11.5.orig/Lib/ctypes/__init__.py 2025-10-13 15:58:38.405564000 +0200 +++ Python-3.11.5/Lib/ctypes/__init__.py 2025-10-13 16:01:08.717507706 +0200 From 31878d13262612d9a6d9f16a3402b9b15029ad37 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Fri, 17 Oct 2025 00:19:54 +0200 Subject: [PATCH 17/25] Try to apply the ctypes patch to other python versions as well --- .../p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb | 10 +++++++++- .../p/Python/Python-3.10.4-GCCcore-11.3.0.eb | 10 +++++++++- .../p/Python/Python-3.10.8-GCCcore-12.2.0-bare.eb | 10 +++++++++- .../p/Python/Python-3.10.8-GCCcore-12.2.0.eb | 10 +++++++++- .../p/Python/Python-3.11.2-GCCcore-12.2.0-bare.eb | 10 +++++++++- .../p/Python/Python-3.11.3-GCCcore-12.3.0.eb | 10 +++++++++- .../p/Python/Python-3.12.3-GCCcore-13.3.0.eb | 6 ++++++ .../p/Python/Python-3.13.1-GCCcore-14.2.0.eb | 6 ++++++ .../p/Python/Python-3.9.5-GCCcore-10.3.0-bare.eb | 10 +++++++++- .../p/Python/Python-3.9.5-GCCcore-10.3.0.eb | 10 +++++++++- .../p/Python/Python-3.9.6-GCCcore-11.2.0-bare.eb | 10 +++++++++- .../p/Python/Python-3.9.6-GCCcore-11.2.0.eb | 10 +++++++++- 12 files changed, 102 insertions(+), 10 deletions(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb b/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb index a8c15654825d..383b2b124b26 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb @@ -11,7 +11,15 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -checksums = ['f3bcc65b1d5f1dc78675c746c98fcee823c038168fc629c5935b044d0911ad28'] + +# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' + +checksums = [ + {'Python-3.10.4.tgz: 'f3bcc65b1d5f1dc78675c746c98fcee823c038168fc629c5935b044d0911ad28'}, + {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} +] builddependencies = [ ('UnZip', '6.0'), diff --git a/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb b/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb index 0e403f9e2889..3e85e8e6a7ae 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb @@ -10,7 +10,15 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -checksums = ['f3bcc65b1d5f1dc78675c746c98fcee823c038168fc629c5935b044d0911ad28'] + +# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' + +checksums = [ + {'Python-3.10.4.tgz: 'f3bcc65b1d5f1dc78675c746c98fcee823c038168fc629c5935b044d0911ad28'}, + {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} +] builddependencies = [ ('UnZip', '6.0'), diff --git a/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0-bare.eb b/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0-bare.eb index 695a65cfdb50..ca1e5d9c46ae 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0-bare.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0-bare.eb @@ -11,7 +11,15 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -checksums = ['f400c3fb394b8bef1292f6dc1292c5fadc3533039a5bc0c3e885f3e16738029a'] + +# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' + +checksums = [ + {'Python-3.10.8.tgz': 'f400c3fb394b8bef1292f6dc1292c5fadc3533039a5bc0c3e885f3e16738029a'}, + {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} +] builddependencies = [ ('UnZip', '6.0'), diff --git a/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0.eb index 8d99285f8092..589c64a5be1c 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0.eb @@ -10,7 +10,15 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -checksums = ['f400c3fb394b8bef1292f6dc1292c5fadc3533039a5bc0c3e885f3e16738029a'] + +# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' + +checksums = [ + {'Python-3.10.8.tgz': 'f400c3fb394b8bef1292f6dc1292c5fadc3533039a5bc0c3e885f3e16738029a'}, + {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} +] builddependencies = [ ('UnZip', '6.0'), diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.2-GCCcore-12.2.0-bare.eb b/easybuild/easyconfigs/p/Python/Python-3.11.2-GCCcore-12.2.0-bare.eb index 9dc98d9f22d2..08d83607d72f 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.2-GCCcore-12.2.0-bare.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.2-GCCcore-12.2.0-bare.eb @@ -11,7 +11,15 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -checksums = ['2411c74bda5bbcfcddaf4531f66d1adc73f247f529aee981b029513aefdbf849'] + +# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' + +checksums = [ + {'Python-3.11.2.tgz': '2411c74bda5bbcfcddaf4531f66d1adc73f247f529aee981b029513aefdbf849'}, + {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} +] builddependencies = [ ('UnZip', '6.0'), diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.3-GCCcore-12.3.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.3-GCCcore-12.3.0.eb index 09dc30f2178b..cb60144fd64f 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.3-GCCcore-12.3.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.3-GCCcore-12.3.0.eb @@ -10,7 +10,15 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -checksums = ['1a79f3df32265d9e6625f1a0b31c28eb1594df911403d11f3320ee1da1b3e048'] + +# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' + +checksums = [ + {'Python-3.11.3.tgz': '1a79f3df32265d9e6625f1a0b31c28eb1594df911403d11f3320ee1da1b3e048'}, + {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} +] builddependencies = [ ('UnZip', '6.0'), diff --git a/easybuild/easyconfigs/p/Python/Python-3.12.3-GCCcore-13.3.0.eb b/easybuild/easyconfigs/p/Python/Python-3.12.3-GCCcore-13.3.0.eb index 9f6d1a682342..9452e9a26468 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.12.3-GCCcore-13.3.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.12.3-GCCcore-13.3.0.eb @@ -11,9 +11,15 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] patches = ['Python-3.12.3_avoid-tkinter-build.patch'] + +# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' + checksums = [ {'Python-3.12.3.tgz': 'a6b9459f45a6ebbbc1af44f5762623fa355a0c87208ed417628b379d762dddb0'}, {'Python-3.12.3_avoid-tkinter-build.patch': '34fa44ca67fc08d41c58db2e289317f12f32777a352a982dca2e63459fc089e3'}, + {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} ] builddependencies = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb index 7e65c52a5e8f..93df74e55b8c 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb @@ -11,9 +11,15 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] patches = ['Python-3.12.3_avoid-tkinter-build.patch'] + +# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' + checksums = [ {'Python-3.13.1.tgz': '1513925a9f255ef0793dbf2f78bb4533c9f184bdd0ad19763fd7f47a400a7c55'}, {'Python-3.12.3_avoid-tkinter-build.patch': '34fa44ca67fc08d41c58db2e289317f12f32777a352a982dca2e63459fc089e3'}, + {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} ] builddependencies = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0-bare.eb b/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0-bare.eb index 25d4981ffe0b..478561eaf7d2 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0-bare.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0-bare.eb @@ -11,7 +11,15 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -checksums = ['e0fbd5b6e1ee242524430dee3c91baf4cbbaba4a72dd1674b90fda87b713c7ab'] + +# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' + +checksums = [ + {'Python-3.9.5.tgz': 'e0fbd5b6e1ee242524430dee3c91baf4cbbaba4a72dd1674b90fda87b713c7ab'}, + {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} +] builddependencies = [ ('UnZip', '6.0'), diff --git a/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0.eb b/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0.eb index 613bc37bfc08..6bf62a3bec77 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0.eb @@ -10,7 +10,15 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -checksums = ['e0fbd5b6e1ee242524430dee3c91baf4cbbaba4a72dd1674b90fda87b713c7ab'] + +# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' + +checksums = [ + {'Python-3.9.5.tgz': 'e0fbd5b6e1ee242524430dee3c91baf4cbbaba4a72dd1674b90fda87b713c7ab'}, + {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} +] builddependencies = [ ('UnZip', '6.0'), diff --git a/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0-bare.eb b/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0-bare.eb index d568ea3f8c84..26c7c0875f42 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0-bare.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0-bare.eb @@ -11,7 +11,15 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -checksums = ['d0a35182e19e416fc8eae25a3dcd4d02d4997333e4ad1f2eee6010aadc3fe866'] + +# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' + +checksums = [ + {'Python-3.9.6.tgz': 'd0a35182e19e416fc8eae25a3dcd4d02d4997333e4ad1f2eee6010aadc3fe866'}, + {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} +] builddependencies = [ ('UnZip', '6.0'), diff --git a/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0.eb index 8f2efa940cc1..e92dc3c1ba9e 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0.eb @@ -10,7 +10,15 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -checksums = ['d0a35182e19e416fc8eae25a3dcd4d02d4997333e4ad1f2eee6010aadc3fe866'] + +# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' + +checksums = [ + {'Python-3.9.6.tgz': 'd0a35182e19e416fc8eae25a3dcd4d02d4997333e4ad1f2eee6010aadc3fe866'}, + {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} +] builddependencies = [ ('UnZip', '6.0'), From c151fd3f2d5d3da35cbeac3b456966af545425b9 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Fri, 17 Oct 2025 00:26:46 +0200 Subject: [PATCH 18/25] Fix trailing whitespace --- easybuild/easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb index 79a51a2b05df..932439529fa6 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb @@ -18,7 +18,7 @@ patches = [ # Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH # In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries -patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' +patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ {'Python-3.13.1.tgz': '1513925a9f255ef0793dbf2f78bb4533c9f184bdd0ad19763fd7f47a400a7c55'}, From 19e83214741a520839930bc1b7dc6b69c6afa866 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Fri, 17 Oct 2025 14:40:58 +0200 Subject: [PATCH 19/25] Add missing quote --- .../easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb b/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb index 383b2b124b26..93c46b6dd89b 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb @@ -17,7 +17,7 @@ sources = [SOURCE_TGZ] patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ - {'Python-3.10.4.tgz: 'f3bcc65b1d5f1dc78675c746c98fcee823c038168fc629c5935b044d0911ad28'}, + {'Python-3.10.4.tgz': 'f3bcc65b1d5f1dc78675c746c98fcee823c038168fc629c5935b044d0911ad28'}, {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} ] From 0d4ff60da38c0618cfc6068c98ec9394d746b53b Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Fri, 17 Oct 2025 21:15:56 +0200 Subject: [PATCH 20/25] Fix quote --- easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb b/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb index 3e85e8e6a7ae..195e325c8a44 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb @@ -16,7 +16,7 @@ sources = [SOURCE_TGZ] patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ - {'Python-3.10.4.tgz: 'f3bcc65b1d5f1dc78675c746c98fcee823c038168fc629c5935b044d0911ad28'}, + {'Python-3.10.4.tgz': 'f3bcc65b1d5f1dc78675c746c98fcee823c038168fc629c5935b044d0911ad28'}, {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} ] From f682e59361c3a3939ab7d72f0eedfc3b78e00ecd Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen <33718780+casparvl@users.noreply.github.com> Date: Mon, 20 Oct 2025 14:31:55 +0200 Subject: [PATCH 21/25] Update easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch Make sure that we only return the plain 'name' argument, if this is indeed a full filepath. This patch changes the find_library behaviour to only return full filepaths, and it should do so in _all_ code paths. --- .../easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch index a9f21a4c9fca..f81e77962d26 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-custom-ctypes.patch @@ -151,7 +151,7 @@ diff -Nru Python-3.11.5.orig/Lib/ctypes/util.py Python-3.11.5/Lib/ctypes/util.py + # Redefine find_library function, it will return the provided name if + # path exist, else it will use the set of functions to find the full library path. + # it will return the one that has a match. -+ if os.path.exists(name): ++ if os.path.isabs(name) and os.path.exists(name): + return name + else: + return _findSoname_ldconfig(name) or \ From d3b2d8afc74f087f2687dd5a190ff0e0662024ff Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Mon, 20 Oct 2025 16:22:43 +0200 Subject: [PATCH 22/25] Update checksums --- .../easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb | 2 +- easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb | 2 +- .../easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0-bare.eb | 2 +- easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0.eb | 2 +- .../easyconfigs/p/Python/Python-3.11.2-GCCcore-12.2.0-bare.eb | 2 +- easybuild/easyconfigs/p/Python/Python-3.11.3-GCCcore-12.3.0.eb | 2 +- easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb | 2 +- easybuild/easyconfigs/p/Python/Python-3.12.3-GCCcore-13.3.0.eb | 2 +- easybuild/easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb | 2 +- .../easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0-bare.eb | 2 +- easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0.eb | 2 +- .../easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0-bare.eb | 2 +- easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0.eb | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb b/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb index 93c46b6dd89b..ea5b9432000e 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb @@ -18,7 +18,7 @@ patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ {'Python-3.10.4.tgz': 'f3bcc65b1d5f1dc78675c746c98fcee823c038168fc629c5935b044d0911ad28'}, - {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} + {'Python-3.11.5-custom-ctypes.patch': 'b29c22f47587460149e05296ff09b29bf790a83e2b3b13fb2f42f5f236ad8ea7'} ] builddependencies = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb b/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb index 195e325c8a44..d42dbc0991e9 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb @@ -17,7 +17,7 @@ patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ {'Python-3.10.4.tgz': 'f3bcc65b1d5f1dc78675c746c98fcee823c038168fc629c5935b044d0911ad28'}, - {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} + {'Python-3.11.5-custom-ctypes.patch': 'b29c22f47587460149e05296ff09b29bf790a83e2b3b13fb2f42f5f236ad8ea7'} ] builddependencies = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0-bare.eb b/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0-bare.eb index ca1e5d9c46ae..e7034e9496ae 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0-bare.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0-bare.eb @@ -18,7 +18,7 @@ patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ {'Python-3.10.8.tgz': 'f400c3fb394b8bef1292f6dc1292c5fadc3533039a5bc0c3e885f3e16738029a'}, - {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} + {'Python-3.11.5-custom-ctypes.patch': 'b29c22f47587460149e05296ff09b29bf790a83e2b3b13fb2f42f5f236ad8ea7'} ] builddependencies = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0.eb index 589c64a5be1c..683ce93a517e 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0.eb @@ -17,7 +17,7 @@ patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ {'Python-3.10.8.tgz': 'f400c3fb394b8bef1292f6dc1292c5fadc3533039a5bc0c3e885f3e16738029a'}, - {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} + {'Python-3.11.5-custom-ctypes.patch': 'b29c22f47587460149e05296ff09b29bf790a83e2b3b13fb2f42f5f236ad8ea7'} ] builddependencies = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.2-GCCcore-12.2.0-bare.eb b/easybuild/easyconfigs/p/Python/Python-3.11.2-GCCcore-12.2.0-bare.eb index 08d83607d72f..1801c5848653 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.2-GCCcore-12.2.0-bare.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.2-GCCcore-12.2.0-bare.eb @@ -18,7 +18,7 @@ patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ {'Python-3.11.2.tgz': '2411c74bda5bbcfcddaf4531f66d1adc73f247f529aee981b029513aefdbf849'}, - {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} + {'Python-3.11.5-custom-ctypes.patch': 'b29c22f47587460149e05296ff09b29bf790a83e2b3b13fb2f42f5f236ad8ea7'} ] builddependencies = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.3-GCCcore-12.3.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.3-GCCcore-12.3.0.eb index cb60144fd64f..c2d6af9b58a6 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.3-GCCcore-12.3.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.3-GCCcore-12.3.0.eb @@ -17,7 +17,7 @@ patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ {'Python-3.11.3.tgz': '1a79f3df32265d9e6625f1a0b31c28eb1594df911403d11f3320ee1da1b3e048'}, - {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} + {'Python-3.11.5-custom-ctypes.patch': 'b29c22f47587460149e05296ff09b29bf790a83e2b3b13fb2f42f5f236ad8ea7'} ] builddependencies = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb index d5516ea39750..e89bb22bfcd4 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb @@ -17,7 +17,7 @@ patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ {'Python-3.11.5.tgz': 'a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58'}, - {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} + {'Python-3.11.5-custom-ctypes.patch': 'b29c22f47587460149e05296ff09b29bf790a83e2b3b13fb2f42f5f236ad8ea7'} ] builddependencies = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.12.3-GCCcore-13.3.0.eb b/easybuild/easyconfigs/p/Python/Python-3.12.3-GCCcore-13.3.0.eb index 9452e9a26468..15f01ddd8984 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.12.3-GCCcore-13.3.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.12.3-GCCcore-13.3.0.eb @@ -19,7 +19,7 @@ patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ {'Python-3.12.3.tgz': 'a6b9459f45a6ebbbc1af44f5762623fa355a0c87208ed417628b379d762dddb0'}, {'Python-3.12.3_avoid-tkinter-build.patch': '34fa44ca67fc08d41c58db2e289317f12f32777a352a982dca2e63459fc089e3'}, - {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} + {'Python-3.11.5-custom-ctypes.patch': 'b29c22f47587460149e05296ff09b29bf790a83e2b3b13fb2f42f5f236ad8ea7'} ] builddependencies = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb index 932439529fa6..b430dad61153 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb @@ -24,7 +24,7 @@ checksums = [ {'Python-3.13.1.tgz': '1513925a9f255ef0793dbf2f78bb4533c9f184bdd0ad19763fd7f47a400a7c55'}, {'Python-3.12.3_avoid-tkinter-build.patch': '34fa44ca67fc08d41c58db2e289317f12f32777a352a982dca2e63459fc089e3'}, {'Python-3.13.1_runshared-ld-preload.patch': 'ca9ec56c71aafa881e7ddf6fba23fbecc016be48c2d912e5ccd92962ddd38edf'}, - {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'}, + {'Python-3.11.5-custom-ctypes.patch': 'b29c22f47587460149e05296ff09b29bf790a83e2b3b13fb2f42f5f236ad8ea7'}, ] builddependencies = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0-bare.eb b/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0-bare.eb index 478561eaf7d2..28e28ffca0dc 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0-bare.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0-bare.eb @@ -18,7 +18,7 @@ patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ {'Python-3.9.5.tgz': 'e0fbd5b6e1ee242524430dee3c91baf4cbbaba4a72dd1674b90fda87b713c7ab'}, - {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} + {'Python-3.11.5-custom-ctypes.patch': 'b29c22f47587460149e05296ff09b29bf790a83e2b3b13fb2f42f5f236ad8ea7'} ] builddependencies = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0.eb b/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0.eb index 6bf62a3bec77..803e841169df 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0.eb @@ -17,7 +17,7 @@ patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ {'Python-3.9.5.tgz': 'e0fbd5b6e1ee242524430dee3c91baf4cbbaba4a72dd1674b90fda87b713c7ab'}, - {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} + {'Python-3.11.5-custom-ctypes.patch': 'b29c22f47587460149e05296ff09b29bf790a83e2b3b13fb2f42f5f236ad8ea7'} ] builddependencies = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0-bare.eb b/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0-bare.eb index 26c7c0875f42..48b3e0a53f50 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0-bare.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0-bare.eb @@ -18,7 +18,7 @@ patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ {'Python-3.9.6.tgz': 'd0a35182e19e416fc8eae25a3dcd4d02d4997333e4ad1f2eee6010aadc3fe866'}, - {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} + {'Python-3.11.5-custom-ctypes.patch': 'b29c22f47587460149e05296ff09b29bf790a83e2b3b13fb2f42f5f236ad8ea7'} ] builddependencies = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0.eb index e92dc3c1ba9e..a1e3b8a0716c 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0.eb @@ -17,7 +17,7 @@ patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ {'Python-3.9.6.tgz': 'd0a35182e19e416fc8eae25a3dcd4d02d4997333e4ad1f2eee6010aadc3fe866'}, - {'Python-3.11.5-custom-ctypes.patch': '477a9453395f5298a24f9929ec4b9ecf32259ee4e121cb15ae45e0ad0c195dbe'} + {'Python-3.11.5-custom-ctypes.patch': 'b29c22f47587460149e05296ff09b29bf790a83e2b3b13fb2f42f5f236ad8ea7'} ] builddependencies = [ From 53bcda3721fc5f24be8f34b5e8186968b3cb7b4c Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Wed, 22 Oct 2025 19:21:09 +0200 Subject: [PATCH 23/25] update test_pr_sha256_checksums to take into account checksum for patch_ctypes_ld_library_path in Python easyconfigs --- test/easyconfigs/easyconfigs.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/easyconfigs/easyconfigs.py b/test/easyconfigs/easyconfigs.py index 003f9726f382..51ea7b3730aa 100644 --- a/test/easyconfigs/easyconfigs.py +++ b/test/easyconfigs/easyconfigs.py @@ -1254,6 +1254,28 @@ def test_pr_sha256_checksums(self): def is_bundle(ec): return ec['easyblock'] in bundle_easyblocks or ec['name'] == 'Clang-AOMP' ecs = [ec.copy() if is_bundle(ec) else ec for ec in retained_changed_ecs] + + # remove checksum for patch_ctypes_ld_library_path for Python easyconfigs, if present; + # this patch gets added automatically to list of patches by Python easyblock constructor, + # and causes check_sha256_checksums to fail because an extra checksum is found + for ec in ecs: + ec_fn = os.path.basename(ec.path) + if ec['name'] == 'Python': + patch_ctypes_ld_library_path = ec.get('patch_ctypes_ld_library_path') + if patch_ctypes_ld_library_path: + checksums = ec['checksums'] + if not isinstance(checksums, list): + self.fail(f"Don't know how to handle non-list value type for checksums in {ec_fn}") + idx_match = None + for idx, entry in enumerate(checksums): + if patch_ctypes_ld_library_path in entry: + idx_match = idx + break + if idx_match: + del checksums[idx] + else: + self.fail(f"No checksum found for {patch_ctypes_ld_library_path} in {ec_fn}") + checksum_issues = check_sha256_checksums(ecs, whitelist=whitelist) self.assertTrue(len(checksum_issues) == 0, "No checksum issues:\n%s" % '\n'.join(checksum_issues)) From f74dbf004ecb9e079f330f878d093c86a934dfe5 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Wed, 22 Oct 2025 21:42:03 +0200 Subject: [PATCH 24/25] Since we modify the checksums list, we need to use get_ref, since ec['checksums'] actually returns a copy, not a reference --- test/easyconfigs/easyconfigs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/easyconfigs/easyconfigs.py b/test/easyconfigs/easyconfigs.py index 51ea7b3730aa..c4f671c9736b 100644 --- a/test/easyconfigs/easyconfigs.py +++ b/test/easyconfigs/easyconfigs.py @@ -1263,7 +1263,7 @@ def is_bundle(ec): if ec['name'] == 'Python': patch_ctypes_ld_library_path = ec.get('patch_ctypes_ld_library_path') if patch_ctypes_ld_library_path: - checksums = ec['checksums'] + checksums = ec.get_ref('checksums') if not isinstance(checksums, list): self.fail(f"Don't know how to handle non-list value type for checksums in {ec_fn}") idx_match = None From 575c58f16b925fe85e0e2891e08bc461e0e82238 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Wed, 22 Oct 2025 22:29:45 +0200 Subject: [PATCH 25/25] trivial tweak in comment for patch_ctypes_ld_library_path in Python easyconfigs --- .../easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb | 4 ++-- .../easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb | 4 ++-- .../easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0-bare.eb | 4 ++-- .../easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0.eb | 4 ++-- .../easyconfigs/p/Python/Python-3.11.2-GCCcore-12.2.0-bare.eb | 4 ++-- .../easyconfigs/p/Python/Python-3.11.3-GCCcore-12.3.0.eb | 4 ++-- .../easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb | 4 ++-- .../easyconfigs/p/Python/Python-3.12.3-GCCcore-13.3.0.eb | 4 ++-- .../easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb | 4 ++-- .../easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0-bare.eb | 4 ++-- easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0.eb | 4 ++-- .../easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0-bare.eb | 4 ++-- easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0.eb | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb b/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb index ea5b9432000e..402289f9c764 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0-bare.eb @@ -12,8 +12,8 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH -# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +# Like patches, but these will only be applied if EasyBuild is configured to filter $LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on $LD_LIBRARY_PATH to find libraries patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb b/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb index d42dbc0991e9..761064ed09d7 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.10.4-GCCcore-11.3.0.eb @@ -11,8 +11,8 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH -# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +# Like patches, but these will only be applied if EasyBuild is configured to filter $LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on $LD_LIBRARY_PATH to find libraries patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0-bare.eb b/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0-bare.eb index e7034e9496ae..a7b6a7240ee2 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0-bare.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0-bare.eb @@ -12,8 +12,8 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH -# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +# Like patches, but these will only be applied if EasyBuild is configured to filter $LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on $LD_LIBRARY_PATH to find libraries patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0.eb index 683ce93a517e..4e412ca3e865 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.10.8-GCCcore-12.2.0.eb @@ -11,8 +11,8 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH -# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +# Like patches, but these will only be applied if EasyBuild is configured to filter $LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on $LD_LIBRARY_PATH to find libraries patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.2-GCCcore-12.2.0-bare.eb b/easybuild/easyconfigs/p/Python/Python-3.11.2-GCCcore-12.2.0-bare.eb index 1801c5848653..da627837df66 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.2-GCCcore-12.2.0-bare.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.2-GCCcore-12.2.0-bare.eb @@ -12,8 +12,8 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH -# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +# Like patches, but these will only be applied if EasyBuild is configured to filter $LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on $LD_LIBRARY_PATH to find libraries patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.3-GCCcore-12.3.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.3-GCCcore-12.3.0.eb index c2d6af9b58a6..8cfeee10ab12 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.3-GCCcore-12.3.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.3-GCCcore-12.3.0.eb @@ -11,8 +11,8 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH -# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +# Like patches, but these will only be applied if EasyBuild is configured to filter $LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on $LD_LIBRARY_PATH to find libraries patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb index e89bb22bfcd4..e118977eb2ff 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.11.5-GCCcore-13.2.0.eb @@ -11,8 +11,8 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH -# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +# Like patches, but these will only be applied if EasyBuild is configured to filter $LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on $LD_LIBRARY_PATH to find libraries patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.12.3-GCCcore-13.3.0.eb b/easybuild/easyconfigs/p/Python/Python-3.12.3-GCCcore-13.3.0.eb index 15f01ddd8984..089eeb31808d 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.12.3-GCCcore-13.3.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.12.3-GCCcore-13.3.0.eb @@ -12,8 +12,8 @@ source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] patches = ['Python-3.12.3_avoid-tkinter-build.patch'] -# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH -# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +# Like patches, but these will only be applied if EasyBuild is configured to filter $LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on $LD_LIBRARY_PATH to find libraries patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb index b430dad61153..4f44ede9666b 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.13.1-GCCcore-14.2.0.eb @@ -16,8 +16,8 @@ patches = [ 'Python-3.13.1_runshared-ld-preload.patch', ] -# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH -# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +# Like patches, but these will only be applied if EasyBuild is configured to filter $LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on $LD_LIBRARY_PATH to find libraries patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0-bare.eb b/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0-bare.eb index 28e28ffca0dc..1e58b588274f 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0-bare.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0-bare.eb @@ -12,8 +12,8 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH -# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +# Like patches, but these will only be applied if EasyBuild is configured to filter $LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on $LD_LIBRARY_PATH to find libraries patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0.eb b/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0.eb index 803e841169df..abe22e570006 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.9.5-GCCcore-10.3.0.eb @@ -11,8 +11,8 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH -# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +# Like patches, but these will only be applied if EasyBuild is configured to filter $LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on $LD_LIBRARY_PATH to find libraries patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0-bare.eb b/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0-bare.eb index 48b3e0a53f50..5a65708adb55 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0-bare.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0-bare.eb @@ -12,8 +12,8 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH -# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +# Like patches, but these will only be applied if EasyBuild is configured to filter $LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on $LD_LIBRARY_PATH to find libraries patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [ diff --git a/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0.eb b/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0.eb index a1e3b8a0716c..ba72e7aa74c3 100644 --- a/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0.eb +++ b/easybuild/easyconfigs/p/Python/Python-3.9.6-GCCcore-11.2.0.eb @@ -11,8 +11,8 @@ toolchainopts = {'pic': True} source_urls = ['https://www.python.org/ftp/%(namelower)s/%(version)s/'] sources = [SOURCE_TGZ] -# Like patches, but these will only be applied if EasyBuild is configured to filter LD_LIBRARY_PATH -# In that scenario, ctypes needs to be patched since it heavily relies on LD_LIBRARY_PATH to find libraries +# Like patches, but these will only be applied if EasyBuild is configured to filter $LD_LIBRARY_PATH +# In that scenario, ctypes needs to be patched since it heavily relies on $LD_LIBRARY_PATH to find libraries patch_ctypes_ld_library_path = 'Python-3.11.5-custom-ctypes.patch' checksums = [