Skip to content

Commit 47889d7

Browse files
committed
scripts: fix clang version detection on certain Linux distributions
Prevents the libclang vs clang version mismatch warning message from showing up when the clang version reported by 'clang --version' contains the Linux distro version Signed-off-by: macano953 <macanroj@gmail.com>
1 parent 85ae8ca commit 47889d7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

scripts/rust-is-available.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ if [ "$1" = -v ]; then
129129
if [ "$cc_name" = Clang ]; then
130130
clang_version=$( \
131131
LC_ALL=C "$CC" --version 2>/dev/null \
132-
| head -n 1 \
133-
| grep -oE '[0-9]+\.[0-9]+\.[0-9]+' \
132+
| sed -nE '1s:.*version ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
134133
)
135134
if [ "$clang_version" != "$bindgen_libclang_version" ]; then
136135
echo >&2 "***"

0 commit comments

Comments
 (0)