Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: https://github.com/rust-lang/rust-bindgen/pull/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>

+9 -2
+4 -1
init/Kconfig
··· 1928 1928 config BINDGEN_VERSION_TEXT 1929 1929 string 1930 1930 depends on RUST 1931 - default $(shell,command -v $(BINDGEN) >/dev/null 2>&1 && $(BINDGEN) --version || echo n) 1931 + # The dummy parameter `workaround-for-0.69.0` is required to support 0.69.0 1932 + # (https://github.com/rust-lang/rust-bindgen/pull/2678). It can be removed when 1933 + # the minimum version is upgraded past that (0.69.1 already fixed the issue). 1934 + default $(shell,command -v $(BINDGEN) >/dev/null 2>&1 && $(BINDGEN) --version workaround-for-0.69.0 || echo n) 1932 1935 1933 1936 # 1934 1937 # Place an empty function call at each tracepoint site. Can be
+5 -1
scripts/rust_is_available.sh
··· 121 121 # Check that the Rust bindings generator is suitable. 122 122 # 123 123 # 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). 124 128 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 126 130 ) || rust_bindings_generator_code=$? 127 131 if [ -n "$rust_bindings_generator_code" ]; then 128 132 echo >&2 "***"