Skip to content

Commit aacf93e

Browse files
masahir0yojeda
authored andcommitted
rust: fix the default format for CONFIG_{RUSTC,BINDGEN}_VERSION_TEXT
Another oddity in these config entries is their default value can fall back to 'n', which is a value for bool or tristate symbols. The '|| echo n' is an incorrect workaround to avoid the syntax error. This is not a big deal, as the entry is hidden by 'depends on RUST' in situations where '$(RUSTC) --version' or '$(BINDGEN) --version' fails. Anyway, it looks odd. The default of a string type symbol should be a double-quoted string literal. Turn it into an empty string when the version command fails. Fixes: 2f7ab12 ("Kbuild: add Rust support") Signed-off-by: Masahiro Yamada <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Rebased on top of v6.11-rc1. - Miguel ] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 5ce86c6 commit aacf93e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

init/Kconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -1919,15 +1919,15 @@ config RUST
19191919
config RUSTC_VERSION_TEXT
19201920
string
19211921
depends on RUST
1922-
default $(shell,$(RUSTC) --version 2>/dev/null || echo n)
1922+
default "$(shell,$(RUSTC) --version 2>/dev/null)"
19231923

19241924
config BINDGEN_VERSION_TEXT
19251925
string
19261926
depends on RUST
19271927
# The dummy parameter `workaround-for-0.69.0` is required to support 0.69.0
19281928
# (https://github.com/rust-lang/rust-bindgen/pull/2678). It can be removed when
19291929
# the minimum version is upgraded past that (0.69.1 already fixed the issue).
1930-
default $(shell,$(BINDGEN) --version workaround-for-0.69.0 2>/dev/null || echo n)
1930+
default "$(shell,$(BINDGEN) --version workaround-for-0.69.0 2>/dev/null)"
19311931

19321932
#
19331933
# Place an empty function call at each tracepoint site. Can be

0 commit comments

Comments
 (0)