2
0
mirror of https://codeberg.org/kiss-community/repo synced 2024-07-02 14:02:27 +00:00

rust: bootstrap with system compiler, et al if possible

This commit is contained in:
Owen Rafferty 2022-07-05 15:57:58 -05:00
parent b9671a4da5
commit 1094aa35d1
No known key found for this signature in database
GPG Key ID: A68B10E2554DEBCB

View File

@ -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 <<EOF
cargo = "/usr/bin/cargo"
rustc = "/usr/bin/rustc"
rustfmt = "/usr/bin/rustfmt"
EOF
;;
*)
# This 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
;;
esac
cat >> config.toml <<EOF
[install]
prefix = "/usr"