From 18deb1eb3e28d7467805ca0252dc8c753be5f197 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Tue, 8 Aug 2023 21:53:45 -0400 Subject: [PATCH] precompilation: capture stdout during code load precomp --- src/API.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/API.jl b/src/API.jl index eb83a9a2b0..a527bccd54 100644 --- a/src/API.jl +++ b/src/API.jl @@ -1449,8 +1449,10 @@ function precompile(ctx::Context, pkgs::Vector{PackageSpec}; internal_call::Bool # a functionally identical package cache (except for preferences, which may differ) t = @elapsed ret = maybe_cachefile_lock(io, print_lock, fancyprint, pkg, pkgspidlocked) do Logging.with_logger(Logging.NullLogger()) do - # capture stderr, send stdout to devnull, don't skip loaded modules - Base.compilecache(pkg, sourcepath, iob, devnull, false) + # For Pkg.precompile capture stderr, send stdout to devnull. + # For code load precompilation capture both. + # In both cases don't skip loaded modules. + Base.compilecache(pkg, sourcepath, iob, _from_loading ? iob : devnull, false) end end t_str = timing ? string(lpad(round(t * 1e3, digits = 1), 9), " ms") : ""