|
81 | 81 | # Check that the Rust compiler version is suitable.
|
82 | 82 | #
|
83 | 83 | # Non-stable and distributions' versions may have a version suffix, e.g. `-dev`.
|
| 84 | +rust_compiler_output=$( \ |
| 85 | + LC_ALL=C "$RUSTC" --version 2>/dev/null |
| 86 | +) || rust_compiler_code=$? |
| 87 | +if [ -n "$rust_compiler_code" ]; then |
| 88 | + echo >&2 "***" |
| 89 | + echo >&2 "*** Running '$RUSTC' to check the Rust compiler version failed with" |
| 90 | + echo >&2 "*** code $rust_compiler_code. See output and docs below for details:" |
| 91 | + echo >&2 "***" |
| 92 | + echo >&2 "$rust_compiler_output" |
| 93 | + echo >&2 "***" |
| 94 | + exit 1 |
| 95 | +fi |
84 | 96 | rust_compiler_version=$( \
|
85 |
| - LC_ALL=C "$RUSTC" --version 2>/dev/null \ |
| 97 | + echo "$rust_compiler_output" \ |
86 | 98 | | sed -nE '1s:.*rustc ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
|
87 | 99 | )
|
88 | 100 | rust_compiler_min_version=$($min_tool_version rustc)
|
|
108 | 120 | # Check that the Rust bindings generator is suitable.
|
109 | 121 | #
|
110 | 122 | # Non-stable and distributions' versions may have a version suffix, e.g. `-dev`.
|
| 123 | +rust_bindings_generator_output=$( \ |
| 124 | + LC_ALL=C "$BINDGEN" --version 2>/dev/null |
| 125 | +) || rust_bindings_generator_code=$? |
| 126 | +if [ -n "$rust_bindings_generator_code" ]; then |
| 127 | + echo >&2 "***" |
| 128 | + echo >&2 "*** Running '$BINDGEN' to check the Rust bindings generator version failed with" |
| 129 | + echo >&2 "*** code $rust_bindings_generator_code. See output and docs below for details:" |
| 130 | + echo >&2 "***" |
| 131 | + echo >&2 "$rust_bindings_generator_output" |
| 132 | + echo >&2 "***" |
| 133 | + exit 1 |
| 134 | +fi |
111 | 135 | rust_bindings_generator_version=$( \
|
112 |
| - LC_ALL=C "$BINDGEN" --version 2>/dev/null \ |
| 136 | + echo "$rust_bindings_generator_output" \ |
113 | 137 | | sed -nE '1s:.*bindgen ([0-9]+\.[0-9]+\.[0-9]+).*:\1:p'
|
114 | 138 | )
|
115 | 139 | rust_bindings_generator_min_version=$($min_tool_version bindgen)
|
|
0 commit comments