Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generator: Print vk-parse errors when they're encountered #930

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

MarijnS95
Copy link
Collaborator

Some upstream vk.xml changes are causing failures on missing registry children later on in our generator code. These are complicated to debug, unless we print the errors that vk-parse already reports. In this debug case it was clarifying that some new and unknown elements upstream are the reason for high-level registry elements to not be parsable.

Some upstream `vk.xml` changes are causing failures on missing registry
children later on in our generator code.  These are complicated to
debug, unless we print the errors that `vk-parse` already reports.  In
this debug case it was clarifying that some new and unknown elements
upstream are the reason for high-level registry elements to not be
parsable.
@MarijnS95 MarijnS95 merged commit a00c45e into master Aug 20, 2024
20 checks passed
@MarijnS95 MarijnS95 deleted the print-vk-parse-errors branch August 20, 2024 10:11
MarijnS95 added a commit that referenced this pull request Nov 13, 2024
When `vk-parse` encounters XML parsing errors (e.g. on unknown attributes
or elements) it skips the element and emits an error in a list of errors
that are returned to the caller.  We were originally never checking
these leading to hard-to-debug issues, but eventually started asserting
on this list being empty or otherwise panicking in #930.

Since `ash`'s generator is used in Khronos' upstream CI (in a fallible
yet warning way), any new attribute would cause the generator to fail
and subsequently require updates to `vk-parse` and `ash` before their
CI is no longer flagged as "succeeded with warnings".  "Solve" this by
once again allowing errors to exist, while still at least printing them
to `stderr` for insights (that were previously missing...) to anyone
running the generator.

Note that this once again allows the generator to fail further in the
chain when expected elements are missing, in which case an update is
required either way.  If this happens often we can adjust `vk-parse` to
be more lenient in still emitting errors but continuing to parse said
element, if the new/unrecognized elements or attributes are considered
harmless to the parsing process.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants