Skip to content

Commit a414011

Browse files
IanButterworthKristofferC
authored andcommitted
precompilepkgs: simplify custom config printing if only one (#53805)
Currently it's a bit excessive in the `Pkg.test` precompile job ![Screenshot 2024-03-20 at 12 04 03 PM](https://github.com/JuliaLang/julia/assets/1694067/7600f0b8-6e4b-43b2-9c42-c8d5d16b8d57) This PR ``` Precompiling project for configuration --code-coverage=none --color=yes --check-bounds=yes --warn-overwrite=yes --depwarn=yes --inline=yes --startup-file=no --track-allocation=none... 354.9 ms ✓ RFFT 1 dependency successfully precompiled in 1 seconds. 38 already precompiled. ``` Pkg could also just set the non-default flags to minimize the list. (cherry picked from commit 9291845)
1 parent 6f6cae8 commit a414011

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

base/precompilation.jl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -551,11 +551,14 @@ function precompilepkgs(pkgs::Vector{String}=String[];
551551
else
552552
target = "project"
553553
end
554-
nconfig = length(configs)
555-
if nconfig > 1
556-
target *= " for $nconfig compilation configurations..."
557-
else
554+
nconfigs = length(configs)
555+
if nconfigs == 1
556+
if !isempty(only(configs)[1])
557+
target *= " for configuration $(join(only(configs)[1], " "))"
558+
end
558559
target *= "..."
560+
else
561+
target *= " for $nconfigs compilation configurations..."
559562
end
560563
@debug "precompile: packages filtered"
561564

@@ -677,7 +680,7 @@ function precompilepkgs(pkgs::Vector{String}=String[];
677680
loaded = warn_loaded && haskey(Base.loaded_modules, dep)
678681
_name = haskey(exts, dep) ? string(exts[dep], "", dep.name) : dep.name
679682
name = dep in direct_deps ? _name : string(color_string(_name, :light_black))
680-
if !isempty(config[1])
683+
if nconfigs > 1 && !isempty(config[1])
681684
config_str = "$(join(config[1], " "))"
682685
name *= color_string(" $(config_str)", :light_black)
683686
end
@@ -769,7 +772,7 @@ function precompilepkgs(pkgs::Vector{String}=String[];
769772

770773
_name = haskey(exts, pkg) ? string(exts[pkg], "", pkg.name) : pkg.name
771774
name = is_direct_dep ? _name : string(color_string(_name, :light_black))
772-
if !isempty(flags)
775+
if nconfigs > 1 && !isempty(flags)
773776
config_str = "$(join(flags, " "))"
774777
name *= color_string(" $(config_str)", :light_black)
775778
end

0 commit comments

Comments
 (0)