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

2 # SPDX-License-Identifier: GPL-2.0
4 # Tests whether a suitable Rust toolchain is available.
6 set -e
8 min_tool_version=$(dirname $0)/min-tool-version.sh
10 # Convert the version string x.y.z to a canonical up-to-7-digits form.
13 # instances in other version scripts) to give a bit more space to
14 # `rustc` since it will reach 1.100.0 in late 2026.
18 set -- $1
22 # Print a reference to the Quick Start guide in the documentation.
26 echo >&2 "*** Please see Documentation/rust/quick-start.rst for details"
42 # print a reference to the documentation on exit.
43 warning=0
44 trap 'if [ $? -ne 0 ] || [ $warning -ne 0 ]; then print_docs_reference; fi' EXIT
47 if [ -z "${RUSTC+x}" ]; then
53 if [ -z "${BINDGEN+x}" ]; then
59 if [ -z "${CC+x}" ]; then
66 if ! command -v "$RUSTC" >/dev/null; then
74 if ! command -v "$BINDGEN" >/dev/null; then
83 # Non-stable and distributions' versions may have a version suffix, e.g. `-dev`.
85 LC_ALL=C "$RUSTC" --version 2>/dev/null
87 if [ -n "$rust_compiler_code" ]; then
98 | sed -nE '1s:.*rustc ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
100 if [ -z "$rust_compiler_version" ]; then
112 if [ "$rust_compiler_cversion" -lt "$rust_compiler_min_cversion" ]; then
120 if [ "$rust_compiler_cversion" -gt "$rust_compiler_min_cversion" ]; then
131 # Non-stable and distributions' versions may have a version suffix, e.g. `-dev`.
133 LC_ALL=C "$BINDGEN" --version 2>/dev/null
135 if [ -n "$rust_bindings_generator_code" ]; then
146 | sed -nE '1s:.*bindgen ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
148 if [ -z "$rust_bindings_generator_version" ]; then
160 if [ "$rust_bindings_generator_cversion" -lt "$rust_bindings_generator_min_cversion" ]; then
168 if [ "$rust_bindings_generator_cversion" -gt "$rust_bindings_generator_min_cversion" ]; then
181 # is not found, thus inform the user in such a case.
183 LC_ALL=C "$BINDGEN" $(dirname $0)/rust_is_available_bindgen_libclang.h 2>&1 >/dev/null
185 if [ -n "$bindgen_libclang_code" ]; then
189 echo >&2 "*** a failure to locate libclang. See output and docs below for details:"
203 | sed -nE 's:.*clang version ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
205 if [ -z "$bindgen_libclang_version" ]; then
218 if [ "$bindgen_libclang_cversion" -lt "$bindgen_libclang_min_cversion" ]; then
230 # In the future, we might be able to perform a full version check, see
231 # https://github.com/rust-lang/rust-bindgen/issues/2138.
232 cc_name=$($(dirname $0)/cc-version.sh $CC | cut -f1 -d' ')
235 LC_ALL=C $CC --version 2>/dev/null \
236 | sed -nE '1s:.*version ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
241 echo >&2 "*** version does not match Clang's. This may be a problem."
251 # `$KRUSTFLAGS` is passed in case the user added `--sysroot`.
252 rustc_sysroot=$("$RUSTC" $KRUSTFLAGS --print sysroot)
253 rustc_src=${RUST_LIB_SRC:-"$rustc_sysroot/lib/rustlib/src/rust/library"}
255 if [ ! -e "$rustc_src_core" ]; then