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

rzup: add option to list available versions #2316

Open
2 tasks done
matthiasgeihs opened this issue Sep 5, 2024 · 3 comments · May be fixed by #2409
Open
2 tasks done

rzup: add option to list available versions #2316

matthiasgeihs opened this issue Sep 5, 2024 · 3 comments · May be fixed by #2409
Labels
enhancement New feature or request

Comments

@matthiasgeihs
Copy link

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Discord first?

  • This is not a support question.

Motivation

sometimes i just want to check what are the versions available through rzup. for example, is there a new version?

Request

Add a command --list (or short, -l) that lists all available versions.

Solution

No response

Are you willing to help with this request?

Maybe... (I have elaborated on how above)

@matthiasgeihs matthiasgeihs added the enhancement New feature or request label Sep 5, 2024
Copy link

linear bot commented Sep 5, 2024

@nuke-web3
Copy link
Contributor

I see there is related tooling in

fn print_updates(updates: &[UpdateInfo]) -> Result<()> {
// TODO: Check for rzup updates
let mut stdout = StandardStream::stdout(ColorChoice::Always);
for update in updates {
if update.up_to_date {
pretty_msg!(&mut stdout, true, None, &format!("{} - ", update.name));
pretty_msg!(&mut stdout, true, Some(Color::Green), "Up to date ");
pretty_msgln!(
&mut stdout,
false,
None,
format!(
": {} ({})",
update.current_version, update.current_published_at
)
);
} else {
pretty_msg!(&mut stdout, true, None, &format!("{} - ", update.name));
pretty_msg!(&mut stdout, true, Some(Color::Yellow), "Update available ");
pretty_msgln!(
&mut stdout,
false,
None,
format!(
": {} ({}) -> {} ({})",
update.current_version,
update.current_published_at,
update.latest_version,
update.latest_published_at,
)
);
}
}

and

risc0/rzup/src/utils.rs

Lines 362 to 383 in e7986bf

/// Checks for updates for the active toolchains and extensions and returns a list of update information.
pub async fn get_updatable_active() -> Result<Vec<UpdateInfo>, RzupError> {
let mut updates = Vec::new();
if !is_extensions_installed()? {
return Err(RzupError::Other(
"No installed extensions detected. \n\nFor more information, try '--help'".to_string(),
));
}
if !is_toolchains_installed()? {
return Err(RzupError::Other(
"No installed toolchains detected. \n\nFor more information, try '--help'".to_string(),
));
}
updates.push(check_cargo_risczero_updates().await?);
updates.push(check_rust_toolchain_updates().await?);
updates.push(check_cpp_toolchain_updates().await?);
Ok(updates)
}

Seems like it could be relatively easy to impl a rzup check versions or rzup list --[all|remote] or some related command to do this.

@matthiasgeihs
Copy link
Author

@nuke-web3 Thanks for the pointers.

Gave it a shot and opened PR #2409.

(Note: While implementing, noticed I was on an old version of rzup that didn't have check and show. Especially check is doing the most relevant thing for me here, which is checking for a new version. Not sure, if the list command is still needed in this case, but might still be worthwhile to have it?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants