summaryrefslogtreecommitdiff
path: root/buildstream/buildelement.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildstream/buildelement.py')
-rw-r--r--buildstream/buildelement.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/buildstream/buildelement.py b/buildstream/buildelement.py
index c0fef8cdb..d729eaa81 100644
--- a/buildstream/buildelement.py
+++ b/buildstream/buildelement.py
@@ -233,12 +233,14 @@ class BuildElement(Element):
return commands
def __run_command(self, sandbox, cmd, cmd_name):
- self.status("Running {}".format(cmd_name), detail=cmd)
-
- # Note the -e switch to 'sh' means to exit with an error
- # if any untested command fails.
- #
- exitcode = sandbox.run(['sh', '-c', '-e', cmd + '\n'],
- SandboxFlags.ROOT_READ_ONLY)
- if exitcode != 0:
- raise ElementError("Command '{}' failed with exitcode {}".format(cmd, exitcode))
+ with self.timed_activity("Running {}".format(cmd_name)):
+ self.status("Running {}".format(cmd_name), detail=cmd)
+
+ # Note the -e switch to 'sh' means to exit with an error
+ # if any untested command fails.
+ #
+ exitcode = sandbox.run(['sh', '-c', '-e', cmd + '\n'],
+ SandboxFlags.ROOT_READ_ONLY)
+ if exitcode != 0:
+ raise ElementError("Command '{}' failed with exitcode {}".format(cmd, exitcode),
+ collect=self.get_variable('install-root'))