From 1094aa35d1688bec13f64fd9a04f3790a46246ae Mon Sep 17 00:00:00 2001 From: Owen Rafferty Date: Tue, 5 Jul 2022 15:57:58 -0500 Subject: [PATCH] rust: bootstrap with system compiler, et al if possible --- extra/rust/build | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/extra/rust/build b/extra/rust/build index 301dabeb..b5f293be 100755 --- a/extra/rust/build +++ b/extra/rust/build @@ -6,17 +6,6 @@ patch -p1 < fix-curl.patch # change them to relative paths ($PWD/... ./...). export RUSTFLAGS="$RUSTFLAGS --remap-path-prefix=$PWD=." -# This package mimics the download process of rust's 'x.py' -# bootstrap library to allow for the removal of the internet -# connection requirement per build. -{ - mkdir -p "${cache_dir:=build/cache/2022-05-19}" - - for tarball in *.tar.xz\?no-extract; do - mv -f "$tarball" "$cache_dir/${tarball%%\?no-extract}" - done -} - # Set shared linking as the default. sed 's/\(crt_static_default = \)true/\1false/' \ compiler/rustc_target/src/spec/linux_musl_base.rs > _ @@ -48,6 +37,31 @@ tools = [ "cargo", "rustfmt" ] sanitizers = false profiler = false full-bootstrap = false +EOF + +# If possible, use local rust to bootstrap. +case $(rustc --version 2>/dev/null) in + *1.62*|*1.61*) + cat >> config.toml <> config.toml <