Skip to content

Commit 6b119a6

Browse files
committed
avoid initializing Toolchain instance when taking into account toolchain dependencies for templates + revert change from #3541 to test from which started failing because of triggering early Toolchain initialization
1 parent 9fd885c commit 6b119a6

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

easybuild/framework/easyconfig/templates.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ def template_constant_dict(config, ignore=None, skip_lower=None, toolchain=None)
233233
# a cyclic import...);
234234
# we need to know to determine whether we're iterating over a list of build dependencies
235235
is_easyconfig = hasattr(config, 'iterating') and hasattr(config, 'iterate_options')
236-
237236
if is_easyconfig:
238237
# if we're iterating over different lists of build dependencies,
239238
# only consider build dependencies when we're actually in iterative mode!
@@ -243,9 +242,11 @@ def template_constant_dict(config, ignore=None, skip_lower=None, toolchain=None)
243242
else:
244243
deps.extend(config.get('builddependencies', []))
245244

246-
# Include all toolchain deps (e.g. CUDAcore template in fosscuda)
247-
if config.toolchain.tcdeps is not None:
248-
deps.extend(config.toolchain.tcdeps)
245+
# include all toolchain deps (e.g. CUDAcore component in fosscuda);
246+
# access Toolchain instance via _toolchain to avoid triggering initialization of the toolchain!
247+
if config._toolchain is not None:
248+
if config._toolchain.tcdeps is not None:
249+
deps.extend(config._toolchain.tcdeps)
249250

250251
for dep in deps:
251252
if isinstance(dep, dict):

test/framework/robot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def test_resolve_dependencies_minimal(self):
436436
" ('SQLite', '3.8.10.2'),",
437437
"]",
438438
# toolchain as list line, for easy modification later;
439-
"toolchain = {'name': 'foss', 'version': '2018a'}",
439+
"toolchain = {'name': 'foss', 'version': '%(version_minor)s018a'}",
440440
]
441441
write_file(barec, '\n'.join(barec_lines))
442442
bar = process_easyconfig(barec)[0]

0 commit comments

Comments
 (0)