Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 253ac66

Browse files
masahir0yDarksonn
authored andcommitted
FROMGIT: 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 <masahiroy@kernel.org> Link: https://lore.kernel.org/r/20240727140302.1806011-2-masahiroy@kernel.org [ Rebased on top of v6.11-rc1. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org> (cherry picked from commit aacf93e) Change-Id: I5de5f33a862b0bb62710f1649ed5d472ae46a0a5 Signed-off-by: Alice Ryhl <aliceryhl@google.com>
1 parent 0a6896d commit 253ac66

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

init/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1923,15 +1923,15 @@ config RUST
19231923
config RUSTC_VERSION_TEXT
19241924
string
19251925
depends on RUST
1926-
default $(shell,$(RUSTC) --version 2>/dev/null || echo n)
1926+
default "$(shell,$(RUSTC) --version 2>/dev/null)"
19271927

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

19361936
#
19371937
# Place an empty function call at each tracepoint site. Can be

0 commit comments

Comments
 (0)