Skip to content

Commit ce0e0fe

Browse files
committed
remove temporary workaround that copies extension patches, clean up, only copy easybuild subdir with post_easyblock_hook
1 parent c32f1ec commit ce0e0fe

1 file changed

Lines changed: 11 additions & 33 deletions

File tree

eb_hooks.py

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -520,24 +520,18 @@ def post_module_hook_zen4_gcccore1220(self, *args, **kwargs):
520520
del self.initial_environ[EESSI_IGNORE_ZEN4_GCC1220_ENVVAR]
521521

522522

523-
def post_easyblock_hook_copy_exts_patches_to_easybuild_subdir(self, *args, **kwargs):
524-
"""Copy the patches of extensions to the easybuild subdir of the installation directory."""
525-
526-
# Temporary fix for https://github.com/easybuilders/easybuild-framework/issues/4864:
527-
# make sure that the patches of extensions are copied to the easybuild subdirectory
528-
for ext in self.exts:
529-
for patch in ext.get('patches', []):
530-
new_log_dir = os.path.join(self.installdir, config.log_path(ec=self.cfg))
531-
target = os.path.join(new_log_dir, os.path.basename(patch['path']))
532-
copy_file(patch['path'], target)
533-
534-
# Now we simply copy the entire "easybuild" subdirectory of the installed application
535-
# to a timestamped subdirectory of the stack's central reprod directory, e.g.:
536-
#
523+
def post_easyblock_hook_copy_easybuild_subdir(self, *args, **kwargs):
524+
"""
525+
Post easyblock hook that copies the easybuild subdirectory of every installed application
526+
to a central and timestamped location in the root of the software stack, e.g.:
527+
/path/to/stack/reprod/20250102T12:34:56Z/MyApp/1.2-foss-2025a
528+
"""
529+
537530
stack_reprod_dir = os.path.join(os.path.dirname(install_path()), STACK_REPROD_SUBDIR)
538531
now_utc_timestamp = datetime.datetime.now(datetime.UTC).isoformat('T', 'seconds').replace('+00:00', 'Z')
539-
app_reprod_dir = os.path.join(stack_reprod_dir, self.install_subdir, now_utc_timestamp)
540-
copy_dir(new_log_dir, app_reprod_dir)
532+
app_easybuild_dir = os.path.join(self.installdir, config.log_path(ec=self.cfg))
533+
app_reprod_dir = os.path.join(stack_reprod_dir, self.install_subdir, now_utc_timestamp, 'easybuild')
534+
copy_dir(app_easybuild_dir, app_reprod_dir)
541535

542536

543537
# Modules for dependencies are loaded in the prepare step. Thus, that's where we need this variable to be set
@@ -1327,23 +1321,7 @@ def post_easyblock_hook(self, *args, **kwargs):
13271321
POST_EASYBLOCK_HOOKS[self.name](self, *args, **kwargs)
13281322

13291323
# Always trigger this one, regardless of self.name
1330-
post_easyblock_hook_copy_exts_patches_to_easybuild_subdir(self, *args, **kwargs)
1331-
1332-
1333-
def post_build_and_install_loop_hook(ecs, *args, **kwargs):
1334-
"""
1335-
Post build and install loop hook that copies the easybuild subdirectory of every installed application
1336-
to a central location in the root of the software stack, e.g.:
1337-
/path/to/stack/reprod/20250102T12:34:56Z/MyApp/1.2-foss-2025a
1338-
"""
1339-
1340-
stack_reprod_dir = os.path.join(os.path.dirname(install_path()), STACK_REPROD_SUBDIR)
1341-
for (ec, status) in ecs:
1342-
if status['success']:
1343-
now_timestamp = datetime.datetime.now(datetime.UTC).isoformat('T', 'seconds').replace('+00:00', 'Z')
1344-
app_easybuild_dir = os.path.dirname(status['log_file'])
1345-
app_reprod_dir = os.path.join(stack_reprod_dir, ec['short_mod_name'], now_timestamp, 'easybuild')
1346-
copy_dir(app_easybuild_dir, app_reprod_dir)
1324+
post_easyblock_hook_copy_easybuild_subdir(self, *args, **kwargs)
13471325

13481326

13491327
PARSE_HOOKS = {

0 commit comments

Comments
 (0)