Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1172,10 +1172,12 @@ function precompile(ctx::Context, pkgs::Vector{PackageSpec}; internal_call::Bool
end

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

Expand Down
4 changes: 3 additions & 1 deletion src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2476,7 +2476,9 @@ function test(ctx::Context, pkgs::Vector{PackageSpec};

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

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