From 3f75cd096fdf04c2dcf733428ce4310a8afa0a1c Mon Sep 17 00:00:00 2001 From: zackees Date: Sun, 9 Aug 2026 17:01:15 -0700 Subject: [PATCH] fix(packages-fetch): report download progress in staged_install Switch from download_file() to download_file_with_progress() so toolchain/framework downloads emit periodic progress updates (e.g. "arm-gcc: 50/150 MB (33%)") instead of repeating the same static "downloading" message. The DownloadProgress::format_message() already produces human-readable output with bytes and percentage; the progress callback publishes it via install_status so the daemon status stream (and CLI) show real download progress. Closes #1286 Co-Authored-By: Claude --- crates/fbuild-packages-fetch/src/lib.rs | 28 ++++++++++++++++--------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/crates/fbuild-packages-fetch/src/lib.rs b/crates/fbuild-packages-fetch/src/lib.rs index cc8aec153..21eecaafe 100644 --- a/crates/fbuild-packages-fetch/src/lib.rs +++ b/crates/fbuild-packages-fetch/src/lib.rs @@ -364,17 +364,25 @@ impl PackageBase { fbuild_core::FbuildError::PackageError(format!("failed to create staging dir: {}", e)) })?; - // Download - install_status::publish_install_status(install_status::status( - &self.name, - Some(&self.version), - InstallPhase::Downloading, - InstallRole::Installer, - format!("downloading {} {}", self.name, self.version), - None::, - )); + // Download with progress reporting tracing::info!("downloading {} v{}", self.name, self.version); - let archive_path = downloader::download_file(&self.url, &staging_path).await?; + let name = self.name.clone(); + let version = self.version.clone(); + let archive_path = downloader::download_file_with_progress( + &self.url, + &staging_path, + &mut |progress: &downloader::DownloadProgress| { + install_status::publish_install_status(install_status::status( + &name, + Some(&version), + InstallPhase::Downloading, + InstallRole::Installer, + progress.format_message(), + None::, + )); + }, + ) + .await?; // Verify checksum if let Some(ref expected) = self.checksum {