Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable rustup self-updating #10970

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Disable rustup self-updating
`rustup` has a mechanism for self-updating, which triggers whenever you
request it to install a new toolchain. This is annoying to have happen in CI
though, since it increases build time for no benefit.

So let's disable this mechanism.
  • Loading branch information
madsmtm committed Nov 14, 2024
commit d39207901d8156a50d187a0682fe2cc5d8ca9c89
9 changes: 9 additions & 0 deletions images/macos/scripts/build/install-rust.sh
Original file line number Diff line number Diff line change
@@ -15,6 +15,15 @@ rustup-init -y --no-modify-path --default-toolchain=stable --profile=minimal
echo "Initialize environment variables..."
CARGO_HOME=$HOME/.cargo

echo "Disable rustup self-updating"
# This is undesirable because:
# - We will keep rustup updated (just like any other dependency).
# - rustup does not need to be the latest and greatest.
# - Self-updating in CI will introduce longer build times for no benefit.
# - ... which becomes important because self-updating happens in various
# places, including `rustup toolchain install`.
rustup set auto-self-update disable

echo "Install common tools..."
rustup component add rustfmt clippy

10 changes: 10 additions & 0 deletions images/ubuntu/scripts/build/install-rust.sh
Original file line number Diff line number Diff line change
@@ -16,6 +16,16 @@ curl -fsSL https://sh.rustup.rs | sh -s -- -y --default-toolchain=stable --profi
# Initialize environment variables
source $CARGO_HOME/env

# Disable rustup self-updating
#
# This is undesirable because:
# - We will keep rustup updated (just like any other dependency).
# - Rustup does not need to be the latest and greatest.
# - Self-updating in CI will introduce longer build times for no benefit.
# - ... which becomes important because self-updating happens in various
# places, including `rustup toolchain install`.
rustup set auto-self-update disable

# Install common tools
rustup component add rustfmt clippy

10 changes: 10 additions & 0 deletions images/windows/scripts/build/Install-Rust.ps1
Original file line number Diff line number Diff line change
@@ -28,6 +28,16 @@ Add-DefaultPathItem "%USERPROFILE%\.cargo\bin"
# Add Rust binaries to the path
$env:Path += ";$env:CARGO_HOME\bin"

# Disable rustup self-updating
#
# This is undesirable because:
# - We will keep rustup updated (just like any other dependency).
# - rustup does not need to be the latest and greatest.
# - Self-updating in CI will introduce longer build times for no benefit.
# - ... which becomes important because self-updating happens in various
# places, including `rustup toolchain install`.
rustup set auto-self-update disable

# Add i686 target for building 32-bit binaries
rustup target add i686-pc-windows-msvc