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 <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25859>
(cherry picked from commit 1cc26e8b66)
This commit is contained in:
LingMan 2023-10-24 05:47:06 +02:00 committed by Eric Engestrom
parent 364214f1c7
commit bfbd6f22c3
2 changed files with 5 additions and 1 deletions

View file

@ -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

View file

@ -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',