Skip to content

Commit

Permalink
add kwarg to control fancy printing
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Mar 10, 2024
1 parent 19b1ce4 commit 59549eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions base/precompilation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ function precompilepkgs(pkgs::Vector{String}=String[];
_from_loading::Bool=false,
configs::Union{Config,Vector{Config}}=(``=>Base.CacheFlags()),
io::IO=stderr,
# asking for timing disables fancy mode, as timing is shown in non-fancy mode
fancyprint::Bool = can_fancyprint(io) && !timing,
flags_cacheflags=nothing)

if flags_cacheflags !== nothing
Expand All @@ -374,9 +376,6 @@ function precompilepkgs(pkgs::Vector{String}=String[];
num_tasks = parse(Int, get(ENV, "JULIA_NUM_PRECOMPILE_TASKS", string(default_num_tasks)))
parallel_limiter = Base.Semaphore(num_tasks)

# asking for timing disables fancy mode, as timing is shown in non-fancy mode
fancyprint = can_fancyprint(io) && !timing

if _from_loading && !Sys.isinteractive() && Base.get_bool_env("JULIA_TESTS", false)
# suppress passive loading printing in julia test suite. `JULIA_TESTS` is set in Base.runtests
io = devnull
Expand Down
2 changes: 1 addition & 1 deletion contrib/generate_precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ generate_precompile_statements() = try # Make sure `ansi_enablecursor` is printe
s = """
pushfirst!(DEPOT_PATH, $(repr(joinpath(prec_path,"depot"))));
Base.PRECOMPILE_TRACE_COMPILE[] = $(repr(tmp_prec));
Base.Precompilation.precompilepkgs();
Base.Precompilation.precompilepkgs(;fancyprint=true);
$precompile_script
"""
p = run(pipeline(addenv(`$(julia_exepath()) -O0 --trace-compile=$tmp_proc --sysimage $sysimg
Expand Down

0 comments on commit 59549eb

Please sign in to comment.