From c59b50a6e60de91c25e6c248366fe76e540bf3c3 Mon Sep 17 00:00:00 2001 From: Aminur Rahman Date: Wed, 5 Feb 2025 15:28:25 +0600 Subject: [PATCH] Fix Rust toolchain environment issue on RustRover (#1497) * Fix Rust toolchain environment issue on RustRover * Disable auto rustup update Tool: gitpod/catfood.gitpod.cloud --- chunks/lang-rust/Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/chunks/lang-rust/Dockerfile b/chunks/lang-rust/Dockerfile index e674e5384..b4a453ea8 100644 --- a/chunks/lang-rust/Dockerfile +++ b/chunks/lang-rust/Dockerfile @@ -14,9 +14,11 @@ ENV PATH=$HOME/.cargo/bin:$PATH RUN curl -fsSL https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain ${RUST_VERSION} \ -c rls rust-analysis rust-src rustfmt clippy \ && for cmp in rustup cargo; do rustup completions bash "$cmp" > "$HOME/.local/share/bash-completion/completions/$cmp"; done \ - && printf '%s\n' 'export CARGO_HOME=/workspace/.cargo' \ - 'mkdir -m 0755 -p "$CARGO_HOME/bin" 2>/dev/null' \ - 'export PATH=$CARGO_HOME/bin:$PATH' \ - 'test ! -e "$CARGO_HOME/bin/rustup" && mv "$(command -v rustup)" "$CARGO_HOME/bin"' > $HOME/.bashrc.d/80-rust \ && cargo install cargo-watch cargo-edit cargo-workspaces \ && rm -rf "$HOME/.cargo/registry" # This registry cache is now useless as we change the CARGO_HOME path to `/workspace` + +# Helpful for Gitpod prebuilds +RUN rustup set auto-self-update disable +ENV CARGO_HOME=/workspace/.cargo +ENV CARGO_INSTALL_ROOT=$HOME/.cargo +ENV RUSTUP_HOME=$HOME/.rustup