-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
_precompilepkgs
: interactive progress display: fix unintended capture
#57932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
KristofferC
merged 1 commit into
JuliaLang:master
from
nsajko:Base__precompilation__precompilepkgs__type_stability_fix_for_showing_progress_str
Mar 31, 2025
Merged
_precompilepkgs
: interactive progress display: fix unintended capture
#57932
KristofferC
merged 1 commit into
JuliaLang:master
from
nsajko:Base__precompilation__precompilepkgs__type_stability_fix_for_showing_progress_str
Mar 31, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some of the eliminated invalidations: {
"type": "Tuple{Type{Int64}, Integer}",
"tree": {
"method_instance": {
"method": "nextind(s::AbstractString, i::Integer) @ Base strings/basic.jl:565",
"method_instance": "MethodInstance for nextind(::Base.AnnotatedString{String}, ::Integer)"
},
"children": [
{
"method_instance": {
"method": "iterate(itr::Base.RegexMatchIterator, ::Any) @ Base regex.jl:736",
"method_instance": "MethodInstance for iterate(::Base.RegexMatchIterator{Base.AnnotatedString{String}}, ::Tuple{Any, Any})"
},
"children": [
{
"method_instance": {
"method": "iterate(I::Base.ANSIIterator, ::Any) @ Base show.jl:89",
"method_instance": "MethodInstance for iterate(::Base.ANSIIterator{Base.AnnotatedString{String}}, ::Any)"
},
"children": [
{
"method_instance": {
"method": "_truncate_at_width_or_chars(ignore_ANSI::Bool, str::AbstractString, width::Int64, rpad::Bool, chars, truncmark) @ Base show.jl:97",
"method_instance": "MethodInstance for Base._truncate_at_width_or_chars(::Bool, ::AbstractString, ::Int64, ::Bool, ::String, ::String)"
},
"children": [
]
}
]
}
]
}
]
}
} {
"method_instance": {
"method": "repeat(c::AbstractChar, r::Integer) @ Base strings/string.jl:573",
"method_instance": "MethodInstance for repeat(::Char, ::Integer)"
},
"children": [
{
"method_instance": {
"method": "_truncate_at_width_or_chars(ignore_ANSI::Bool, str::AbstractString, width::Int64, rpad::Bool, chars, truncmark) @ Base show.jl:97",
"method_instance": "MethodInstance for Base._truncate_at_width_or_chars(::Bool, ::AbstractString, ::Int64, ::Bool, ::String, ::String)"
},
"children": [
{
"method_instance": {
"method": "_truncate_at_width_or_chars(ignore_ANSI::Bool, str::AbstractString, width::Int64) @ Base show.jl:97",
"method_instance": "MethodInstance for Base._truncate_at_width_or_chars(::Bool, ::AbstractString, ::Int64)"
},
"children": [
{
"method_instance": {
"method": "(::Base.Precompilation.var\"#_precompilepkgs##39#_precompilepkgs##40\")(iostr) @ Base.Precompilation precompilation.jl:829",
"method_instance": "MethodInstance for (::Base.Precompilation.var\"#_precompilepkgs##39#_precompilepkgs##40\"{Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Int64, Base.Precompilation.MiniProgressBar, Vector{String}, Bool, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Set{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, String, Base.Event, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Vector{Base.PkgId}, Base.Precompilation.var\"#describe_pkg#_precompilepkgs##1\"{Dict{Base.PkgId, Base.PkgId}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}, Int64}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}})(::IOBuffer)"
},
"children": [
]
},
{
"method_instance": {
"method": "(::Base.Precompilation.var\"#_precompilepkgs##39#_precompilepkgs##40\")(iostr) @ Base.Precompilation precompilation.jl:829",
"method_instance": "MethodInstance for (::Base.Precompilation.var\"#_precompilepkgs##39#_precompilepkgs##40\"{Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Int64, Base.Precompilation.MiniProgressBar, Vector{String}, Bool, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Set{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, String, Base.Event, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Vector{Base.PkgId}, Base.Precompilation.var\"#describe_pkg#_precompilepkgs##1\"{Dict{Base.PkgId, Base.PkgId}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}, Int64}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}})(::IOBuffer)"
},
"children": [
{
"method_instance": {
"method": "var\"#sprint#447\"(context, sizehint::Integer, ::typeof(sprint), f::Function, args...) @ Base strings/io.jl:106",
"method_instance": "MethodInstance for Base.var\"#sprint#447\"(::Nothing, ::Int64, ::typeof(sprint), ::Base.Precompilation.var\"#_precompilepkgs##39#_precompilepkgs##40\"{Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Int64, Base.Precompilation.MiniProgressBar, Vector{String}, Bool, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Set{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, String, Base.Event, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Vector{Base.PkgId}, Base.Precompilation.var\"#describe_pkg#_precompilepkgs##1\"{Dict{Base.PkgId, Base.PkgId}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}, Int64}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}})"
},
"children": [
{
"method_instance": {
"method": "sprint(f::Function, args...; context, sizehint) @ Base strings/io.jl:106",
"method_instance": "MethodInstance for sprint(::Base.Precompilation.var\"#_precompilepkgs##39#_precompilepkgs##40\"{Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Int64, Base.Precompilation.MiniProgressBar, Vector{String}, Bool, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Set{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, String, Base.Event, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Vector{Base.PkgId}, Base.Precompilation.var\"#describe_pkg#_precompilepkgs##1\"{Dict{Base.PkgId, Base.PkgId}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}, Int64}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}})"
},
"children": [
{
"method_instance": {
"method": "(::Base.Precompilation.var\"#_precompilepkgs##37#_precompilepkgs##38\")() @ Base.Precompilation precompilation.jl:821",
"method_instance": "MethodInstance for (::Base.Precompilation.var\"#_precompilepkgs##37#_precompilepkgs##38\"{Int64, Base.Precompilation.MiniProgressBar, Vector{String}, Bool, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Set{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, String, String, Base.Precompilation.var\"#ansi_moveup#_precompilepkgs##21\", Base.Event, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Vector{Base.PkgId}, Base.Precompilation.var\"#describe_pkg#_precompilepkgs##1\"{Dict{Base.PkgId, Base.PkgId}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}, Int64}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}})()"
},
"children": [
]
},
{
"method_instance": {
"method": "(::Base.Precompilation.var\"#_precompilepkgs##37#_precompilepkgs##38\")() @ Base.Precompilation precompilation.jl:821",
"method_instance": "MethodInstance for (::Base.Precompilation.var\"#_precompilepkgs##37#_precompilepkgs##38\"{Int64, Base.Precompilation.MiniProgressBar, Vector{String}, Bool, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Set{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, String, String, Base.Precompilation.var\"#ansi_moveup#_precompilepkgs##21\", Base.Event, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Vector{Base.PkgId}, Base.Precompilation.var\"#describe_pkg#_precompilepkgs##1\"{Dict{Base.PkgId, Base.PkgId}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}, Int64}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}})()"
},
"children": [
]
},
{
"method_instance": {
"method": "(::Base.Precompilation.var\"#_precompilepkgs##37#_precompilepkgs##38\")() @ Base.Precompilation precompilation.jl:821",
"method_instance": "MethodInstance for (::Base.Precompilation.var\"#_precompilepkgs##37#_precompilepkgs##38\"{Int64, Base.Precompilation.MiniProgressBar, Vector{String}, Bool, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Set{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, String, String, Base.Precompilation.var\"#ansi_moveup#_precompilepkgs##21\", Base.Event, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Vector{Base.PkgId}, Base.Precompilation.var\"#describe_pkg#_precompilepkgs##1\"{Dict{Base.PkgId, Base.PkgId}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}, Int64}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}})()"
},
"children": [
{
"method_instance": {
"method": "lock(f, l::Base.AbstractLock) @ Base lock.jl:332",
"method_instance": "MethodInstance for lock(::Base.Precompilation.var\"#_precompilepkgs##37#_precompilepkgs##38\"{Int64, Base.Precompilation.MiniProgressBar, Vector{String}, Bool, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Set{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, String, String, Base.Precompilation.var\"#ansi_moveup#_precompilepkgs##21\", Base.Event, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Vector{Base.PkgId}, Base.Precompilation.var\"#describe_pkg#_precompilepkgs##1\"{Dict{Base.PkgId, Base.PkgId}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}, Int64}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}}, ::ReentrantLock)"
},
"children": [
]
},
{
"method_instance": {
"method": "lock(f, l::Base.AbstractLock) @ Base lock.jl:332",
"method_instance": "MethodInstance for lock(::Base.Precompilation.var\"#_precompilepkgs##37#_precompilepkgs##38\"{Int64, Base.Precompilation.MiniProgressBar, Vector{String}, Bool, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Set{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, String, String, Base.Precompilation.var\"#ansi_moveup#_precompilepkgs##21\", Base.Event, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Vector{Base.PkgId}, Base.Precompilation.var\"#describe_pkg#_precompilepkgs##1\"{Dict{Base.PkgId, Base.PkgId}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}, Int64}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}}, ::ReentrantLock)"
},
"children": [
]
},
{
"method_instance": {
"method": "lock(f, l::Base.AbstractLock) @ Base lock.jl:332",
"method_instance": "MethodInstance for lock(::Base.Precompilation.var\"#_precompilepkgs##37#_precompilepkgs##38\"{Int64, Base.Precompilation.MiniProgressBar, Vector{String}, Bool, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Set{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, String, String, Base.Precompilation.var\"#ansi_moveup#_precompilepkgs##21\", Base.Event, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Vector{Base.PkgId}, Base.Precompilation.var\"#describe_pkg#_precompilepkgs##1\"{Dict{Base.PkgId, Base.PkgId}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}, Int64}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}}, ::ReentrantLock)"
},
"children": [
{
"method_instance": {
"method": "(::Base.Precompilation.var\"#_precompilepkgs##33#_precompilepkgs##34\")() @ Base.Precompilation precompilation.jl:798",
"method_instance": "MethodInstance for (::Base.Precompilation.var\"#_precompilepkgs##33#_precompilepkgs##34\"{Bool, Vector{Pair{Cmd, Base.CacheFlags}}, Bool, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Set{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, String, String, String, String, Base.Precompilation.var\"#ansi_moveup#_precompilepkgs##21\", Base.Event, Base.Event, ReentrantLock, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Vector{Base.PkgId}, Base.Precompilation.var\"#describe_pkg#_precompilepkgs##1\"{Dict{Base.PkgId, Base.PkgId}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}, Int64}, Dict{Base.PkgId, Vector{Base.PkgId}}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}})()"
},
"children": [
]
},
{
"method_instance": {
"method": "(::Base.Precompilation.var\"#_precompilepkgs##33#_precompilepkgs##34\")() @ Base.Precompilation precompilation.jl:798",
"method_instance": "MethodInstance for (::Base.Precompilation.var\"#_precompilepkgs##33#_precompilepkgs##34\"{Bool, Vector{Pair{Cmd, Base.CacheFlags}}, Bool, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Set{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, String, String, String, String, Base.Precompilation.var\"#ansi_moveup#_precompilepkgs##21\", Base.Event, Base.Event, ReentrantLock, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Vector{Base.PkgId}, Base.Precompilation.var\"#describe_pkg#_precompilepkgs##1\"{Dict{Base.PkgId, Base.PkgId}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}, Int64}, Dict{Base.PkgId, Vector{Base.PkgId}}, Base.Precompilation.var\"#color_string#_precompilepkgs##0\"{Bool}})()"
},
"children": [
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
} |
Easier to rename it? |
6979a09
to
e45142a
Compare
I'm going to squash into one commit, because that seems to be required for autobackport. |
The variable `str` also exists in one of the enclosing closures. Create a new variable, as was surely intended, instead of capturing and mutating `str`. Improves the sysimage's resistance to invalidation.
3e127da
to
0e5f281
Compare
51 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The variable
str
also exists in one of the enclosing closures. Use a new variable, as was surely intended, instead of capturing and mutating thestr
.Improves the sysimage's resistance to invalidation.