Skip to content

Commit

Permalink
Use a pre-permission hook to avoid issues with permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
ocaisa committed Nov 9, 2023
1 parent 7d7f7e0 commit 08b3e42
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions eb_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ def pre_configure_hook(self, *args, **kwargs):
PRE_CONFIGURE_HOOKS[self.name](self, *args, **kwargs)


def post_package_hook(self, *args, **kwargs):
def pre_permissions_hook(self, *args, **kwargs):
"""Main post-package hook: trigger custom functions based on software name."""
if self.name in POST_PACKAGE_HOOKS:
POST_PACKAGE_HOOKS[self.name](self, *args, **kwargs)
if self.name in PRE_PERMISSIONS_HOOKS:
PRE_PERMISSIONS_HOOKS[self.name](self, *args, **kwargs)


def pre_configure_hook_openblas_optarch_generic(self, *args, **kwargs):
Expand Down Expand Up @@ -336,7 +336,7 @@ def pre_single_extension_isoband(ext, *args, **kwargs):
# cfr. https://github.com/r-lib/isoband/commit/6984e6ce8d977f06e0b5ff73f5d88e5c9a44c027
ext.cfg['preinstallopts'] = "sed -i 's/SIGSTKSZ/32768/g' src/testthat/vendor/catch.h && "

def post_package_cuda(self, *args, **kwargs):
def pre_permissions_cuda(self, *args, **kwargs):
"""Delete CUDA files we are not allowed to ship and replace them with a symlink to a possible installation under host_injections."""
print_msg("Replacing CUDA stuff we cannot ship with symlinks...")
# read CUDA EULA
Expand Down Expand Up @@ -437,6 +437,6 @@ def inject_gpu_property(ec):
'testthat': pre_single_extension_testthat,
}

POST_PACKAGE_HOOKS = {
'CUDA': post_package_cuda,
PRE_PERMISSIONS_HOOKS = {
'CUDA': pre_permissions_cuda,
}

0 comments on commit 08b3e42

Please sign in to comment.