From d801e4545f548ab9061a018bf19db1944c711607 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Mon, 15 Jul 2024 16:49:41 +0200 Subject: [PATCH] fix artifact printing quiet rule (#3951) --- src/Operations.jl | 3 ++- src/Pkg.jl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Operations.jl b/src/Operations.jl index 254f4dc322..fb3a0ce472 100644 --- a/src/Operations.jl +++ b/src/Operations.jl @@ -14,6 +14,7 @@ using Base.BinaryPlatforms import ...Pkg import ...Pkg: pkg_server, Registry, pathrepr, can_fancyprint, printpkgstyle, stderr_f, OFFLINE_MODE import ...Pkg: UPDATED_REGISTRY_THIS_SESSION, RESPECT_SYSIMAGE_VERSIONS, should_autoprecompile +import ...Pkg: usable_io ######### # Utils # @@ -830,7 +831,7 @@ function download_artifacts(env::EnvCache; # For each Artifacts.toml, install each artifact we've collected from it for name in keys(artifacts) ensure_artifact_installed(name, artifacts[name], artifacts_toml; - verbose, quiet_download=!(io isa Base.TTY), io=io) + verbose, quiet_download=!(usable_io(io)), io=io) end write_env_usage(artifacts_toml, "artifact_usage.toml") end diff --git a/src/Pkg.jl b/src/Pkg.jl index 8649bc03d5..02430efc57 100644 --- a/src/Pkg.jl +++ b/src/Pkg.jl @@ -56,7 +56,8 @@ stderr_f() = something(DEFAULT_IO[], unstableio(stderr)) stdout_f() = something(DEFAULT_IO[], unstableio(stdout)) const PREV_ENV_PATH = Ref{String}("") -can_fancyprint(io::IO) = ((io isa Base.TTY) || (io isa IOContext{IO} && io.io isa Base.TTY)) && (get(ENV, "CI", nothing) != "true") +usable_io(io) = (io isa Base.TTY) || (io isa IOContext{IO} && io.io isa Base.TTY) +can_fancyprint(io::IO) = (usable_io(io)) && (get(ENV, "CI", nothing) != "true") should_autoprecompile() = Base.JLOptions().use_compiled_modules == 1 && Base.get_bool_env("JULIA_PKG_PRECOMPILE_AUTO", true) include("utils.jl")