Skip to content

codegen: Don't hide import error message from Python - #1994

Closed
smcv wants to merge 1 commit into
KhronosGroup:mainfrom
smcv:bug1993
Closed

codegen: Don't hide import error message from Python#1994
smcv wants to merge 1 commit into
KhronosGroup:mainfrom
smcv:bug1993

Conversation

@smcv

@smcv smcv commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

from reg import Registry could fail for reasons other than not having Vulkan-Headers' registry/ directory on sys.path. For example, if the pyparsing module dependency isn't installed, then importing reg will also fail as a result.

Show Python's error message to the user so that they can correct any missing dependencies.

`from reg import Registry` could fail for reasons other than not having
Vulkan-Headers' `registry/` directory on `sys.path`. For example, if the
`pyparsing` module dependency isn't installed, then importing `reg`
will also fail as a result.

Show Python's error message to the user so that they can correct any
missing dependencies.

Signed-off-by: Simon McVittie <smcv@collabora.com>
@ci-tester-lunarg

Copy link
Copy Markdown

Author smcv not on autobuild list. Waiting for curator authorization before starting CI build.

1 similar comment
@ci-tester-lunarg

Copy link
Copy Markdown

Author smcv not on autobuild list. Waiting for curator authorization before starting CI build.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

print("ModuleNotFoundError: No module named 'reg'") # normal python error message
print(f'{registry_headers_path} is not pointing to the Vulkan-Headers registry directory.')
except ModuleNotFoundError as e:
traceback.print_exc()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an alternative, if maintainers would prefer a shorter error message, then

Suggested change
traceback.print_exc()
print(e)

would achieve that, without needing to import traceback.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats fine with me.

@smcv

smcv commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

I'm pretty sure my employer (Collabora Ltd.) has already signed a CLA with Khronos, but I'll need to check with them before I can say "yes" to a new CLA.

@charles-lunarg

Copy link
Copy Markdown
Collaborator

If you cannot sign the CLA, I can recreate the PR for you. Plus, I will need to propagate this to a bunch of other repo's which have the same logic.

@charles-lunarg

Copy link
Copy Markdown
Collaborator

Also there is a known race condition with CMake 4.4.0 which has been a thorn in my side for the last month. It is fixed in 4.4.1, but I have to wait for github actions to update their runner before its fixed. The root cause is from enabling build parallelism, which I don't want to disable.

@smcv

smcv commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Plus, I will need to propagate this to a bunch of other repo's which have the same logic.

Perhaps easier if you take this, given that.

(I'm not a graphics developer, so I'm unlikely to contribute anything significant to Khronos' actual graphics work - the only thing I'll be able to contribute is drive-by fixes for build system/packaging issues or JSON manifest handling.)

@charles-lunarg

Copy link
Copy Markdown
Collaborator

Sounds good, I'll get on it then.

(I'm not a graphics developer, so I'm unlikely to contribute anything significant to Khronos' actual graphics work - the only thing I'll be able to contribute is drive-by fixes for build system/packaging issues or JSON manifest handling.)

Those are still greatly appreciated! There is a lot of not-graphics work that goes into graphics afterall.

@charles-lunarg

Copy link
Copy Markdown
Collaborator

Closing in favor of #1995 to work around needing the CLA to be happy before merging.

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.

4 participants