Skip to content

Commit d927288

Browse files
ojedagregkh
authored andcommitted
rust: work around bindgen 0.69.0 issue
[ Upstream commit 9e98db1 ] `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] Reviewed-by: Finn Behrens <[email protected]> Tested-by: Benno Lossin <[email protected]> Tested-by: Andreas Hindborg <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]> Stable-dep-of: 5ce86c6 ("rust: suppress error messages from CONFIG_{RUSTC,BINDGEN}_VERSION_TEXT") Signed-off-by: Sasha Levin <[email protected]>
1 parent 9ce3cd4 commit d927288

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

init/Kconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1947,7 +1947,10 @@ config RUSTC_VERSION_TEXT
19471947
config BINDGEN_VERSION_TEXT
19481948
string
19491949
depends on RUST
1950-
default $(shell,command -v $(BINDGEN) >/dev/null 2>&1 && $(BINDGEN) --version || echo n)
1950+
# The dummy parameter `workaround-for-0.69.0` is required to support 0.69.0
1951+
# (https://github.com/rust-lang/rust-bindgen/pull/2678). It can be removed when
1952+
# the minimum version is upgraded past that (0.69.1 already fixed the issue).
1953+
default $(shell,command -v $(BINDGEN) >/dev/null 2>&1 && $(BINDGEN) --version workaround-for-0.69.0 || echo n)
19511954

19521955
#
19531956
# Place an empty function call at each tracepoint site. Can be

scripts/rust_is_available.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,12 @@ fi
7676
# Check that the Rust bindings generator is suitable.
7777
#
7878
# Non-stable and distributions' versions may have a version suffix, e.g. `-dev`.
79+
#
80+
# The dummy parameter `workaround-for-0.69.0` is required to support 0.69.0
81+
# (https://github.com/rust-lang/rust-bindgen/pull/2678). It can be removed when
82+
# the minimum version is upgraded past that (0.69.1 already fixed the issue).
7983
rust_bindings_generator_output=$( \
80-
LC_ALL=C "$BINDGEN" --version 2>/dev/null
84+
LC_ALL=C "$BINDGEN" --version workaround-for-0.69.0 2>/dev/null
8185
) || rust_bindings_generator_code=$?
8286
if [ -n "$rust_bindings_generator_code" ]; then
8387
echo >&2 "***"

0 commit comments

Comments
 (0)