[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240628004356.1384486-2-jhubbard@nvidia.com>
Date: Thu, 27 Jun 2024 17:43:55 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Miguel Ojeda <ojeda@...nel.org>
Cc: Greg KH <greg@...ah.com>,
Masahiro Yamada <masahiroy@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Nicolas Schier <nicolas@...sle.eu>,
Alex Gaynor <alex.gaynor@...il.com>,
Wedson Almeida Filho <wedsonaf@...il.com>,
Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...sung.com>,
Alice Ryhl <aliceryhl@...gle.com>,
Finn Behrens <me@...enk.dev>,
linux-kbuild@...r.kernel.org,
rust-for-linux@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>,
John Hubbard <jhubbard@...dia.com>
Subject: [PATCH v3 1/2] Makefile: rust-analyzer target: better error handling
1) Provide a better error message for the "Rust not available" case.
Without this patch, one gets various misleading messages, such as:
"No rule to make target 'rust-analyzer'"
Instead, run scripts/rust_is_available.sh directly, as a prerequisite,
and let that script report the cause of any problems, as well as
providing a link to the documentation. Thanks to Miguel Ojeda for the
idea of just letting rust_is_available.sh report its results directly.
The new output in the failure case looks like this:
$ make rust-analyzer
***
*** Rust compiler 'rustc' could not be found.
***
***
*** Please see Documentation/rust/quick-start.rst for details
*** on how to set up the Rust support.
***
make[1]: *** [/kernel_work/linux-github/Makefile:1975: rust-analyzer] Error 1
make: *** [Makefile:240: __sub-make] Error 2
Acked-by: Miguel Ojeda <ojeda@...nel.org>
Reviewed-by: Finn Behrens <me@...enk.dev>
Reviewed-by: Alice Ryhl <aliceryhl@...gle.com>
Tested-by: Alice Ryhl <aliceryhl@...gle.com>
Signed-off-by: John Hubbard <jhubbard@...dia.com>
---
Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
index 4d36f943b3b1..204e9be0e010 100644
--- a/Makefile
+++ b/Makefile
@@ -1970,6 +1970,7 @@ tags TAGS cscope gtags: FORCE
# IDE support targets
PHONY += rust-analyzer
rust-analyzer:
+ $(Q)$(CONFIG_SHELL) $(srctree)/scripts/rust_is_available.sh
$(Q)$(MAKE) $(build)=rust $@
# Script to generate missing namespace dependencies
--
2.45.2
Powered by blists - more mailing lists