diff --git a/easybuild/framework/easyblock.py b/easybuild/framework/easyblock.py index 021d524012..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 @@ -5144,7 +5147,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) 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__))