rust: better bootstrap detection

This commit is contained in:
Owen Rafferty 2022-07-05 22:20:59 -05:00
parent 1094aa35d1
commit 945d835cd7
No known key found for this signature in database
GPG Key ID: A68B10E2554DEBCB

View File

@ -39,9 +39,16 @@ profiler = false
full-bootstrap = false
EOF
# If possible, use local rust to bootstrap.
case $(rustc --version 2>/dev/null) in
*1.62*|*1.61*)
maj="${2%%.*}"
min="${2%.*}"
min="${min#*.}"
rust_version=$(rustc --version 2>/dev/null) || rust_version=null
rust_version="${rust_version#rustc }"
# If possible, use system rust to bootstrap.
case "$rust_version" in
$2|$maj.$(($min - 1)).*)
cat >> config.toml <<EOF
cargo = "/usr/bin/cargo"
rustc = "/usr/bin/rustc"