Skip to content

Commit 6238805

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 <me@kloenk.dev> Tested-by: Benno Lossin <benno.lossin@proton.me> Tested-by: Andreas Hindborg <a.hindborg@samsung.com> Link: https://lore.kernel.org/r/20240709160615.998336-9-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Stable-dep-of: 5ce86c6 ("rust: suppress error messages from CONFIG_{RUSTC,BINDGEN}_VERSION_TEXT") Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent d656b82 commit 6238805

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

init/Kconfig

+4-1
Original file line numberDiff line numberDiff line change
@@ -1911,7 +1911,10 @@ config RUSTC_VERSION_TEXT
19111911
config BINDGEN_VERSION_TEXT
19121912
string
19131913
depends on RUST
1914-
default $(shell,command -v $(BINDGEN) >/dev/null 2>&1 && $(BINDGEN) --version || echo n)
1914+
# The dummy parameter `workaround-for-0.69.0` is required to support 0.69.0
1915+
# (https://github.com/rust-lang/rust-bindgen/pull/2678). It can be removed when
1916+
# the minimum version is upgraded past that (0.69.1 already fixed the issue).
1917+
default $(shell,command -v $(BINDGEN) >/dev/null 2>&1 && $(BINDGEN) --version workaround-for-0.69.0 || echo n)
19151918

19161919
#
19171920
# Place an empty function call at each tracepoint site. Can be

scripts/rust_is_available.sh

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

0 commit comments

Comments
 (0)