From 7f74335bda51adb77c94c8d0144dc0b49d951e56 Mon Sep 17 00:00:00 2001 From: messense Date: Sat, 21 Dec 2024 18:17:22 +0800 Subject: [PATCH] Print messages on non-interactive downloads --- src/compiler/clang.rs | 6 ++++++ src/compiler/clang_cl.rs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/compiler/clang.rs b/src/compiler/clang.rs index 72271e5..5cc901b 100644 --- a/src/compiler/clang.rs +++ b/src/compiler/clang.rs @@ -230,11 +230,17 @@ impl<'a> Clang<'a> { ); pb.set_prefix("sysroot"); pb.set_message("⏬ Downloading"); + if pb.is_hidden() { + eprintln!("⏬ Start to download MSVC sysroot..."); + } let reader = pb.wrap_read(response.into_reader()); let tar = XzDecoder::new(reader); let mut archive = tar::Archive::new(tar); archive.unpack(cache_dir)?; pb.finish_with_message("Download completed"); + if pb.is_hidden() { + eprintln!("✅ Finished downloading MSVC sysroot"); + } Ok(()) } diff --git a/src/compiler/clang_cl.rs b/src/compiler/clang_cl.rs index b8ccff9..edf4237 100644 --- a/src/compiler/clang_cl.rs +++ b/src/compiler/clang_cl.rs @@ -309,6 +309,9 @@ impl<'a> ClangCl<'a> { .collect(); mp.set_move_cursor(true); + if mp.is_hidden() { + eprintln!("⏬ Start to download MSVC CRT..."); + } ctx.execute( pkgs, work_items, @@ -335,6 +338,9 @@ impl<'a> ClangCl<'a> { if unpack.exists() { let _ = fs::remove_dir_all(unpack); } + if mp.is_hidden() { + eprintln!("✅ Finished downloading MSVC CRT"); + } Ok(()) }