fix unresolved templates in modextravars/modextrapaths of Bundle components
#3940
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(created using
eb --new-pr)The following example EC causes an unresolved templates error due to modextravars/paths even with
--module-onlyIssue is that those parameters are copied to each component and then the
make_module_stepfor each component is called without the required templates being available. Example dict:{'arch': 'x86_64', 'rpath_enabled': 'false', 'sysroot': '', 'software_commit': '', 'nameletter': 'z', 'toolchain_name': 'system', 'toolchain_version': 'system', 'version_major': '1', 'version_minor': '3', 'version_major_minor': '1.3', 'bitbucket_account': 'zlib', 'github_account': 'zlib', 'name': 'zlib', 'version': '1.3.1', 'versionsuffix': '', 'versionprefix': '', 'namelower': 'zlib', 'nameletterlower': 'z', 'module_name': 'Test/1.0.0'}Even when suppressing the error the resulting module would be wrong as it contains the unresolved template.
Due to another bug those values don't turn up in module files.
So those 2 parameters must also not be inherited.
I refactored the code to loop over all values to reset and use the explicit default value instead of e.g. an empty list.
That could actually have been an issue because
a = b = []does only create a single list, so modifyingsource_urlsmodifiessourcestoo.Doesn't seem to be an issue so far but better to fix this now.
The loop makes it easier to extend this to more parameters as required.