Skip to content

Commit 5fc5556

Browse files
KristofferCjonas-schulzevchuravymaleadt
authored
move Pkg out of the sysimage (take 2) (#51189)
Co-authored-by: Jonas Schulze <[email protected]> Co-authored-by: Valentin Churavy <[email protected]> Co-authored-by: Tim Besard <[email protected]>
1 parent 6023370 commit 5fc5556

File tree

9 files changed

+30
-19
lines changed

9 files changed

+30
-19
lines changed

base/sysimg.jl

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

6969
# 5-depth packages
7070
:Downloads,
71-
72-
# 6-depth packages
73-
:Pkg,
7471
]
7572
# PackageCompiler can filter out stdlibs so it can be empty
7673
maxlen = maximum(textwidth.(string.(stdlibs)); init=0)

contrib/generate_precompile.jl

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,6 @@ if Artifacts !== nothing
153153
"""
154154
end
155155

156-
Pkg = get(Base.loaded_modules,
157-
Base.PkgId(Base.UUID("44cfe95a-1eb2-52ea-b672-e2afdf69b78f"), "Pkg"),
158-
nothing)
159-
160-
if Pkg !== nothing
161-
# TODO: Split Pkg precompile script into REPL and script part
162-
repl_script = Pkg.precompile_script * repl_script # do larger workloads first for better parallelization
163-
end
164-
165156
FileWatching = get(Base.loaded_modules,
166157
Base.PkgId(Base.UUID("7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"), "FileWatching"),
167158
nothing)
@@ -192,7 +183,6 @@ if InteractiveUtils !== nothing
192183
end
193184

194185
const JULIA_PROMPT = "julia> "
195-
const PKG_PROMPT = "pkg> "
196186
const SHELL_PROMPT = "shell> "
197187
const HELP_PROMPT = "help?> "
198188

@@ -366,7 +356,6 @@ generate_precompile_statements() = try # Make sure `ansi_enablecursor` is printe
366356
while !eof(output_copy)
367357
strbuf *= String(readavailable(output_copy))
368358
occursin(JULIA_PROMPT, strbuf) && break
369-
occursin(PKG_PROMPT, strbuf) && break
370359
occursin(SHELL_PROMPT, strbuf) && break
371360
occursin(HELP_PROMPT, strbuf) && break
372361
sleep(0.1)
@@ -455,7 +444,7 @@ generate_precompile_statements() = try # Make sure `ansi_enablecursor` is printe
455444
println()
456445
# Seems like a reasonable number right now, adjust as needed
457446
# comment out if debugging script
458-
n_succeeded > (have_repl ? 900 : 90) || @warn "Only $n_succeeded precompile statements"
447+
n_succeeded > (have_repl ? 650 : 90) || @warn "Only $n_succeeded precompile statements"
459448

460449
fetch(step1) == :ok || throw("Step 1 of collecting precompiles failed.")
461450
fetch(step2) == :ok || throw("Step 2 of collecting precompiles failed.")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
e640498e569782d09fbb26b9f2d861f3
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6cb6ac1baaa34f2dcd752d2cf0c8d3ca644d336497f16fcd982d95519757de348bb4ae50013680d894810092769b803c66eb11e23291f336d766d77eba5cd823

deps/checksums/Pkg-ff6d645cd8bd18f4d22f6b5a24ff0234cf193fa5.tar.gz/md5

Lines changed: 0 additions & 1 deletion
This file was deleted.

deps/checksums/Pkg-ff6d645cd8bd18f4d22f6b5a24ff0234cf193fa5.tar.gz/sha512

Lines changed: 0 additions & 1 deletion
This file was deleted.

pkgimage.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ $(eval $(call sysimg_builder,LibCURL,LibCURL_jll MozillaCACerts_jll))
125125
$(eval $(call sysimg_builder,Downloads,ArgTools FileWatching LibCURL NetworkOptions))
126126

127127
# 6-depth packages
128-
$(eval $(call sysimg_builder,Pkg,Dates LibGit2 Libdl Logging Printf Random SHA UUIDs)) # Markdown REPL
128+
$(eval $(call pkgimg_builder,Pkg,Dates LibGit2 Libdl Logging Printf Random SHA UUIDs)) # Markdown REPL
129129

130130
# 7-depth packages
131131
$(eval $(call pkgimg_builder,LazyArtifacts,Artifacts Pkg))

stdlib/Pkg.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
PKG_BRANCH = master
2-
PKG_SHA1 = ff6d645cd8bd18f4d22f6b5a24ff0234cf193fa5
2+
PKG_SHA1 = cf0019fbbaf3ab1e606d4e973c1908bbd899a9d5
33
PKG_GIT_URL := https://github.com/JuliaLang/Pkg.jl.git
44
PKG_TAR_URL = https://api.github.com/repos/JuliaLang/Pkg.jl/tarball/$1

stdlib/REPL/src/REPL.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,31 @@ function setup_interface(
11111111
edit_insert(s, '?')
11121112
end
11131113
end,
1114+
']' => function (s::MIState,o...)
1115+
if isempty(s) || position(LineEdit.buffer(s)) == 0
1116+
pkgid = Base.PkgId(Base.UUID("44cfe95a-1eb2-52ea-b672-e2afdf69b78f"), "Pkg")
1117+
if Base.locate_package(pkgid) !== nothing # Only try load Pkg if we can find it
1118+
Pkg = Base.require(pkgid)
1119+
# Pkg should have loaded its REPL mode by now, let's find it so we can transition to it.
1120+
pkg_mode = nothing
1121+
for mode in repl.interface.modes
1122+
if mode isa LineEdit.Prompt && mode.complete isa Pkg.REPLMode.PkgCompletionProvider
1123+
pkg_mode = mode
1124+
break
1125+
end
1126+
end
1127+
# TODO: Cache the `pkg_mode`?
1128+
if pkg_mode !== nothing
1129+
buf = copy(LineEdit.buffer(s))
1130+
transition(s, pkg_mode) do
1131+
LineEdit.state(s, pkg_mode).input_buffer = buf
1132+
end
1133+
return
1134+
end
1135+
end
1136+
end
1137+
edit_insert(s, ']')
1138+
end,
11141139

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

0 commit comments

Comments
 (0)