From dcd8d376cbe7d8dc40cb6d810a10914f98a868c2 Mon Sep 17 00:00:00 2001 From: jyn Date: Sun, 9 Jul 2023 22:12:39 -0500 Subject: [PATCH] don't print download progress in CI --- src/bootstrap/bootstrap.py | 2 +- src/bootstrap/download.rs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index e5a710c0a96..f5ee45c6a27 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -97,7 +97,7 @@ def _download(path, url, probably_big, verbose, exception): print("downloading {}".format(url), file=sys.stderr) try: - if probably_big or verbose: + if (probably_big or verbose) and "GITHUB_ACTIONS" not in os.environ: option = "-#" else: option = "-s" diff --git a/src/bootstrap/download.rs b/src/bootstrap/download.rs index eb1941cd889..d1190adfa19 100644 --- a/src/bootstrap/download.rs +++ b/src/bootstrap/download.rs @@ -7,7 +7,7 @@ use std::{ process::{Command, Stdio}, }; -use build_helper::util::try_run; +use build_helper::{util::try_run, ci::CiEnv}; use once_cell::sync::OnceCell; use xz2::bufread::XzDecoder; @@ -213,7 +213,6 @@ impl Config { // Try curl. If that fails and we are on windows, fallback to PowerShell. let mut curl = Command::new("curl"); curl.args(&[ - "-#", "-y", "30", "-Y", @@ -224,6 +223,12 @@ impl Config { "3", "-SRf", ]); + // Don't print progress in CI; the \r wrapping looks bad and downloads don't take long enough for progress to be useful. + if CiEnv::is_ci() { + curl.arg("-s"); + } else { + curl.arg("--progress-bar"); + } curl.arg(url); let f = File::create(tempfile).unwrap(); curl.stdout(Stdio::from(f));