Skip to content

Commit e246ee8

Browse files
committed
Check for self.cfg.iterate_options instead of #iters>1
This deals with easyconfigs that have lists with just one element so they will be iterated: `toy.eb` in tests has `prebuildopts = "echo \"int main() { return 0; }\" > exts-git.c && ",` the trailing comma makes that a tuple with one element.
1 parent 1535bc9 commit e246ee8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

easybuild/framework/easyblock.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2378,7 +2378,7 @@ def handle_iterate_opts(self):
23782378
# handle configure/build/install options that are specified as lists (+ perhaps builddependencies)
23792379
# set first element to be used, keep track of list in self.iter_opts
23802380
# only needs to be done during first iteration, since after that the options won't be lists anymore
2381-
if self.iter_idx == 0 and self.det_iter_cnt() > 1:
2381+
if self.iter_idx == 0 and self.cfg.iterate_options:
23822382
# keep track of list, supply first element as first option to handle
23832383
for opt in ITERATE_OPTIONS:
23842384
self.iter_opts[opt] = self.cfg[opt] # copy
@@ -2391,6 +2391,9 @@ def handle_iterate_opts(self):
23912391
# pop first element from all iterative easyconfig parameters as next value to use
23922392
for opt, value in self.iter_opts.items():
23932393
if opt not in self.cfg.iterate_options:
2394+
# Use original value even for options that were specified as strings so don't change
2395+
# (ie. elements in ITERATE_OPTIONS but not in self.cfg.iterate_options), so they
2396+
# are restored after an easyblock such as CMakeMake changes them
23942397
self.cfg[opt] = value
23952398
elif len(value) > self.iter_idx:
23962399
self.cfg[opt] = value[self.iter_idx]

0 commit comments

Comments
 (0)