Hi Mesa developers,
I would like to highlight an architectural boundary issue during single-pass
cross-compilation in Mesa 26.2.x, specifically involving Meson and Rust bindgen
code generation (e.g., vtn_bindgen2).
1. Issue Summary:
When cross-compiling Mesa (e.g., x86_64 build machine targeting aarch64 host),
the Meson build fails at `src/compiler/spirv/meson.build` with:
ERROR: Tried to mix a host machine library ("vtn") with a build machine target
"vtn_bindgen2".
2. Root Cause & Context:
This occurs because host sysroot flags and libraries leak into the
build-machine execution context during Rust/bindgen processing. While GNU
Autotools strictly separated CC/CC_FOR_BUILD and Build/Host/Target triplets,
Meson's simplified dual-machine model easily leads to target sysroot leakage
when host-executed generators (like vtn_bindgen2) need to parse headers or link
against host libs.
A related packaging discussion and analysis can be found here:
https://github.com/termux/termux-packages/issues/31031
3. Proposal:
Could we strengthen the isolation in meson.build for codegen targets (e.g.
strict native: true separation and environment overrides) so distro maintainers
don't have to resort to manual two-pass builds?
Thanks,
Jesse Stone