codegen: Don't hide import error message from Python - #1994
Conversation
`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>
|
Author smcv not on autobuild list. Waiting for curator authorization before starting CI build. |
1 similar comment
|
Author smcv not on autobuild list. Waiting for curator authorization before starting CI build. |
|
|
| 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() |
There was a problem hiding this comment.
As an alternative, if maintainers would prefer a shorter error message, then
| traceback.print_exc() | |
| print(e) |
would achieve that, without needing to import traceback.
There was a problem hiding this comment.
Thats fine with me.
|
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. |
|
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. |
|
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. |
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.) |
|
Sounds good, I'll get on it then.
Those are still greatly appreciated! There is a lot of not-graphics work that goes into graphics afterall. |
|
Closing in favor of #1995 to work around needing the CLA to be happy before merging. |
from reg import Registrycould fail for reasons other than not having Vulkan-Headers'registry/directory onsys.path. For example, if thepyparsingmodule dependency isn't installed, then importingregwill also fail as a result.Show Python's error message to the user so that they can correct any missing dependencies.