Skip to content

Commit 48c326f

Browse files
committed
do not precompile full env on using callback from REPL (#3876)
1 parent 91e7df9 commit 48c326f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

ext/REPLExt/REPLExt.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ function try_prompt_pkg_add(pkgs::Vector{Symbol})
250250
resp = strip(resp)
251251
lower_resp = lowercase(resp)
252252
if lower_resp in ["y", "yes"]
253-
API.add(string.(available_pkgs))
253+
API.add(string.(available_pkgs); allow_autoprecomp=false)
254254
elseif lower_resp in ["o"]
255255
editable_envs = filter(v -> v != "@stdlib", LOAD_PATH)
256256
option_list = String[]
@@ -288,7 +288,7 @@ function try_prompt_pkg_add(pkgs::Vector{Symbol})
288288
end
289289
choice == -1 && return false
290290
API.activate(shown_envs[choice]) do
291-
API.add(string.(available_pkgs))
291+
API.add(string.(available_pkgs); allow_autoprecomp=false)
292292
end
293293
elseif (lower_resp in ["n"])
294294
return false

src/API.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ function develop(ctx::Context, pkgs::Vector{PackageSpec}; shared::Bool=true,
254254
end
255255

256256
function add(ctx::Context, pkgs::Vector{PackageSpec}; preserve::PreserveLevel=Operations.default_preserve(),
257-
platform::AbstractPlatform=HostPlatform(), target::Symbol=:deps, kwargs...)
257+
platform::AbstractPlatform=HostPlatform(), target::Symbol=:deps, allow_autoprecomp::Bool=true, kwargs...)
258258
require_not_empty(pkgs, :add)
259259
Context!(ctx; kwargs...)
260260

@@ -303,7 +303,7 @@ function add(ctx::Context, pkgs::Vector{PackageSpec}; preserve::PreserveLevel=Op
303303
update_source_if_set(ctx.env.project, pkg)
304304
end
305305

306-
Operations.add(ctx, pkgs, new_git; preserve, platform, target)
306+
Operations.add(ctx, pkgs, new_git; allow_autoprecomp, preserve, platform, target)
307307
return
308308
end
309309

src/Operations.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1480,7 +1480,7 @@ function _resolve(io::IO, env::EnvCache, registries::Vector{Registry.RegistryIns
14801480
end
14811481

14821482
function add(ctx::Context, pkgs::Vector{PackageSpec}, new_git=Set{UUID}();
1483-
preserve::PreserveLevel=default_preserve(), platform::AbstractPlatform=HostPlatform(),
1483+
allow_autoprecomp::Bool=true, preserve::PreserveLevel=default_preserve(), platform::AbstractPlatform=HostPlatform(),
14841484
target::Symbol=:deps)
14851485
assert_can_add(ctx, pkgs)
14861486
# load manifest data
@@ -1532,7 +1532,7 @@ function add(ctx::Context, pkgs::Vector{PackageSpec}, new_git=Set{UUID}();
15321532
write_env(ctx.env) # write env before building
15331533
show_update(ctx.env, ctx.registries; io=ctx.io)
15341534
build_versions(ctx, union(new_apply, new_git))
1535-
Pkg._auto_precompile(ctx)
1535+
allow_autoprecomp && Pkg._auto_precompile(ctx)
15361536
else
15371537
record_project_hash(ctx.env)
15381538
write_env(ctx.env)

0 commit comments

Comments
 (0)