Skip to content

Commit f9e56f6

Browse files
authored
Hide IRShow include from Revise (JuliaLang#56756)
Revise in theory wants to re-evaluate this include, but it fails at doing so, because the include call no longer works after bootstrap. It happens to work right now on master, because the lowering of `Compiler.include` happens to hide the include call from Revise, but that's a Revise bug I'm about to fix. Address this by moving the include call into the package and using an absolute include if necessary.
1 parent b6b1192 commit f9e56f6

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/Compiler.jl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,26 @@ include("bootstrap.jl")
181181
include("reflection_interface.jl")
182182
include("opaque_closure.jl")
183183

184+
macro __SOURCE_FILE__()
185+
__source__.file === nothing && return nothing
186+
return __source__.file::Symbol
187+
end
188+
184189
module IRShow end
190+
function load_irshow!()
191+
if isdefined(Base, :end_base_include)
192+
# This code path is exclusively for Revise, which may want to re-run this
193+
# after bootstrap.
194+
include(IRShow, Base.joinpath(Base.dirname(Base.String(@__SOURCE_FILE__)), "ssair/show.jl"))
195+
else
196+
include(IRShow, "ssair/show.jl")
197+
end
198+
end
185199
if !isdefined(Base, :end_base_include)
186200
# During bootstrap, skip including this file and defer it to base/show.jl to include later
187201
else
188202
# When this module is loaded as the standard library, include this file as usual
189-
include(IRShow, "ssair/show.jl")
203+
load_irshow!()
190204
end
191205

192206
end # baremodule Compiler

0 commit comments

Comments
 (0)