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
c50d6ac9
Commit
c50d6ac9
authored
9 years ago
by
Todd Gamblin
Browse files
Options
Downloads
Plain Diff
Merge pull request #578 from LLNL/features/gh-294-abort-build
Features/gh 294 abort build
parents
741bea03
e9126baa
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/spack/docs/packaging_guide.rst
+14
-0
14 additions, 0 deletions
lib/spack/docs/packaging_guide.rst
lib/spack/spack/__init__.py
+6
-2
6 additions, 2 deletions
lib/spack/spack/__init__.py
lib/spack/spack/package.py
+4
-0
4 additions, 0 deletions
lib/spack/spack/package.py
with
24 additions
and
2 deletions
lib/spack/docs/packaging_guide.rst
+
14
−
0
View file @
c50d6ac9
...
@@ -1844,6 +1844,20 @@ dedicated process.
...
@@ -1844,6 +1844,20 @@ dedicated process.
.. _prefix-objects:
.. _prefix-objects:
Failing the build
----------------------
Sometimes you don't want a package to successfully install unless some
condition is true. You can explicitly cause the build to fail from
``install()`` by raising an ``InstallError``, for example:
.. code-block:: python
if spec.architecture.startswith('darwin'):
raise InstallError('This package does not build on Mac OS X!')
Prefix objects
Prefix objects
----------------------
----------------------
...
...
This diff is collapsed.
Click to expand it.
lib/spack/spack/__init__.py
+
6
−
2
View file @
c50d6ac9
...
@@ -189,5 +189,9 @@
...
@@ -189,5 +189,9 @@
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
from
spack.package
import
\
__all__
+=
[
'
install_dependency_symlinks
'
,
'
flatten_dependencies
'
,
'
DependencyConflictError
'
]
install_dependency_symlinks
,
flatten_dependencies
,
DependencyConflictError
,
\
InstallError
,
ExternalPackageError
__all__
+=
[
'
install_dependency_symlinks
'
,
'
flatten_dependencies
'
,
'
DependencyConflictError
'
,
'
InstallError
'
,
'
ExternalPackageError
'
]
This diff is collapsed.
Click to expand it.
lib/spack/spack/package.py
+
4
−
0
View file @
c50d6ac9
...
@@ -1351,6 +1351,10 @@ def __init__(self, message, long_msg=None):
...
@@ -1351,6 +1351,10 @@ def __init__(self, message, long_msg=None):
super
(
InstallError
,
self
).
__init__
(
message
,
long_msg
)
super
(
InstallError
,
self
).
__init__
(
message
,
long_msg
)
class
ExternalPackageError
(
InstallError
):
"""
Raised by install() when a package is only for external use.
"""
class
PackageStillNeededError
(
InstallError
):
class
PackageStillNeededError
(
InstallError
):
"""
Raised when package is still needed by another on uninstall.
"""
"""
Raised when package is still needed by another on uninstall.
"""
def
__init__
(
self
,
spec
,
dependents
):
def
__init__
(
self
,
spec
,
dependents
):
...
...
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