summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-03-18 13:42:45 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2016-03-18 13:42:45 -0700
commite9126baaabbfaa5e12641b3d44a5c5fd49e43ca3 (patch)
tree16f702326eed8b17c0b582b2f062db83eac818bb
parent23f3f1adfe01f7b1301959e7e54584724679c7b3 (diff)
downloadspack-e9126baaabbfaa5e12641b3d44a5c5fd49e43ca3.tar.gz
spack-e9126baaabbfaa5e12641b3d44a5c5fd49e43ca3.tar.bz2
spack-e9126baaabbfaa5e12641b3d44a5c5fd49e43ca3.tar.xz
spack-e9126baaabbfaa5e12641b3d44a5c5fd49e43ca3.zip
Add docs for InstallError.
-rw-r--r--lib/spack/docs/packaging_guide.rst14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/spack/docs/packaging_guide.rst b/lib/spack/docs/packaging_guide.rst
index c1077e4497..519c0da232 100644
--- a/lib/spack/docs/packaging_guide.rst
+++ b/lib/spack/docs/packaging_guide.rst
@@ -1844,6 +1844,20 @@ dedicated process.
.. _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
----------------------