Skip to content

Generate code in the build script instead of checking in results from Python scripts

This rewrites all of the Python scripts that generate code in Rust and makes them part of the Cargo build script. Previously the Python scripts had to be run by hand and the output was checked in to the repo.

Now that the Vulkan headers are checked into the repo thanks to MR#4 it’s easier to run the code generation as part of the build because we’ll always be using a known working version of the Vulkan headers. In the MR I’ve also made it so that the Vulkan headers are scanned by adding callbacks to bindgen instead of searching using regular expressions over the header files. This should probably make it a lot more robust. Generating the code as part of the build process makes sure that the scripts never break because whoever changes the Vulkan headers will end up having to do the code generation too.

Unfortunately this adds quite a lot of build-time dependencies in order to use the Tera template engine. I’ve checked that the versions required work with those in Debian testing in order to avoid breaking the CI.

Merge request reports