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 automatic self updates in CI environments #3907

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion ci/run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ build_test() {
if [ -z "$SKIP_TESTS" ]; then
target_cargo run --features test -- --dump-testament
build_test build
build_test test
RUSTUP_CI=1 build_test test
fi
6 changes: 6 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,12 @@ impl<'a> Cfg<'a> {
}

pub(crate) fn get_self_update_mode(&self) -> Result<SelfUpdateMode> {
if self.process.var("CI").is_ok() && self.process.var("RUSTUP_CI").is_err() {
// If we're in CI (but not rustup's own CI, which wants to test this stuff!),
// disable automatic self updates.
return Ok(SelfUpdateMode::Disable);
}

self.settings_file.with(|s| {
Ok(match s.auto_self_update {
Some(mode) => mode,
Expand Down
Loading