Skip to content

Use Cargo and bundle the Vulkan headers in the repo

Neil Roberts requested to merge nroberts/vkrunner:cargo into main

As discussed in a comment for the MR to rewrite the project in Rust, this MR switches to Cargo instead of Meson and bundles the Vulkan headers in the repo so that we don’t have to have the awkward build option to find them and we can be sure to have a known working version. I guess this doing two unrelated things in one merge request, but if we made separate MRs then they would conflict with each other and it would be a bit annoying.

The Vulkan headers are version 1.3.266.

The bindgen phase is now run using the Cargo build script instead of using bindgen-cli.

The fake_compiler test executable has been replaced with a stub fake_command module that replaces std::process::Command in the test config. I couldn’t find a way to get Cargo to build an executable that is only used by the unit tests and isn’t installed.

The README recommends to use cargo-c to install the static C library and headers.

The build-wind32.sh script has been removed because cross-compiling with Cargo is quite easy and the script probably isn’t necessary. You just need to install the right toolchain with rustup and then pass --target to cargo build. However the windows build is currently broken because of issue #1 anyway.

Merge request reports