Skip to content

Commit 454f757

Browse files
author
Caspar van Leeuwen
committed
Do the same thing with less duplication
1 parent e080044 commit 454f757

1 file changed

Lines changed: 5 additions & 16 deletions

File tree

EESSI-extend-easybuild.eb

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -211,23 +211,12 @@ 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
229214
-- Set environment variables that are EasyBuild version specific
230-
elseif convertToCanonical(easybuild_version) >= convertToCanonical("5.1") then
215+
-- Do 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+
if convertToCanonical(easybuild_version) >= convertToCanonical("5.1") or mode() == "unload" then
231220
setenv ("EASYBUILD_STRICT_RPATH_SANITY_CHECK", "1")
232221
setenv ("EASYBUILD_CUDA_SANITY_CHECK_ERROR_ON_FAILED_CHECKS", "1")
233222
setenv ("EASYBUILD_FAIL_ON_MOD_FILES_GCCCORE", "1")

0 commit comments

Comments
 (0)