Skip to content

fix(cli/self-update): postpone initialization of Cfg in setup_mode - #4996

Draft
rami3l wants to merge 3 commits into
rust-lang:mainfrom
rami3l:fix/early-cfg-creation
Draft

fix(cli/self-update): postpone initialization of Cfg in setup_mode#4996
rami3l wants to merge 3 commits into
rust-lang:mainfrom
rami3l:fix/early-cfg-creation

Conversation

@rami3l

@rami3l rami3l commented Aug 4, 2026

Copy link
Copy Markdown
Member

Fixes #4744 by partially reverting eabe985.

@rami3l
rami3l force-pushed the fix/early-cfg-creation branch from 789aac3 to eab7dbc Compare August 4, 2026 14:46
@rami3l
rami3l force-pushed the fix/early-cfg-creation branch from eab7dbc to 60aa826 Compare August 4, 2026 14:48
@rami3l
rami3l force-pushed the fix/early-cfg-creation branch from 60aa826 to 51b18cf Compare August 4, 2026 15:10
Comment thread src/cli/self_update.rs
warn!("{}", settings_file_path.display());
let inferred = PartialToolchainDesc::from_str("stable")?.resolve(&cfg.default_host_tuple()?)?;
warn!("{}", settings_file.path.display());
let default_host_tuple = settings_file.with(|s| Ok(default_host_tuple(s, process)))?;

@rami3l rami3l Aug 4, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is essentially the same as Cfg::default_host_tuple(), should we extract it somehow?

View changes since the review

@rami3l
rami3l requested a review from djc August 4, 2026 15:14
@@ -20,7 +20,6 @@ use super::super::errors::CliError;
use super::common;

@rami3l rami3l Aug 4, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to myself: One regression test is needed to ensure that #4744 has been resolved.

View changes since the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rustup-init creates $RUSTUP_HOME even before the installation starts

1 participant