Skip to content

Conversation

nozwock
Copy link

@nozwock nozwock commented Oct 10, 2025

Addresses #4505, adding a flag to don't try to update already installed toolchains.

Copy link
Contributor

@djc djc left a comment

Choose a reason for hiding this comment

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

I think we'd want some tests for this.

@nozwock
Copy link
Author

nozwock commented Oct 10, 2025

I think we'd want some tests for this.

What kinds? I can't think of too many.

#[tokio::test]
async fn toolchain_install_no_change_with_no_update() {
    let mut cx = CliTestContext::new(Scenario::None).await;

    {
        let cx = cx.with_dist_dir(Scenario::ArchivesV2_2015_01_01);
        cx.config
            .expect(["rustup", "toolchain", "add", "stable"])
            .await
            .is_ok();
    }

    let cx = cx.with_dist_dir(Scenario::SimpleV2);
    cx.config
        .expect(["rustup", "install", "--no-update", "stable"])
        .await
        .with_stdout(snapbox::str![[r#"

  stable-[HOST_TRIPLE] unchanged - 1.0.0 (hash-stable-1.0.0)


"#]])
        .with_stderr(snapbox::str![[""]])
        .is_ok();
}

Actually, I'd expected it to not be unchanged here without --no-update here, but it's still the same...

@nozwock nozwock force-pushed the add-install-no-update branch from 72a95f6 to 4192bf4 Compare October 11, 2025 04:45
@djc
Copy link
Contributor

djc commented Oct 13, 2025

Need to update the cli_ui tests. The test failures should give some hints on how to do this efficiently.

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.

2 participants