Lines Matching +full:0 +full:- +full:9 +full:a +full:- +full:e

2 # SPDX-License-Identifier: GPL-2.0
4 # Tests whether a suitable Rust toolchain is available.
6 # Pass `-v` for human output and more checks (as warnings).
8 set -e
10 min_tool_version=$(dirname $0)/min-tool-version.sh
12 # Convert the version string x.y.z to a canonical up-to-7-digits form.
15 # instances in other version scripts) to give a bit more space to
16 # `rustc` since it will reach 1.100.0 in late 2026.
20 set -- $1
25 if ! command -v "$RUSTC" >/dev/null; then
26 if [ "$1" = -v ]; then
35 if ! command -v "$BINDGEN" >/dev/null; then
36 if [ "$1" = -v ]; then
46 # Non-stable and distributions' versions may have a version suffix, e.g. `-dev`.
48 LC_ALL=C "$RUSTC" --version 2>/dev/null \
49 | head -n 1 \
50 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' \
55 if [ "$rust_compiler_cversion" -lt "$rust_compiler_min_cversion" ]; then
56 if [ "$1" = -v ]; then
65 if [ "$1" = -v ] && [ "$rust_compiler_cversion" -gt "$rust_compiler_min_cversion" ]; then
75 # Non-stable and distributions' versions may have a version suffix, e.g. `-dev`.
77 LC_ALL=C "$BINDGEN" --version 2>/dev/null \
78 | head -n 1 \
79 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' \
84 if [ "$rust_bindings_generator_cversion" -lt "$rust_bindings_generator_min_cversion" ]; then
85 if [ "$1" = -v ]; then
94 if [ "$1" = -v ] && [ "$rust_bindings_generator_cversion" -gt "$rust_bindings_generator_min_cversio…
104 LC_ALL=C "$BINDGEN" $(dirname $0)/rust_is_available_bindgen_libclang.h 2>&1 >/dev/null \
105 | grep -F 'clang version ' \
106 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' \
107 | head -n 1 \
112 if [ "$bindgen_libclang_cversion" -lt "$bindgen_libclang_min_cversion" ]; then
113 if [ "$1" = -v ]; then
126 # In the future, we might be able to perform a full version check, see
127 # https://github.com/rust-lang/rust-bindgen/issues/2138.
128 if [ "$1" = -v ]; then
129 cc_name=$($(dirname $0)/cc-version.sh "$CC" | cut -f1 -d' ')
132 LC_ALL=C "$CC" --version 2>/dev/null \
133 | sed -nE '1s:.*version ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
138 echo >&2 "*** version does not match Clang's. This may be a problem."
148 # `$KRUSTFLAGS` is passed in case the user added `--sysroot`.
149 rustc_sysroot=$("$RUSTC" $KRUSTFLAGS --print sysroot)
150 rustc_src=${RUST_LIB_SRC:-"$rustc_sysroot/lib/rustlib/src/rust/library"}
152 if [ ! -e "$rustc_src_core" ]; then
153 if [ "$1" = -v ]; then