Skip to content

Commit a08bf4f

Browse files
author
KristofferC
committed
WIP: move Pkg out of the sysimage
1 parent f24178b commit a08bf4f

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

base/sysimg.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ let
7373

7474
# 5-depth packages
7575
:Downloads,
76-
77-
# 6-depth packages
78-
:Pkg,
7976
]
8077
# PackageCompiler can filter out stdlibs so it can be empty
8178
maxlen = maximum(textwidth.(string.(stdlibs)); init=0)

contrib/cache_stdlibs.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ stdlibs = [
2626
# 4-depth packages
2727
:SparseArrays,
2828

29+
# 6-depth packages
30+
:Pkg,
31+
2932
# 7-depth packages
3033
:LLD_jll,
3134
:SuiteSparse,

stdlib/REPL/src/REPL.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,31 @@ function setup_interface(
10951095
edit_insert(s, '?')
10961096
end
10971097
end,
1098+
']' => function (s::MIState,o...)
1099+
if isempty(s) || position(LineEdit.buffer(s)) == 0
1100+
pkgid = Base.PkgId(Base.UUID("44cfe95a-1eb2-52ea-b672-e2afdf69b78f"), "Pkg")
1101+
if Base.locate_package(pkgid) !== nothing # Only try load Pkg if we can find it
1102+
Pkg = Base.require(Base.PkgId(Base.UUID("44cfe95a-1eb2-52ea-b672-e2afdf69b78f"), "Pkg"))
1103+
# Pkg should have loaded its REPL mode by now, let's find it so we can transition to it.
1104+
pkg_mode = nothing
1105+
for mode in repl.interface.modes
1106+
if mode isa LineEdit.Prompt && mode.complete isa Pkg.REPLMode.PkgCompletionProvider
1107+
pkg_mode = mode
1108+
break
1109+
end
1110+
end
1111+
# TODO: Cache the `pkg_mode`?
1112+
if pkg_mode !== nothing
1113+
buf = copy(LineEdit.buffer(s))
1114+
transition(s, pkg_mode) do
1115+
LineEdit.state(s, pkg_mode).input_buffer = buf
1116+
end
1117+
return
1118+
end
1119+
end
1120+
end
1121+
edit_insert(s, ']')
1122+
end,
10981123

10991124
# Bracketed Paste Mode
11001125
"\e[200~" => (s::MIState,o...)->begin

test/precompile.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,8 @@ precompile_test_harness(false) do dir
397397
[:ArgTools, :Artifacts, :Base64, :CompilerSupportLibraries_jll, :CRC32c, :Dates,
398398
:Distributed, :Downloads, :FileWatching, :Future, :InteractiveUtils, :libblastrampoline_jll,
399399
:LibCURL, :LibCURL_jll, :LibGit2, :Libdl, :LinearAlgebra,
400-
:Logging, :Markdown, :Mmap, :MozillaCACerts_jll, :NetworkOptions, :OpenBLAS_jll, :Pkg, :Printf,
401-
:Profile, :p7zip_jll, :REPL, :Random, :SHA, :Serialization, :SharedArrays, :Sockets,
400+
:Logging, :Markdown, :Mmap, :MozillaCACerts_jll, :NetworkOptions, :OpenBLAS_jll, :Printf,
401+
:Profile, :REPL, :Random, :SHA, :Serialization, :SharedArrays, :Sockets,
402402
:TOML, :Tar, :Test, :UUIDs, :Unicode,
403403
:nghttp2_jll]
404404
),

0 commit comments

Comments
 (0)