From bfbd6f22c353d761d70b9d64baca8cf2b9c93dd4 Mon Sep 17 00:00:00 2001 From: LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org> Date: Tue, 24 Oct 2023 05:47:06 +0200 Subject: [PATCH] rusticl: Show an error message if the build is attempted with an outdated bindgen version Ideally the build system would fetch the correct bindgen version automatically like cargo does. Until then, provide an error message that is hopefully more helpful than whatever cryptic error the build runs into otherwise. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9457 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10029 Reviewed-by: Karol Herbst Part-of: (cherry picked from commit 1cc26e8b6657b5097995470ced9ae9cc7b6f01b9) --- .pick_status.json | 2 +- src/gallium/frontends/rusticl/meson.build | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index cffbd224473..3b3fef34b7b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2594,7 +2594,7 @@ "description": "rusticl: Show an error message if the build is attempted with an outdated bindgen version", "nominated": false, "nomination_type": 3, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/frontends/rusticl/meson.build b/src/gallium/frontends/rusticl/meson.build index d7aee75240c..6cff319f780 100644 --- a/src/gallium/frontends/rusticl/meson.build +++ b/src/gallium/frontends/rusticl/meson.build @@ -114,6 +114,10 @@ rusticl_bindgen_args = [ '--anon-fields-prefix', 'anon_', ] +if find_program('bindgen').version().version_compare('< 0.62') + error('rusticl requires bindgen 0.62 or newer. If your distribution does not ship a recent enough version, you can install the latest version for your user with `cargo install bindgen-cli`.') +endif + if find_program('bindgen').version().version_compare('< 0.65') rusticl_bindgen_args += [ '--size_t-is-usize',