From 1ccf30a4eef8142c1c9ec8fb4d6a384fe8bf41f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 27 Jun 2025 09:27:48 +0200 Subject: [PATCH 1/3] also copy patches of extensions to easybuild subdir of installation dir --- easybuild/framework/easyblock.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/easybuild/framework/easyblock.py b/easybuild/framework/easyblock.py index 021d524012..478cf4b9ae 100644 --- a/easybuild/framework/easyblock.py +++ b/easybuild/framework/easyblock.py @@ -5144,7 +5144,10 @@ def ensure_writable_log_dir(log_dir): _log.debug("Copied easyconfig file %s to %s", spec, newspec) # copy patches - for patch in app.patches: + patches = app.patches + for ext in app.exts: + patches += ext.get('patches', []) + for patch in patches: target = os.path.join(new_log_dir, os.path.basename(patch['path'])) copy_file(patch['path'], target) _log.debug("Copied patch %s to %s", patch['path'], target) From f3fb6c07bb7b6d4eafe5c644cce87215489f8b40 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Fri, 27 Jun 2025 09:45:07 +0200 Subject: [PATCH 2/3] enhance test to verify that extension patches were copied to 'easybuild' subdir in installation directory --- test/framework/toy_build.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/framework/toy_build.py b/test/framework/toy_build.py index 914daa306e..fc0439ca4c 100644 --- a/test/framework/toy_build.py +++ b/test/framework/toy_build.py @@ -1387,6 +1387,16 @@ def test_toy_extension_patches_postinstallcmds(self): fn = 'created-via-postinstallcmds.txt' self.assertExists(os.path.join(installdir, fn)) + # make sure that patch file for extension was copied to 'easybuild' subdir in installation directory + easybuild_subdir = os.path.join(installdir, 'easybuild') + patches = sorted(os.path.basename(x) for x in glob.glob(os.path.join(easybuild_subdir, '*.patch'))) + expected_patches = [ + 'bar-0.0_fix-silly-typo-in-printf-statement.patch', + 'bar-0.0_fix-very-silly-typo-in-printf-statement.patch', + 'toy-0.0_fix-silly-typo-in-printf-statement.patch', + ] + self.assertEqual(patches, expected_patches) + def test_toy_extension_sources(self): """Test install toy that includes extensions with 'sources' spec (as single-item list).""" topdir = os.path.dirname(os.path.abspath(__file__)) From e3d56b29a22f2bbb8cc00b008e75eefa07bf7dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 27 Jun 2025 10:01:11 +0200 Subject: [PATCH 3/3] also copy exts patches to central repo --- easybuild/framework/easyblock.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/easybuild/framework/easyblock.py b/easybuild/framework/easyblock.py index 478cf4b9ae..c2de49d38e 100644 --- a/easybuild/framework/easyblock.py +++ b/easybuild/framework/easyblock.py @@ -5119,7 +5119,10 @@ def ensure_writable_log_dir(log_dir): block = det_full_ec_version(app.cfg) + ".block" repo.add_easyconfig(ecdict['original_spec'], app.name, block, buildstats, currentbuildstats) repo.add_easyconfig(spec, app.name, det_full_ec_version(app.cfg), buildstats, currentbuildstats) - for patch in app.patches: + patches = app.patches + for ext in app.exts: + patches += ext.get('patches', []) + for patch in patches: repo.add_patch(patch['path'], app.name) repo.commit("Built %s" % app.full_mod_name) del repo