about summary refs log tree commit diff
diff options
context:
space:
mode:
authorjyn <github@jyn.dev>2023-07-09 22:12:39 -0500
committerjyn <github@jyn.dev>2023-07-14 17:27:20 -0500
commitdcd8d376cbe7d8dc40cb6d810a10914f98a868c2 (patch)
treefdf3e5fdf006fcb0eaa3a5e02f4cc5200b42f46e
parent26cdf7566cba986045b856d26c253df1150bff93 (diff)
downloadrust-dcd8d376cbe7d8dc40cb6d810a10914f98a868c2.tar.gz
rust-dcd8d376cbe7d8dc40cb6d810a10914f98a868c2.zip
don't print download progress in CI
-rw-r--r--src/bootstrap/bootstrap.py2
-rw-r--r--src/bootstrap/download.rs9
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));