Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions easybuild/framework/easyblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions test/framework/toy_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__))
Expand Down