Skip to content

Commit

Permalink
pre-package hook for EESSI-extend that stats all files/dirs in instal…
Browse files Browse the repository at this point in the history
…lation directory
  • Loading branch information
truib committed Nov 14, 2024
1 parent 2184b30 commit 2438c47
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions eb_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,29 @@ def inject_gpu_property(ec):
return ec


def pre_package_hook(self, *args, **kwargs):
"""Main pre-package hook: trigger custom functions based on software name."""
if self.name in PRE_PACKAGE_HOOKS:
PRE_PACKAGE_HOOKS[self.name](self, *args, **kwargs)


def pre_package_eessi_extend(self, *args, **kwargs):
"""
Pre-package hook for EESSI-extend: ls/stat all files/directories to work around
'permission denied' issue when package got removed (and this hook is run when
the package is being rebuilt)
"""
if self.name == 'EESSI-extend':
dir_tree = []
for root, _, files in os.walk(self.installdir):
dir_tree.append(root)
for f in files:
tree.append(os.path.join(root, f))
for entry in dir_tree:
print(entry)
os.stat(entry)


PARSE_HOOKS = {
'casacore': parse_hook_casacore_disable_vectorize,
'CGAL': parse_hook_cgal_toolchainopts_precise,
Expand Down Expand Up @@ -1020,4 +1043,7 @@ def inject_gpu_property(ec):
POST_POSTPROC_HOOKS = {
'CUDA': post_postproc_cuda,
'cuDNN': post_postproc_cudnn,

PRE_PACKAGE_HOOKS = {
'EESSI-extend': pre_package_eessi_extend,
}

0 comments on commit 2438c47

Please sign in to comment.