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

Complete incompleted Xtensa Rust versions #366

Merged
merged 1 commit into from
Oct 4, 2023
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

### Fixed
- Complete Xtensa Rust versions when provided one is incompleted (#366)

### Removed

Expand Down
16 changes: 1 addition & 15 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use espup::{
logging::initialize_logger,
toolchain::{
gcc::uninstall_gcc_toolchains, install as toolchain_install, llvm::Llvm,
rust::get_rustup_home, rust::XtensaRust,
rust::get_rustup_home,
},
update::check_for_update,
};
Expand Down Expand Up @@ -64,13 +64,6 @@ async fn install(args: InstallOpts) -> Result<()> {
initialize_logger(&args.log_level);
check_for_update(env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"));

// Check if the toolchain version is valid if we are not skipping the version parse
if let Some(toolchain_version) = &args.toolchain_version {
if !args.skip_version_parse {
XtensaRust::parse_version(toolchain_version)?;
}
}

info!("{} Installing the Espressif Rust ecosystem", emoji::DISC);
toolchain_install(args).await?;
info!("{} Installation successfully completed!", emoji::CHECK);
Expand Down Expand Up @@ -109,13 +102,6 @@ async fn update(args: InstallOpts) -> Result<()> {
initialize_logger(&args.log_level);
check_for_update(env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"));

// Check if the toolchain version is valid if we are not skipping the version parse
if let Some(toolchain_version) = &args.toolchain_version {
if !args.skip_version_parse {
XtensaRust::parse_version(toolchain_version)?;
}
}

info!("{} Updating Espressif Rust ecosystem", emoji::DISC);
toolchain_install(args).await?;
info!("{} Update successfully completed!", emoji::CHECK);
Expand Down
8 changes: 7 additions & 1 deletion src/toolchain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ pub async fn install(args: InstallOpts) -> Result<()> {
let mut exports: Vec<String> = Vec::new();
let host_triple = get_host_triple(args.default_host)?;
let xtensa_rust_version = if let Some(toolchain_version) = &args.toolchain_version {
toolchain_version.clone()
if !args.skip_version_parse {
XtensaRust::parse_version(toolchain_version)?
} else {
toolchain_version.clone()
}
} else {
XtensaRust::get_latest_version().await?
};
Expand Down Expand Up @@ -180,6 +184,7 @@ pub async fn install(args: InstallOpts) -> Result<()> {
- LLVM Toolchain: {:?}
- Nightly version: {:?}
- Rust Toolchain: {:?}
- Skip version parsing: {}
- Targets: {:?}
- Toolchain path: {:?}
- Toolchain version: {:?}",
Expand All @@ -189,6 +194,7 @@ pub async fn install(args: InstallOpts) -> Result<()> {
&llvm,
&args.nightly_version,
xtensa_rust,
&args.skip_version_parse,
targets,
&install_path,
args.toolchain_version,
Expand Down