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

Commit 0a6896d

Browse files
masahir0yDarksonn
authored andcommitted
FROMGIT: rust: suppress error messages from CONFIG_{RUSTC,BINDGEN}_VERSION_TEXT
While this is a somewhat unusual case, I encountered odd error messages when I ran Kconfig in a foreign architecture chroot. $ make allmodconfig sh: 1: rustc: not found sh: 1: bindgen: not found # # configuration written to .config # The successful execution of 'command -v rustc' does not necessarily mean that 'rustc --version' will succeed. $ sh -c 'command -v rustc' /home/masahiro/.cargo/bin/rustc $ sh -c 'rustc --version' sh: 1: rustc: not found Here, 'rustc' is built for x86, and I ran it in an arm64 system. The current code: command -v $(RUSTC) >/dev/null 2>&1 && $(RUSTC) --version || echo n can be turned into: command -v $(RUSTC) >/dev/null 2>&1 && $(RUSTC) --version 2>/dev/null || echo n However, I did not understand the necessity of 'command -v $(RUSTC)'. I simplified it to: $(RUSTC) --version 2>/dev/null || echo n Fixes: 2f7ab12 ("Kbuild: add Rust support") Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Link: https://lore.kernel.org/r/20240727140302.1806011-1-masahiroy@kernel.org [ Rebased on top of v6.11-rc1. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org> (cherry picked from commit 5ce86c6) Change-Id: Idb584c89ed29f86bb3af8f1ba53dde6b2c12fca4 Signed-off-by: Alice Ryhl <aliceryhl@google.com>
1 parent 756adf0 commit 0a6896d

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,command -v $(RUSTC) >/dev/null 2>&1 && $(RUSTC) --version || echo n)
1926+
default $(shell,$(RUSTC) --version 2>/dev/null || echo n)
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,command -v $(BINDGEN) >/dev/null 2>&1 && $(BINDGEN) --version workaround-for-0.69.0 || echo n)
1934+
default $(shell,$(BINDGEN) --version workaround-for-0.69.0 2>/dev/null || echo n)
19351935

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

0 commit comments

Comments
 (0)