Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions easybuild/framework/easyconfig/easyconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,10 @@ def robot_find_minimal_toolchain_of_dependency(dep, modtool, parent_tc=None, par
parent_tc = dep['toolchain']

avail_modules = []
if build_option('use_existing_modules') and not build_option('retain_all_deps'):
# Use existing modules is only considered relevant to the case where we have minimal toolchains
check_for_module_or_retain_dep = (build_option('use_existing_modules') or not build_option('minimal_toolchains'))\
and not build_option('retain_all_deps')
if check_for_module_or_retain_dep:
avail_modules = modtool.available()

newdep = copy.deepcopy(dep)
Expand All @@ -1463,7 +1466,7 @@ def robot_find_minimal_toolchain_of_dependency(dep, modtool, parent_tc=None, par
if eb_file is not None:
module_exists = False
# if necessary check if module exists
if build_option('use_existing_modules') and not build_option('retain_all_deps'):
if check_for_module_or_retain_dep:
full_mod_name = ActiveMNS().det_full_module_name(newdep)
# fallback to checking with modtool.exist is required,
# for hidden modules and external modules where module name may be partial
Expand All @@ -1476,7 +1479,7 @@ def robot_find_minimal_toolchain_of_dependency(dep, modtool, parent_tc=None, par

# select the toolchain to return, defaulting to the first element (lowest possible toolchain)
minimal_toolchain = possible_toolchains[0]['toolchain']
if build_option('use_existing_modules') and not build_option('retain_all_deps'):
if check_for_module_or_retain_dep:
# take the last element in the case of using existing modules (allows for potentially better optimisation)
filtered_possibilities = [tc for tc in possible_toolchains if tc['module_exists']]
if filtered_possibilities:
Expand Down