rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix libclang version check for out-of-tree builds
@ 2023-05-13 19:32 Ethan D. Twardy
  0 siblings, 0 replies; only message in thread
From: Ethan D. Twardy @ 2023-05-13 19:32 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Nathan Chancellor,
	Nick Desaulniers, Tom Rix, open list:RUST, open list,
	open list:CLANG/LLVM BUILD SUPPORT
  Cc: Ethan D. Twardy

During out-of-tree builds where the path to the kernel source tree
contains a version string, scripts/rust_is_available.sh incorrectly
parses the version string of libclang, resulting in
CONFIG_RUST_IS_AVAILABLE erroneously set to 'n'.

To reproduce:

    $ cd ~/build && make -C ~/linux-6.4.0-rc1 O=$PWD rustavailable

Signed-off-by: Ethan D. Twardy <ethan.twardy@gmail.com>
---
 scripts/rust_is_available.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/rust_is_available.sh b/scripts/rust_is_available.sh
index aebbf1913970..e8a1439be9f8 100755
--- a/scripts/rust_is_available.sh
+++ b/scripts/rust_is_available.sh
@@ -102,8 +102,8 @@ fi
 # Check that the `libclang` used by the Rust bindings generator is suitable.
 bindgen_libclang_version=$( \
 	LC_ALL=C "$BINDGEN" $(dirname $0)/rust_is_available_bindgen_libclang.h 2>&1 >/dev/null \
-		| grep -F 'clang version ' \
-		| grep -oE '[0-9]+\.[0-9]+\.[0-9]+' \
+		| grep -oE 'clang version [0-9]+\.[0-9]+\.[0-9]+' \
+		| cut -d' ' -f3 \
 		| head -n 1 \
 )
 bindgen_libclang_min_version=$($min_tool_version llvm)

base-commit: ac9a78681b921877518763ba0e89202254349d1b
-- 
2.40.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-13 19:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-13 19:32 [PATCH] Fix libclang version check for out-of-tree builds Ethan D. Twardy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).