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
123 # Non-stable and distributions' versions may have a version suffix, e.g. `-dev`.
125 # The dummy parameter `workaround-for-0.69.0` is required to support 0.69.0
126 # (https://github.com/rust-lang/rust-bindgen/pull/2678). It can be removed when
129 LC_ALL=C "$BINDGEN" --version workaround-for-0.69.0 2>/dev/null
131 if [ -n "$rust_bindings_generator_code" ]; then
142 | sed -nE '1s:.*bindgen ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
144 if [ -z "$rust_bindings_generator_version" ]; then
156 if [ "$rust_bindings_generator_cversion" -lt "$rust_bindings_generator_min_cversion" ]; then
164 if [ "$rust_bindings_generator_cversion" -eq 6600 ] ||
165 [ "$rust_bindings_generator_cversion" -eq 6601 ]; then
167 if ! "$BINDGEN" $(dirname $0)/rust_is_available_bindgen_0_66.h >/dev/null; then
169 echo >&2 "*** Rust bindings generator '$BINDGEN' versions 0.66.0 and 0.66.1 may not"
170 echo >&2 "*** work due to a bug (https://github.com/rust-lang/rust-bindgen/pull/2567),"
182 # is not found, thus inform the user in such a case.
184 LC_ALL=C "$BINDGEN" $(dirname $0)/rust_is_available_bindgen_libclang.h 2>&1 >/dev/null
186 if [ -n "$bindgen_libclang_code" ]; then
190 echo >&2 "*** a failure to locate libclang. See output and docs below for details:"
204 | sed -nE 's:.*clang version ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
206 if [ -z "$bindgen_libclang_version" ]; then
219 if [ "$bindgen_libclang_cversion" -lt "$bindgen_libclang_min_cversion" ]; then
231 # In the future, we might be able to perform a full version check, see
232 # https://github.com/rust-lang/rust-bindgen/issues/2138.
233 cc_name=$($(dirname $0)/cc-version.sh $CC | cut -f1 -d' ')
236 LC_ALL=C $CC --version 2>/dev/null \
237 | sed -nE '1s:.*version ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
242 echo >&2 "*** version does not match Clang's. This may be a problem."
252 # `$KRUSTFLAGS` is passed in case the user added `--sysroot`.
253 rustc_sysroot=$("$RUSTC" $KRUSTFLAGS --print sysroot)
254 rustc_src=${RUST_LIB_SRC:-"$rustc_sysroot/lib/rustlib/src/rust/library"}
256 if [ ! -e "$rustc_src_core" ]; then