Skip to content

Commit

Permalink
precompilepkgs: simplify custom config printing if only one (#53805)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
IanButterworth authored and KristofferC committed Mar 27, 2024
1 parent 6f6cae8 commit a414011
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions base/precompilation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -551,11 +551,14 @@ function precompilepkgs(pkgs::Vector{String}=String[];
else
target = "project"
end
nconfig = length(configs)
if nconfig > 1
target *= " for $nconfig compilation configurations..."
else
nconfigs = length(configs)
if nconfigs == 1
if !isempty(only(configs)[1])
target *= " for configuration $(join(only(configs)[1], " "))"
end
target *= "..."
else
target *= " for $nconfigs compilation configurations..."
end
@debug "precompile: packages filtered"

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

_name = haskey(exts, pkg) ? string(exts[pkg], "", pkg.name) : pkg.name
name = is_direct_dep ? _name : string(color_string(_name, :light_black))
if !isempty(flags)
if nconfigs > 1 && !isempty(flags)
config_str = "$(join(flags, " "))"
name *= color_string(" $(config_str)", :light_black)
end
Expand Down

0 comments on commit a414011

Please sign in to comment.