Skip to content

Commit

Permalink
Fix Rust toolchain environment issue on RustRover (#1497)
Browse files Browse the repository at this point in the history
* Fix Rust toolchain environment issue on RustRover

* Disable auto rustup update

Tool: gitpod/catfood.gitpod.cloud
  • Loading branch information
axonasif authored Feb 5, 2025
1 parent e546d6b commit c59b50a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions chunks/lang-rust/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c59b50a

Please sign in to comment.