Skip to content

Commit 92440c6

Browse files
Fix lack of color in CI and don't warn about loaded packages in test Pkg.precompile. (#4316)
1 parent 61a8447 commit 92440c6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/API.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,10 +1172,12 @@ function precompile(ctx::Context, pkgs::Vector{PackageSpec}; internal_call::Bool
11721172
end
11731173

11741174
io = ctx.io
1175-
if io isa IOContext{IO}
1175+
if io isa IOContext{IO} && !isa(io.io, Base.PipeEndpoint)
11761176
# precompile does quite a bit of output and using the IOContext{IO} can cause
11771177
# some slowdowns, the important part here is to not specialize the whole
1178-
# precompile function on the io
1178+
# precompile function on the io.
1179+
# But don't unwrap the IOContext if it is a PipeEndpoint, as that would
1180+
# cause the output to lose color.
11791181
io = io.io
11801182
end
11811183

src/Operations.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2476,7 +2476,9 @@ function test(ctx::Context, pkgs::Vector{PackageSpec};
24762476

24772477
if should_autoprecompile()
24782478
cacheflags = Base.CacheFlags(parse(UInt8, read(`$(Base.julia_cmd()) $(flags) --eval 'show(ccall(:jl_cache_flags, UInt8, ()))'`, String)))
2479-
Pkg.precompile(; io=ctx.io, configs = flags => cacheflags)
2479+
# Don't warn about already loaded packages, since we are going to run tests in a new
2480+
# subprocess anyway.
2481+
Pkg.precompile(; io=ctx.io, warn_loaded = false, configs = flags => cacheflags)
24802482
end
24812483

24822484
printpkgstyle(ctx.io, :Testing, "Running tests...")

0 commit comments

Comments
 (0)