Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Spack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eic_tools
Spack
Commits
fc576a40
Commit
fc576a40
authored
8 years ago
by
Massimiliano Culpo
Browse files
Options
Downloads
Patches
Plain Diff
modules : ('build',) type dependencies are not accounted when autoloading
fixes #1681
parent
16c5403a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/spack/spack/modules.py
+2
-1
2 additions, 1 deletion
lib/spack/spack/modules.py
lib/spack/spack/test/modules.py
+22
-0
22 additions, 0 deletions
lib/spack/spack/test/modules.py
with
24 additions
and
1 deletion
lib/spack/spack/modules.py
+
2
−
1
View file @
fc576a40
...
@@ -120,7 +120,7 @@ def dependencies(spec, request='all'):
...
@@ -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'):
...
@@ -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
))]
...
...
This diff is collapsed.
Click to expand it.
lib/spack/spack/test/modules.py
+
22
−
0
View file @
fc576a40
...
@@ -229,6 +229,28 @@ def test_autoload(self):
...
@@ -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
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment