Skip to content

Commit e080044

Browse files
author
Caspar van Leeuwen
committed
Fix that we unset EB config vars unconditionally upon unload
1 parent 1e0a49a commit e080044

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

EESSI-extend-easybuild.eb

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,23 @@ end
211211
easybuild_version = os.getenv("EBVERSIONEASYBUILD") or easybuild_version
212212
eessi_version = os.getenv("EESSI_VERSION") or "2023.06"
213213
214+
if (mode() == "unload") then
215+
-- unload unconditionally, so that even if EB versions were switched in the meantime, this gets unset
216+
-- This avoids issues where EESSI-extend is first loaded with EB => 5.1 (which set these vars)
217+
-- but then EB is swapped for a version < 5.1 and then EESSI-extend is unloaded (which would not unset
218+
-- these vars if we did it conditional on the EB version)
219+
setenv ("EASYBUILD_STRICT_RPATH_SANITY_CHECK", "1")
220+
setenv ("EASYBUILD_CUDA_SANITY_CHECK_ERROR_ON_FAILED_CHECKS", "1")
221+
setenv ("EASYBUILD_FAIL_ON_MOD_FILES_GCCCORE", "1")
222+
setenv ("EASYBUILD_LOCAL_VAR_NAMING_CHECK", "error")
223+
-- This can still be conditional, eessi_version is always set
224+
if convertToCanonical(eessi_version) > convertToCanonical("2023.06") then
225+
setenv ("EASYBUILD_PREFER_PYTHON_SEARCH_PATH", "EBPYTHONPREFIXES")
226+
setenv ("EASYBUILD_MODULE_SEARCH_PATH_HEADERS", "include_paths")
227+
setenv ("EASYBUILD_SEARCH_PATH_CPP_HEADERS", "include_paths")
228+
end
214229
-- Set environment variables that are EasyBuild version specific
215-
if convertToCanonical(easybuild_version) >= convertToCanonical("5.1") then
230+
elseif convertToCanonical(easybuild_version) >= convertToCanonical("5.1") then
216231
setenv ("EASYBUILD_STRICT_RPATH_SANITY_CHECK", "1")
217232
setenv ("EASYBUILD_CUDA_SANITY_CHECK_ERROR_ON_FAILED_CHECKS", "1")
218233
setenv ("EASYBUILD_FAIL_ON_MOD_FILES_GCCCORE", "1")

0 commit comments

Comments
 (0)