Only install rust-bpf if rust-bpf version changes (#2939)

This commit is contained in:
Jack May 2019-02-25 19:09:16 -08:00 committed by GitHub
parent 454c66f988
commit 6a61f25735
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 7 deletions

View File

@ -61,24 +61,30 @@ if [[ ! -f rust-bpf-$machine-$version.md ]]; then
filename=solana-rust-bpf-$machine.tar.bz2
set -ex
rm -rf rust-bpf*
rm -rf rust-bpf
rm -rf rust-bpf-$machine-*
mkdir -p rust-bpf
cd rust-bpf
pushd rust-bpf
wget --progress=dot:giga https://github.com/solana-labs/rust-bpf-builder/releases/download/$version/$filename
tar -jxf $filename
rm -rf $filename
popd
echo "https://github.com/solana-labs/rust-bpf-builder/releases/tag/$version" > ../rust-bpf-$machine-$version.md
set -ex
./rust-bpf/bin/rustc --print sysroot
set +e
rustup toolchain uninstall bpf
set -e
rustup toolchain link bpf rust-bpf
echo "https://github.com/solana-labs/rust-bpf-builder/releases/tag/$version" > rust-bpf-$machine-$version.md
)
exitcode=$?
if [[ $exitcode -ne 0 ]]; then
rm -rf rust-bpf
exit 1
fi
set +e
rustup toolchain uninstall bpf
set -e
rustup toolchain link bpf rust-bpf
fi
# Install Rust-BPF Sysroot