Merge pull request #1732 from epfl-scitas/fixes/autoload_and_build_dependencies
fix : ('build',) type dependencies are not accounted when autoloading
This commit is contained in:
commit
1cb6f31b03
@ -120,7 +120,7 @@ def dependencies(spec, request='all'):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
if request == 'direct':
|
if request == 'direct':
|
||||||
return spec.dependencies()
|
return spec.dependencies(deptype=('link', 'run'))
|
||||||
|
|
||||||
# FIXME : during module file creation nodes seem to be visited multiple
|
# FIXME : during module file creation nodes seem to be visited multiple
|
||||||
# FIXME : times even if cover='nodes' is given. This work around permits
|
# FIXME : times even if cover='nodes' is given. This work around permits
|
||||||
@ -133,6 +133,7 @@ def dependencies(spec, request='all'):
|
|||||||
spec.traverse(order='post',
|
spec.traverse(order='post',
|
||||||
depth=True,
|
depth=True,
|
||||||
cover='nodes',
|
cover='nodes',
|
||||||
|
deptype=('link', 'run'),
|
||||||
root=False),
|
root=False),
|
||||||
reverse=True)]
|
reverse=True)]
|
||||||
return [xx for ii, xx in l if not (xx in seen or seen_add(xx))]
|
return [xx for ii, xx in l if not (xx in seen or seen_add(xx))]
|
||||||
|
@ -229,6 +229,28 @@ def test_autoload(self):
|
|||||||
self.assertEqual(len([x for x in content if 'is-loaded' in x]), 5)
|
self.assertEqual(len([x for x in content if 'is-loaded' in x]), 5)
|
||||||
self.assertEqual(len([x for x in content if 'module load ' in x]), 5)
|
self.assertEqual(len([x for x in content if 'module load ' in x]), 5)
|
||||||
|
|
||||||
|
# dtbuild1 has
|
||||||
|
# - 1 ('run',) dependency
|
||||||
|
# - 1 ('build','link') dependency
|
||||||
|
# - 1 ('build',) dependency
|
||||||
|
# Just make sure the 'build' dependency is not there
|
||||||
|
spack.modules.CONFIGURATION = configuration_autoload_direct
|
||||||
|
spec = spack.spec.Spec('dtbuild1')
|
||||||
|
content = self.get_modulefile_content(spec)
|
||||||
|
self.assertEqual(len([x for x in content if 'is-loaded' in x]), 2)
|
||||||
|
self.assertEqual(len([x for x in content if 'module load ' in x]), 2)
|
||||||
|
|
||||||
|
# dtbuild1 has
|
||||||
|
# - 1 ('run',) dependency
|
||||||
|
# - 1 ('build','link') dependency
|
||||||
|
# - 1 ('build',) dependency
|
||||||
|
# Just make sure the 'build' dependency is not there
|
||||||
|
spack.modules.CONFIGURATION = configuration_autoload_all
|
||||||
|
spec = spack.spec.Spec('dtbuild1')
|
||||||
|
content = self.get_modulefile_content(spec)
|
||||||
|
self.assertEqual(len([x for x in content if 'is-loaded' in x]), 2)
|
||||||
|
self.assertEqual(len([x for x in content if 'module load ' in x]), 2)
|
||||||
|
|
||||||
def test_prerequisites(self):
|
def test_prerequisites(self):
|
||||||
spack.modules.CONFIGURATION = configuration_prerequisites_direct
|
spack.modules.CONFIGURATION = configuration_prerequisites_direct
|
||||||
spec = spack.spec.Spec('mpileaks arch=x86-linux')
|
spec = spack.spec.Spec('mpileaks arch=x86-linux')
|
||||||
|
Loading…
Reference in New Issue
Block a user