From aa9b515c7f2422ee51b707828c827c48caaad83c Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 3 Jun 2026 09:31:57 +0200 Subject: [PATCH 1/2] Have accelerator installation location respect EESSI_SITE_SOFTWARE_PREFIX in eb_hooks.py --- eb_hooks.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 0a22b2c2..976d5f75 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -52,6 +52,7 @@ EESSI_INSTALLATION_REGEX = r"^/cvmfs/[^/]*.eessi.io/versions/" HOST_INJECTIONS_LOCATION = "/cvmfs/software.eessi.io/host_injections/" +SITE_INSTALLATIONS_LOCATION = os.getenv("EESSI_SITE_SOFTWARE_PREFIX", HOST_INJECTIONS_LOCATION) # Make sure a single environment variable name is used for this throughout the hooks EESSI_IGNORE_ZEN4_GCC1220_ENVVAR="EESSI_IGNORE_LMOD_ERROR_ZEN4_GCC1220" @@ -744,7 +745,7 @@ def pre_fetch_hook_check_installation_path(self, *args, **kwargs): accelerator_toolchains = ['rocm-compilers', 'rompi', 'rfbf', 'rfoss'] strict_eessi_installation = ( bool(re.search(EESSI_INSTALLATION_REGEX, self.installdir)) or - self.installdir.startswith(HOST_INJECTIONS_LOCATION)) + self.installdir.startswith(SITE_INSTALLATIONS_LOCATION)) if strict_eessi_installation and not os.getenv("EESSI_OVERRIDE_STRICT_INSTALLPATH_CHECK"): dependency_names = self.cfg.dependency_names() if ( @@ -757,7 +758,9 @@ def pre_fetch_hook_check_installation_path(self, *args, **kwargs): raise EasyBuildError( f"It seems you are trying to install an accelerator package {self.cfg.name} into a " f"non-accelerator location {self.installdir}. You need to reconfigure your installation to target " - "the correct location." + "the correct location. If using the EESSI-extend module, this means reloading that module " + "with EESSI_ACCELERATOR_INSTALL set:\n" + " EESSI_ACCELERATOR_TARGET=1 module load EESSI-extend" ) else: # If we don't have an accelerator dependency then we should be in a CPU installation path @@ -765,7 +768,9 @@ def pre_fetch_hook_check_installation_path(self, *args, **kwargs): raise EasyBuildError( f"It seems you are trying to install a CPU-only package {self.cfg.name} into accelerator location " f"{self.installdir}. If this is a dependency of the package you are really interested in you will " - "need to first install the CPU-only dependencies of that package." + "need to first install the CPU-only dependencies of that package. If using the EESSI-extend " + "module, this means reloading that module with EESSI_ACCELERATOR_INSTALL unset:\n" + " unset EESSI_ACCELERATOR_TARGET=1 && module load EESSI-extend" ) From cb72c6a0759d46fcdb8843dd405334cbce0b616c Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 3 Jun 2026 09:34:32 +0200 Subject: [PATCH 2/2] Try to keep naming consistent --- eb_hooks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 976d5f75..9af30a2c 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -52,7 +52,7 @@ EESSI_INSTALLATION_REGEX = r"^/cvmfs/[^/]*.eessi.io/versions/" HOST_INJECTIONS_LOCATION = "/cvmfs/software.eessi.io/host_injections/" -SITE_INSTALLATIONS_LOCATION = os.getenv("EESSI_SITE_SOFTWARE_PREFIX", HOST_INJECTIONS_LOCATION) +SITE_INSTALLATION_LOCATION = os.getenv("EESSI_SITE_SOFTWARE_PREFIX", HOST_INJECTIONS_LOCATION) # Make sure a single environment variable name is used for this throughout the hooks EESSI_IGNORE_ZEN4_GCC1220_ENVVAR="EESSI_IGNORE_LMOD_ERROR_ZEN4_GCC1220" @@ -745,7 +745,7 @@ def pre_fetch_hook_check_installation_path(self, *args, **kwargs): accelerator_toolchains = ['rocm-compilers', 'rompi', 'rfbf', 'rfoss'] strict_eessi_installation = ( bool(re.search(EESSI_INSTALLATION_REGEX, self.installdir)) or - self.installdir.startswith(SITE_INSTALLATIONS_LOCATION)) + self.installdir.startswith(SITE_INSTALLATION_LOCATION)) if strict_eessi_installation and not os.getenv("EESSI_OVERRIDE_STRICT_INSTALLPATH_CHECK"): dependency_names = self.cfg.dependency_names() if (