Skip to content

Commit

Permalink
do not precompile full env on using callback from REPL (#3876)
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Jul 5, 2024
1 parent 91e7df9 commit 48c326f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ext/REPLExt/REPLExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ function try_prompt_pkg_add(pkgs::Vector{Symbol})
resp = strip(resp)
lower_resp = lowercase(resp)
if lower_resp in ["y", "yes"]
API.add(string.(available_pkgs))
API.add(string.(available_pkgs); allow_autoprecomp=false)
elseif lower_resp in ["o"]
editable_envs = filter(v -> v != "@stdlib", LOAD_PATH)
option_list = String[]
Expand Down Expand Up @@ -288,7 +288,7 @@ function try_prompt_pkg_add(pkgs::Vector{Symbol})
end
choice == -1 && return false
API.activate(shown_envs[choice]) do
API.add(string.(available_pkgs))
API.add(string.(available_pkgs); allow_autoprecomp=false)
end
elseif (lower_resp in ["n"])
return false
Expand Down
4 changes: 2 additions & 2 deletions src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ function develop(ctx::Context, pkgs::Vector{PackageSpec}; shared::Bool=true,
end

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

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

Operations.add(ctx, pkgs, new_git; preserve, platform, target)
Operations.add(ctx, pkgs, new_git; allow_autoprecomp, preserve, platform, target)
return
end

Expand Down
4 changes: 2 additions & 2 deletions src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,7 @@ function _resolve(io::IO, env::EnvCache, registries::Vector{Registry.RegistryIns
end

function add(ctx::Context, pkgs::Vector{PackageSpec}, new_git=Set{UUID}();
preserve::PreserveLevel=default_preserve(), platform::AbstractPlatform=HostPlatform(),
allow_autoprecomp::Bool=true, preserve::PreserveLevel=default_preserve(), platform::AbstractPlatform=HostPlatform(),
target::Symbol=:deps)
assert_can_add(ctx, pkgs)
# load manifest data
Expand Down Expand Up @@ -1532,7 +1532,7 @@ function add(ctx::Context, pkgs::Vector{PackageSpec}, new_git=Set{UUID}();
write_env(ctx.env) # write env before building
show_update(ctx.env, ctx.registries; io=ctx.io)
build_versions(ctx, union(new_apply, new_git))
Pkg._auto_precompile(ctx)
allow_autoprecomp && Pkg._auto_precompile(ctx)
else
record_project_hash(ctx.env)
write_env(ctx.env)
Expand Down

0 comments on commit 48c326f

Please sign in to comment.