summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJohn Hubbard <jhubbard@nvidia.com>2024-06-27 17:43:55 -0700
committerMiguel Ojeda <ojeda@kernel.org>2024-07-08 23:44:01 +0200
commit6dc9d9ca9a728c8b30976d3ca353563ba0bfb949 (patch)
treeb284290ffc8db6e49c9ccdbb3db30b9c2b02540e /Makefile
parentb63c455d38be5f62a0665f3080c67334db5b4c41 (diff)
downloadlinux-6dc9d9ca9a728c8b30976d3ca353563ba0bfb949.tar.gz
linux-6dc9d9ca9a728c8b30976d3ca353563ba0bfb949.tar.bz2
linux-6dc9d9ca9a728c8b30976d3ca353563ba0bfb949.zip
kbuild: rust-analyzer: 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 Reviewed-by: Finn Behrens <me@kloenk.dev> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Tested-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: John Hubbard <jhubbard@nvidia.com> Link: https://lore.kernel.org/r/20240628004356.1384486-2-jhubbard@nvidia.com [ Reworded title. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index d4134a9f32b6..de5be3845c70 100644
--- a/Makefile
+++ b/Makefile
@@ -1969,6 +1969,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