Skip to content

Conversation

@Flamefire
Copy link
Contributor

@Flamefire Flamefire commented Sep 23, 2025

(created using eb --new-pr)

The following example EC causes an unresolved templates error due to modextravars/paths even with --module-only

easyblock = 'Bundle'

name = 'Test'
version = '1.0.0'

description = "Test modextravars with installdir template"
homepage = ''

toolchain = SYSTEM

default_easyblock = 'Binary'
components = [
    ('zlib', '1.3.1', {
	'install_cmd': 'echo "Hello World"',
	'source_urls': ['https://zlib.net/fossils/'],
	'sources': [SOURCELOWER_TAR_GZ],
    }),
]

modextravars = { 'TEST_VAR': '%(installdir)s' }
modextrapaths = { 'TEST_DIR': '%(installdir)s' }

moduleclass = 'lib'

Issue is that those parameters are copied to each component and then the make_module_step for 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 modifying source_urls modifies sources too.
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.

@Flamefire Flamefire force-pushed the 20250923173504_new_pr_bundle branch from e44546b to 4f87e2a Compare September 23, 2025 15:44
@Flamefire
Copy link
Contributor Author

Test report by @Flamefire

Overview of tested easyconfigs (in order)

  • SUCCESS Wayland-1.23.0-GCCcore-13.3.0.eb
  • SUCCESS FlexiBLAS-3.2.0-GCC-11.3.0.eb
  • SUCCESS SentencePiece-0.2.0-GCC-13.2.0.eb
  • SUCCESS at-spi2-atk-2.38.0-GCCcore-13.3.0.eb
  • SUCCESS libepoxy-1.5.10-GCCcore-13.3.0.eb
  • SUCCESS GTK3-3.24.42-GCCcore-13.3.0.eb

Build succeeded for 6 out of 6 (4 easyconfigs in total)
n1607 - Linux RHEL 8.9 (Ootpa), x86_64, Intel(R) Xeon(R) Platinum 8470 (sapphirerapids), Python 3.9.18
See https://gist.github.com/Flamefire/e5d7cb49f636d08556d28836fb82498f for a full test report.

@Thyre Thyre added the bug fix label Sep 23, 2025
@boegel boegel added this to the next release (5.1.2) milestone Sep 23, 2025
Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@boegel boegel merged commit 6401880 into easybuilders:develop Sep 23, 2025
17 checks passed
@Flamefire Flamefire deleted the 20250923173504_new_pr_bundle branch September 24, 2025 08:05
@boegel boegel changed the title Fix unresolved templates in modextravars/paths of components fix unresolved templates in modextravars/modextrapaths of components Sep 24, 2025
@boegel boegel changed the title fix unresolved templates in modextravars/modextrapaths of components fix unresolved templates in modextravars/modextrapaths of Bundle components Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants