Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion stdlib/InteractiveUtils/src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -830,5 +830,7 @@ macro activate(what)
options = map(options) do opt
Expr(:kw, opt, true)
end
return :(Base.require($__module__, $(QuoteNode(Component))).activate!(; $(options...)))
return :(let M = Base.require($__module__, $(QuoteNode(Component)))
@invokelatest M.activate!(; $(options...))
end)
end
14 changes: 14 additions & 0 deletions stdlib/InteractiveUtils/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1054,3 +1054,17 @@ end # module
using .OuterModule
@test_nowarn subtypes(Integer);
end

let code = """
using InteractiveUtils
@activate Compiler[:codegen, :reflection]
println("done compiling")
"""
orig_compiler = realpath(joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "Compiler"))
mktempdir() do dir
new_compiler = joinpath(dir, "Compiler")
cp(orig_compiler, new_compiler)
output = read(`$(Base.julia_cmd()) -g0 -O0 --startup-file=no --project=$(new_compiler) -e $code`, String)
@test occursin("done compiling", output)
end
end