Skip to content

Commit fec672d

Browse files
authored
fix some invalidations when loading CUDA (#37744)
1 parent f6d1032 commit fec672d

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

base/methodshow.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ function updated_methodloc(m::Method)::Tuple{String, Int32}
139139
file, line = m.file, m.line
140140
if methodloc_callback[] !== nothing
141141
try
142-
file, line = invokelatest(methodloc_callback[], m)
142+
file, line = invokelatest(methodloc_callback[], m)::Tuple{Symbol, Int32}
143143
catch
144144
end
145145
end

stdlib/LibGit2/src/callbacks.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ function credentials_callback(libgit2credptr::Ptr{Ptr{Cvoid}}, url_ptr::Cstring,
275275
p.url = unsafe_string(url_ptr)
276276
m = match(URL_REGEX, p.url)
277277

278-
p.scheme = something(m[:scheme], "")
279-
p.username = something(m[:user], "")
278+
p.scheme = something(m[:scheme], SubString(""))
279+
p.username = something(m[:user], SubString(""))
280280
p.host = m[:host]
281281

282282
# When an explicit credential is supplied we will make sure to use the given
@@ -287,7 +287,8 @@ function credentials_callback(libgit2credptr::Ptr{Ptr{Cvoid}}, url_ptr::Cstring,
287287
cred = p.explicit
288288

289289
# Copy explicit credentials to avoid mutating approved credentials.
290-
p.credential = deepcopy(cred)
290+
# invalidation fix from cred being non-inferrable
291+
p.credential = Base.invokelatest(deepcopy, cred)
291292

292293
if isa(cred, SSHCredential)
293294
allowed_types &= Cuint(Consts.CREDTYPE_SSH_KEY)
@@ -301,7 +302,8 @@ function credentials_callback(libgit2credptr::Ptr{Ptr{Cvoid}}, url_ptr::Cstring,
301302

302303
# Perform a deepcopy as we do not want to mutate approved cached credentials
303304
if haskey(p.cache, cred_id)
304-
p.credential = deepcopy(p.cache[cred_id])
305+
# invalidation fix from p.cache[cred_id] being non-inferrable
306+
p.credential = Base.invokelatest(deepcopy, p.cache[cred_id])
305307
end
306308
end
307309

stdlib/REPL/src/LineEdit.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ mutable struct PromptState <: ModeState
9797
# indentation of lines which do not include the prompt
9898
# if negative, the width of the prompt is used
9999
indent::Int
100-
refresh_lock::Threads.AbstractLock
100+
refresh_lock::Threads.SpinLock
101101
# this would better be Threads.Atomic{Float64}, but not supported on some platforms
102102
beeping::Float64
103103
# this option is to detect when code is pasted in non-"bracketed paste mode" :

test/show.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ else
757757
end
758758

759759
# Method location correction (Revise integration)
760-
dummyloc(m::Method) = :nofile, 123456789
760+
dummyloc(m::Method) = :nofile, Int32(123456789)
761761
Base.methodloc_callback[] = dummyloc
762762
let repr = sprint(show, "text/plain", methods(Base.inbase))
763763
@test occursin("nofile:123456789", repr)

0 commit comments

Comments
 (0)