Fix Rust installation

There were a number of issues:

1. `rustc` wasn't actually installed since the `INSTALL_RUST_VERSION`
argument wasn't set.

2. `rustup` wasn't running properly since the `CARGO_HOME` and
`RUSTUP_HOME`weren't being exported and set by default. We now use the
technique described in https://github.com/rust-lang/rustup/issues/1085
to create a wrapper and link all the binaries in /opt/rust/bin and
link them to /usr/local/bin.

3. `rustc version` is not a valid command. `rustc --version` is valid.
This commit is contained in:
Stan Hu 2023-01-18 15:00:41 -08:00
parent a5ac3f8e7f
commit 9e04d5d21a
No known key found for this signature in database
GPG key ID: 8D3931AD39CC7A20
3 changed files with 19 additions and 6 deletions

View file

@ -64,13 +64,13 @@ function print_golang_args() {
function print_rust_args() {
case "$1" in
1.65.0)
RUST_VERSION="1.65.0"
INSTALL_RUST_VERSION="1.65.0"
;;
*) fail "Unknown rust version $1" ;;
esac
printf -- "--build-arg RUST_VERSION=%s " "$RUST_VERSION"
printf -- "--build-arg INSTALL_RUST_VERSION=%s " "$INSTALL_RUST_VERSION"
}
# If you add a new minor version here, be sure to check that the