[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 16/16] rust: allow older version of bindgen
From: |
Paolo Bonzini |
Subject: |
[PATCH 16/16] rust: allow older version of bindgen |
Date: |
Tue, 15 Oct 2024 15:17:34 +0200 |
Cope with the old version that is provided in Debian 12 and Ubuntu 22.04.
--size_t-is-usize is needed on bindgen <0.61.0 (Debian 12, Ubuntu 22.04),
and it was removed in bindgen 0.65.0, so check for it in meson.build.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
meson.build | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index e08f226ee8a..2a292935a94 100644
--- a/meson.build
+++ b/meson.build
@@ -74,6 +74,7 @@ endif
have_rust = false
if not get_option('rust').disabled() and add_languages('rust', required:
get_option('rust'), native: false) \
and add_languages('rust', required: get_option('rust'), native: true)
+ bindgen = find_program('bindgen')
rustc = meson.get_compiler('rust')
have_rust = true
if rustc.version().version_compare('<1.63.0')
@@ -3939,6 +3940,9 @@ if have_rust and have_system
'--allowlist-file', meson.project_source_root() + '/.*',
'--allowlist-file', meson.project_build_root() + '/.*'
]
+ if bindgen.version().version_compare('<0.65.0')
+ bindgen_args += ['--size_t-is-usize']
+ endif
c_enums = [
'DeviceCategory',
'GpioPolarity',
@@ -3974,7 +3978,7 @@ if have_rust and have_system
dependencies: common_ss.all_dependencies(),
output: 'bindings.rs',
include_directories: include_directories('.', 'include'),
- bindgen_version: ['>=0.69.4'],
+ bindgen_version: ['>=0.59.1'],
args: bindgen_args,
)
subdir('rust')
--
2.46.2
- Re: [PATCH 10/16] rust: introduce alternative implementation of offset_of!, (continued)
[PATCH 13/16] rust: do not use TYPE_CHARDEV unnecessarily, Paolo Bonzini, 2024/10/15
[PATCH 14/16] rust: do not use --no-size_t-is-usize, Paolo Bonzini, 2024/10/15
[PATCH 15/16] rust: do not use --generate-cstr, Paolo Bonzini, 2024/10/15
[PATCH 16/16] rust: allow older version of bindgen,
Paolo Bonzini <=
Re: [RFC PATCH 00/16] rust: allow older versions of rustc and bindgen, Kevin Wolf, 2024/10/18
Re: [RFC PATCH 00/16] rust: allow older versions of rustc and bindgen, Daniel P . Berrangé, 2024/10/18