-
Notifications
You must be signed in to change notification settings - Fork 24
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
refactor: smoother large file download&proxy #463
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! Did some testing and there couldn't any time improvements, but the way we handle proxies is definitely better. Mind solving the logging comments?
Sure, let me think of a better way to show multiple downloading processes. Also, yep the streaming download solution is not to improve speed, but to show user that we are actively downloading and patient is needed if network speed is low, which is very reassuring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the improvements! The bars are way better to display the download info! To avoid having 2 batches of download files and 2 All downloads complete
messages:
[info]: Downloading 'rust.tar.xz'
[info]: Downloading 'idf_tool_xtensa_elf_clang.libs.tar.xz'
[info]: Downloading 'xtensa-esp-elf.tar.xz'
[info]: Creating symlink between '/home/esp/.rustup/toolchains/esp/xtensa-esp32-elf-clang/esp-18.1.2_20240912/esp-clang/lib' and '/home/esp/.espup/esp-clang'
[info]: All downloads complete
[info]: Installing 'rust' component for Xtensa Rust toolchain
[info]: Downloading 'rust-src.tar.xz'
[info]: All downloads complete
I would suggest one small change:
@@ -232,6 +232,14 @@ impl Installable for XtensaRust {
}
let tmp_dir = tempdir_in(path)?;
let tmp_dir_path = &tmp_dir.path().display().to_string();
+ download_file(
+ self.src_dist_url.clone(),
+ "rust-src.tar.xz",
+ tmp_dir_path,
+ true,
+ false,
+ )
+ .await?;
download_file(
self.dist_url.clone(),
@@ -243,7 +251,6 @@ impl Installable for XtensaRust {
.await?;
info!("Installing 'rust' component for Xtensa Rust toolchain");
-
if !Command::new("/usr/bin/env")
.arg("bash")
.arg(format!(
@@ -266,14 +273,6 @@ impl Installable for XtensaRust {
return Err(Error::XtensaRust);
}
- download_file(
- self.src_dist_url.clone(),
- "rust-src.tar.xz",
- tmp_dir_path,
- true,
- false,
- )
- .await?;
info!("Installing 'rust-src' component for Xtensa Rust toolchain");
if !Command::new("/usr/bin/env")
.arg("bash")
This results in:
[info]: Installing GCC (xtensa-esp-elf)
[info]: Downloading 'rust-src.tar.xz'
[info]: Downloading 'idf_tool_xtensa_elf_clang.libs.tar.xz'
[info]: Downloading 'xtensa-esp-elf.tar.xz'
[info]: Downloading 'rust.tar.xz'
[info]: Creating symlink between '/home/esp/.rustup/toolchains/esp/xtensa-esp32-elf-clang/esp-18.1.2_20240912/esp-clang/lib' and '/home/esp/.espup/esp-clang'
[info]: All downloads complete
[info]: Installing 'rust' component for Xtensa Rust toolchain
[info]: Installing 'rust-src' component for Xtensa Rust toolchain
Maybe we don't even need the Donwloading...
message, we could maybe leave the progress bar with the finished message, but these are just nitpicks so feel free to ignore.
Thanks again for your work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
add a few changes to improve user experience:
rust.zip
)https_proxy/HTTPS_PROXY/all_proxy/ALL_PROXY
varspawn_blocking
so tokio wouldn't panic in debug mode