From 6bc56cace6811e8a52982a2d27e6d8ead13bffc1 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Thu, 30 Jul 2026 17:15:14 +0200 Subject: [PATCH] fix post_easyblock_hook_copy_easybuild_subdir: check that 'easybuild' subdirectory exists before trying to copy it to reprod directory --- eb_hooks.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eb_hooks.py b/eb_hooks.py index edbaee7d..6774b44b 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -961,7 +961,12 @@ def post_easyblock_hook_copy_easybuild_subdir(self, *args, **kwargs): now_utc_timestamp = datetime.datetime.now(datetime.UTC).strftime('%Y%m%d_%H%M%S%Z') app_easybuild_dir = os.path.join(self.installdir, config.log_path(ec=self.cfg)) app_reprod_dir = os.path.join(stack_reprod_dir, self.install_subdir, now_utc_timestamp, 'easybuild') - copy_dir(app_easybuild_dir, app_reprod_dir) + # take into account that 'easybuild' subdirectory may not exist yet, + # for example in case of installations that failed because source files could not be downloaded + if os.path.exists(app_easybuild_dir): + copy_dir(app_easybuild_dir, app_reprod_dir) + else: + self.log.warning(f"{app_easybuild_dir} was *not* copied to {app_reprod_dir}, because it does not exist!") def pre_prepare_hook_cuda_dependant(self, *args, **kwargs):