Strack trace shown when trying to checkout an unbuilt element
Summary
bst checkout <element> <directory>
on an unbuilt element will produce a stack trace.
Steps to reproduce
$ ls
elements files project.conf
$ ls elements/
base base.bst hello.bst importme.bst
$ bst show hello.bst
[--:--:--][][] START Loading pipeline
[00:00:00][][] SUCCESS Loading pipeline
[--:--:--][][] START Resolving pipeline
[00:00:00][][] SUCCESS Resolving pipeline
[--:--:--][][] START Resolving cached state
[00:00:00][][] SUCCESS Resolving cached state
cached a352c93edfc55a41868b4f482758ad3ea1c21571532373542cd20b9135f0718d base/alpine.bst
cached a8eeb045115a4a71c18d09fe14b7b4fc3f3e838414a7d23d7c6d4c3027f28743 base.bst
fetch needed 3f7f32d9cab049f2664b1299c07f0afdd16e8db5f8e9c6e4f6460439bad91013 hello.bst
$ bst checkout hello.bst ~/checkouts/hello
[--:--:--][][] START Loading pipeline
[00:00:00][][] SUCCESS Loading pipeline
[--:--:--][][] START Resolving pipeline
[00:00:00][][] SUCCESS Resolving pipeline
[--:--:--][][] START Resolving cached state
[00:00:00][][] SUCCESS Resolving cached state
[--:--:--][][] START Staging dependencies
[--:--:--][][] BUG autotools element at hello.bst [line 1 column 0]: Missing artifact 3f7f32d9
Traceback (most recent call last):
File "/home/jamesennis/.local/bin/bst", line 8, in <module>
sys.exit(cli())
File "/home/jamesennis/.local/lib/python3.5/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/home/jamesennis/buildstream/buildstream/_frontend/cli.py", line 162, in override_main
standalone_mode=standalone_mode, **extra)
File "/home/jamesennis/.local/lib/python3.5/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/jamesennis/.local/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/jamesennis/.local/lib/python3.5/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/jamesennis/.local/lib/python3.5/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/jamesennis/.local/lib/python3.5/site-packages/click/decorators.py", line 27, in new_func
return f(get_current_context().obj, *args, **kwargs)
File "/home/jamesennis/buildstream/buildstream/_frontend/cli.py", line 642, in checkout
hardlinks=hardlinks)
File "/home/jamesennis/buildstream/buildstream/_stream.py", line 387, in checkout
with target._prepare_sandbox(Scope.RUN, None, integrate=integrate) as sandbox:
File "/usr/lib/python3.5/contextlib.py", line 59, in __enter__
return next(self.gen)
File "/home/jamesennis/buildstream/buildstream/element.py", line 1259, in _prepare_sandbox
self.stage_dependency_artifacts(sandbox, scope)
File "/home/jamesennis/buildstream/buildstream/element.py", line 710, in stage_dependency_artifacts
update_mtimes=to_update)
File "/home/jamesennis/buildstream/buildstream/element.py", line 613, in stage_artifact
self.__assert_cached()
File "/home/jamesennis/buildstream/buildstream/element.py", line 2025, in __assert_cached
assert self._cached(), "{}: Missing artifact {}".format(self, self.__get_brief_display_key())
AssertionError: autotools element at hello.bst [line 1 column 0]: Missing artifact 3f7f32d9
What is the expected correct behavior?
We don't receive a stack trace. Instead, we output a message to inform the user that the element is unbuilt.
Optional extra:
A [y/n] option that invokes bst build
on the element if y
is specified.
Edited by James Ennis