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
741bea03
Commit
741bea03
authored
9 years ago
by
Todd Gamblin
Browse files
Options
Downloads
Plain Diff
Merge pull request #574 from LLNL/features/flattener
Created flatten_dependencies function
parents
4e9ba492
151b0463
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/__init__.py
+3
-0
3 additions, 0 deletions
lib/spack/spack/__init__.py
lib/spack/spack/package.py
+29
-0
29 additions, 0 deletions
lib/spack/spack/package.py
with
32 additions
and
0 deletions
lib/spack/spack/__init__.py
+
3
−
0
View file @
741bea03
...
@@ -188,3 +188,6 @@
...
@@ -188,3 +188,6 @@
import
spack.util.executable
import
spack.util.executable
from
spack.util.executable
import
*
from
spack.util.executable
import
*
__all__
+=
spack
.
util
.
executable
.
__all__
__all__
+=
spack
.
util
.
executable
.
__all__
from
spack.package
import
install_dependency_symlinks
,
flatten_dependencies
,
DependencyConflictError
__all__
+=
[
'
install_dependency_symlinks
'
,
'
flatten_dependencies
'
,
'
DependencyConflictError
'
]
This diff is collapsed.
Click to expand it.
lib/spack/spack/package.py
+
29
−
0
View file @
741bea03
...
@@ -1243,6 +1243,27 @@ def rpath_args(self):
...
@@ -1243,6 +1243,27 @@ def rpath_args(self):
return
"
"
.
join
(
"
-Wl,-rpath,%s
"
%
p
for
p
in
self
.
rpath
)
return
"
"
.
join
(
"
-Wl,-rpath,%s
"
%
p
for
p
in
self
.
rpath
)
def
install_dependency_symlinks
(
pkg
,
spec
,
prefix
):
"""
Execute a dummy install and flatten dependencies
"""
flatten_dependencies
(
spec
,
prefix
)
def
flatten_dependencies
(
spec
,
flat_dir
):
"""
Make each dependency of spec present in dir via symlink.
"""
for
dep
in
spec
.
traverse
(
root
=
False
):
name
=
dep
.
name
dep_path
=
spack
.
install_layout
.
path_for_spec
(
dep
)
dep_files
=
LinkTree
(
dep_path
)
os
.
mkdir
(
flat_dir
+
'
/
'
+
name
)
conflict
=
dep_files
.
find_conflict
(
flat_dir
+
'
/
'
+
name
)
if
conflict
:
raise
DependencyConflictError
(
conflict
)
dep_files
.
merge
(
flat_dir
+
'
/
'
+
name
)
def
validate_package_url
(
url_string
):
def
validate_package_url
(
url_string
):
"""
Determine whether spack can handle a particular URL or not.
"""
"""
Determine whether spack can handle a particular URL or not.
"""
url
=
urlparse
(
url_string
)
url
=
urlparse
(
url_string
)
...
@@ -1380,3 +1401,11 @@ def __init__(self, path):
...
@@ -1380,3 +1401,11 @@ def __init__(self, path):
class
ActivationError
(
ExtensionError
):
class
ActivationError
(
ExtensionError
):
def
__init__
(
self
,
msg
,
long_msg
=
None
):
def
__init__
(
self
,
msg
,
long_msg
=
None
):
super
(
ActivationError
,
self
).
__init__
(
msg
,
long_msg
)
super
(
ActivationError
,
self
).
__init__
(
msg
,
long_msg
)
class
DependencyConflictError
(
spack
.
error
.
SpackError
):
"""
Raised when the dependencies cannot be flattened as asked for.
"""
def
__init__
(
self
,
conflict
):
super
(
DependencyConflictError
,
self
).
__init__
(
"
%s conflicts with another file in the flattened directory.
"
%
(
conflict
))
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