Skip to content

Commit 6f14833

Browse files
reduce to fix
1 parent 1f5c625 commit 6f14833

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/API.jl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,19 +1172,17 @@ 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

11821184
activate(dirname(ctx.env.project_file)) do
11831185
pkgs_name = String[pkg.name for pkg in pkgs]
1184-
@show io typeof(io)
1185-
printstyled(io, "io with color\n", color=:green, bold=true)
1186-
@show ctx.io typeof(ctx.io)
1187-
printstyled(ctx.io, "ctx.io with color\n", color=:green, bold=true)
11881186
return Base.Precompilation.precompilepkgs(pkgs_name; internal_call, strict, warn_loaded, timing, _from_loading, configs, manifest=workspace, io)
11891187
end
11901188
end

0 commit comments

Comments
 (0)