From e2074693ff50ad03e7e2602a0bb9efd38dd9ac8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=B6k=C3=A7en=20Nurlu?= <gnurlu1@bloomberg.net>
Date: Mon, 17 Dec 2018 18:10:12 +0000
Subject: Prevent caching when Element.stage() fails

That step is not actually part of the build phase should not be cached and
causes hard to find bugs.

Fixes #791
---
 buildstream/element.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'buildstream')

diff --git a/buildstream/element.py b/buildstream/element.py
index 8fc491204..ac1dec4ac 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1620,12 +1620,12 @@ class Element(Plugin):
                 self.__dynamic_public = _yaml.node_copy(self.__public)
 
                 # Call the abstract plugin methods
-                try:
-                    # Step 1 - Configure
-                    self.__configure_sandbox(sandbox)
-                    # Step 2 - Stage
-                    self.stage(sandbox)
 
+                # Step 1 - Configure
+                self.__configure_sandbox(sandbox)
+                # Step 2 - Stage
+                self.stage(sandbox)
+                try:
                     if self.__batch_prepare_assemble:
                         cm = sandbox.batch(self.__batch_prepare_assemble_flags,
                                            collect=self.__batch_prepare_assemble_collect)
-- 
cgit v1.2.1