Merge pull request #578 from LLNL/features/gh-294-abort-build
Features/gh 294 abort build
This commit is contained in:
		@@ -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
 | 
				
			||||||
----------------------
 | 
					----------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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']
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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):
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user