Skip to content

Commit

Permalink
fix: Complete incompleted Xtensa Rust versions
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Oct 4, 2023
1 parent 02ac046 commit 09b94cd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
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

0 comments on commit 09b94cd

Please sign in to comment.