Open BuildStream-Migration-Bot opened 3 years ago
In GitLab by [Gitlab user @willsalmon] on Jun 16, 2020, 10:28
changed the description
In GitLab by [Gitlab user @willsalmon] on Jun 17, 2020, 11:40
A example in CI https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/jobs/598778674
In GitLab by [Gitlab user @coldtom] on Jun 17, 2020, 12:19
[Gitlab user @willsalmon] This is caused by the flatpak_image (or maybe flatpak_repo) plugin passing a configparser to get_unique_key
, which can't be dumped by ujson.
In GitLab by [Gitlab user @DouglasWinship] on Jun 18, 2020, 14:30
In the CI example above, the fault was with the snap_image plugin.
Managed to avoid the issue by editing the configure() function.
- self.metadata = node.get_node('metadata')
+ self.metadata = node.get_node('metadata').strip_node_info()
But as Will says, the real bug here (for buildstream) is that it doesn't fail cleanly.
In GitLab by [Gitlab user @abderrahimk] on Jun 20, 2020, 07:35
The difference in version is in ujson, ujson 1.x accepts the ConfigParser, but 2.0 doesn't.
I agree that bst should have a more defensive attitude towards things coming from the plugins, and fail cleanly.
In GitLab by [Gitlab user @DouglasWinship] on Jun 22, 2020, 10:33
changed title from {-Crash with trace back-} to {+Buildstream crashes unhelpfully when ujson can't process a cache key+}
In GitLab by [Gitlab user @DouglasWinship] on Jun 22, 2020, 10:33
changed the description
In GitLab by [Gitlab user @tristanvb] on Nov 6, 2020, 09:15
The current policy is that if BuildStream core or a BuildStream plugin has a bug.
If a plugin returns a non-serializable object to get_unique_key()
, this certainly qualifies as a bug, and we should do the right thing and treat it as a BUG and always provide a stack trace.
Stack traces are more helpful for plugin authors to fix their bugs than simple messages, as a general rule.
Reported user facing errors are supposed to assist the CLI user and project YAML author directly, i.e. they should clearly inform the user how to fix the issue, or report an error from a build.
That said, I do think that the return of get_unique_key()
should be asserted sooner, and a non BstError
exception should be raised earlier, to more clearly indicate what went wrong.
See original issue on GitLab In GitLab by [Gitlab user @willsalmon] on Jun 16, 2020, 10:28
Summary
[Edit/update] Buildstream plugins must supply a function called "get_unique_key", which returns an object that can be used to identify an element based on the config defined in its YAML. If the object is in a format that cannot be processed correctly, this can cause buildstream to crash when calculating the key.
There ought to be a clean failure, with a helpful error message. Instead we get a crash, and a traceback that doesn't immediately explain the problem. [End edit/update]
Steps to reproduce
Install bst at tag 1.93.4
install bst-plugins-experimental at
commit aa3c71568b0cdc537028e6ec389276bb79441f46 (HEAD -> master, origin/master, origin/HEAD)
checkout Freedesktop-sdk at
What is the current bug behaviour?
[Gitlab user @BenjaminSchubert] thinks this is a issue with the plugins repo, i dont understand why it works in CI
https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/jobs/593127809
with what i belive are the same versions.But if the bug is in the plugins then bst should handle this failer cleanly