Skip to content

Commit 8efcdb5

Browse files
committed
rust: work around bindgen 0.69.0 issue
`bindgen` 0.69.0 contains a bug: `--version` does not work without providing a header [1]: error: the following required arguments were not provided: <HEADER> Usage: bindgen <FLAGS> <OPTIONS> <HEADER> -- <CLANG_ARGS>... Thus, in preparation for supporting several `bindgen` versions, work around the issue by passing a dummy argument. Include a comment so that we can remove the workaround in the future. Link: rust-lang/rust-bindgen#2678 [1] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent ec3c834 commit 8efcdb5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/rust_is_available.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,12 @@ fi
121121
# Check that the Rust bindings generator is suitable.
122122
#
123123
# Non-stable and distributions' versions may have a version suffix, e.g. `-dev`.
124+
#
125+
# The dummy parameter `workaround-for-0.69.0` is required to support 0.69.0
126+
# (https://github.com/rust-lang/rust-bindgen/pull/2678). It can be removed when
127+
# the minimum version is upgraded past that (0.69.1 already fixed the issue).
124128
rust_bindings_generator_output=$( \
125-
LC_ALL=C "$BINDGEN" --version 2>/dev/null
129+
LC_ALL=C "$BINDGEN" --version workaround-for-0.69.0 2>/dev/null
126130
) || rust_bindings_generator_code=$?
127131
if [ -n "$rust_bindings_generator_code" ]; then
128132
echo >&2 "***"

0 commit comments

Comments
 (0)