Skip to content

Commit

Permalink
call some Pkg functions with invokelatest for BugReporting (#51219)
Browse files Browse the repository at this point in the history
When Pkg is not in the sysimage, this causes world age errors.
  • Loading branch information
KristofferC authored Sep 7, 2023
1 parent aeae142 commit 1305f40
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions stdlib/InteractiveUtils/src/InteractiveUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ function report_bug(kind)
push!(empty!(LOAD_PATH), joinpath(tmp, "Project.toml"))
old_active_project = Base.ACTIVE_PROJECT[]
Base.ACTIVE_PROJECT[] = nothing
Pkg.add(Pkg.PackageSpec(BugReportingId.name, BugReportingId.uuid))
pkgspec = @invokelatest Pkg.PackageSpec(BugReportingId.name, BugReportingId.uuid)
@invokelatest Pkg.add(pkgspec)
BugReporting = Base.require(BugReportingId)
append!(empty!(LOAD_PATH), old_load_path)
Base.ACTIVE_PROJECT[] = old_active_project
Expand All @@ -361,7 +362,7 @@ function report_bug(kind)
else
BugReporting = Base.require(BugReportingId)
end
return Base.invokelatest(BugReporting.make_interactive_report, kind, ARGS)
return @invokelatest BugReporting.make_interactive_report(kind, ARGS)
end

end

0 comments on commit 1305f40

Please sign in to comment.