Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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: 7 additions & 2 deletions easybuild/framework/easyconfig/easyconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,9 @@ def dependencies(self, build_only=False, runtime_only=False):
# use += rather than .extend to get a new list rather than updating list of build deps in place...
deps += self['dependencies']

if not self.get('parsed'):
self.log.debug("Easyconfig not fully parsed yet, returning unparsed dependencies")
return deps # Cannot filter dependencies until the easyconfig has been fully parsed
# if filter-deps option is provided we "clean" the list of dependencies for
# each processed easyconfig to remove the unwanted dependencies
self.log.debug("Dependencies BEFORE filtering: %s", deps)
Expand All @@ -1242,8 +1245,10 @@ def dependency_names(self, build_only=False, runtime_only=False):
:param build_only: only return build dependencies, discard others
:param runtime_only: only return runtime dependencies, discard others
"""
return {dep['name'] for dep in self.dependencies(build_only=build_only, runtime_only=runtime_only)
if dep['name']}
deps = self.dependencies(build_only=build_only, runtime_only=runtime_only)
if self.get('parsed'):
return {dep['name'] for dep in deps if dep['name']}
return {dep[0] for dep in deps} # Unparsed dependencies are still tuples of (name, version, [...])

def builddependencies(self):
"""
Expand Down
4 changes: 0 additions & 4 deletions test/framework/modules/FFTW/3.3.7
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ set root /home-2/khoste/.local/easybuild/software/FFTW/3.3.7

conflict FFTW

if { ![is-loaded gompi/2018a] } {
module load gompi/2018a
}

prepend-path CPATH $root/include
prepend-path LD_LIBRARY_PATH $root/lib
prepend-path MANPATH $root/share/man
Expand Down
7 changes: 7 additions & 0 deletions test/framework/toy_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3559,7 +3559,10 @@ def test_toy_build_trace(self):
def test_toy_build_hooks(self):
"""Test use of --hooks."""
test_ec = os.path.join(self.test_prefix, 'test.eb')
# Using some dependencies where we have (test) modules installed
test_ec_txt = TOY_EC_TXT + '\n'.join([
"builddependencies = [('icc', '11.1.073', '', SYSTEM), ('FFTW', '3.3.7', '', SYSTEM)]",
"dependencies = [('GCCcore', '12.3.0', '', SYSTEM), ('imkl', '2021.4.0', '', SYSTEM)]",
"exts_list = [('bar', '0.0'), ('toy', '0.0')]",
"exts_defaultclass = 'DummyExtension'",
])
Expand All @@ -3583,6 +3586,7 @@ def parse_hook(ec):
# (required templating to be disabled before parse_hook is called)
ec['postinstallcmds'].append('echo toy')
print(ec['postinstallcmds'][-1])
print('Deps:', ', '.join(sorted(ec.dependency_names())))

def pre_build_and_install_loop_hook(ecs):
mod_names = ' '.join(ec['full_mod_name'] for ec in ecs)
Expand Down Expand Up @@ -3678,6 +3682,7 @@ def post_build_and_install_loop_hook(ecs):
Parse Hook toy 0.0
['%(name)s-%(version)s.tar.gz']
echo toy
Deps: FFTW, GCCcore, icc, imkl
installing 1 easyconfigs: toy/0.0
starting installation of toy 0.0
pre-configure: toy.source: True
Expand All @@ -3689,9 +3694,11 @@ def post_build_and_install_loop_hook(ecs):
Parse Hook toy 0.0
['%(name)s-%(version)s.tar.gz']
echo toy
Deps: FFTW, GCCcore, icc, imkl
Parse Hook toy 0.0
['%(name)s-%(version)s.tar.gz']
echo toy
Deps: FFTW, GCCcore, icc, imkl
in module-write hook hook for {mod_name}
installing of extension bar is done!
in module-write hook hook for {mod_name}
Expand Down
Loading