diff options
author | Martin Blanchard <martin.blanchard@codethink.co.uk> | 2018-07-30 13:36:15 +0100 |
---|---|---|
committer | Martin Blanchard <martin.blanchard@codethink.co.uk> | 2018-08-01 16:16:33 +0100 |
commit | 00ddcbd765b25681452039d87b3928c4d61d99a3 (patch) | |
tree | 9b2bd6d9c7cae963bb7303b797ded5785d2e83da /buildstream/element.py | |
parent | 62a250fefa33f9dcfdc54b09ab4ec4d276fa7891 (diff) | |
download | buildstream-00ddcbd765b25681452039d87b3928c4d61d99a3.tar.gz |
element.py: Raise an exception on unbuilt element checkout
Trying to checkout an element that has no cached artifacts should be and
handled failure. See BuildStream/buildstream#447.
Diffstat (limited to 'buildstream/element.py')
-rw-r--r-- | buildstream/element.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/buildstream/element.py b/buildstream/element.py index 2218ef94b..bec87815c 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -623,6 +623,12 @@ class Element(Plugin): dep.stage_artifact(sandbox) """ + if not self._cached(): + detail = "No artifacts have been cached yet for that element\n" + \ + "Try building the element first with `bst build`\n" + raise ElementError("No artifacts to stage", + detail=detail, reason="uncached-checkout-attempt") + if update_mtimes is None: update_mtimes = [] |