Skip to content

Commit

Permalink
allow precompiling whole workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Mar 19, 2024
1 parent c6f2b8b commit cab08da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ end
function precompile(ctx::Context, pkgs::Vector{PackageSpec}; internal_call::Bool=false,
strict::Bool=false, warn_loaded = true, already_instantiated = false, timing::Bool = false,
_from_loading::Bool=false, configs::Union{Base.Precompilation.Config,Vector{Base.Precompilation.Config}}=(``=>Base.CacheFlags()),
kwargs...)
workspace::Bool=false, kwargs...)
Context!(ctx; kwargs...)
if !already_instantiated
instantiate(ctx; allow_autoprecomp=false, kwargs...)
Expand All @@ -1155,7 +1155,7 @@ function precompile(ctx::Context, pkgs::Vector{PackageSpec}; internal_call::Bool

activate(dirname(ctx.env.project_file)) do
pkgs_name = String[pkg.name for pkg in pkgs]
return Base.Precompilation.precompilepkgs(pkgs_name; internal_call, strict, warn_loaded, timing, _from_loading, configs, io)
return Base.Precompilation.precompilepkgs(pkgs_name; internal_call, strict, warn_loaded, timing, _from_loading, configs, manifest=workspace, io)
end
end

Expand Down
5 changes: 4 additions & 1 deletion src/REPLMode/command_declarations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ PSA[:name => "instantiate",
:description => "downloads all the dependencies for the project",
:help => md"""
instantiate [-v|--verbose] [--workspace]
instantiate [-v|--verbose] [--workspace][-m|--manifest]
instantiate [-v|--verbose] [--workspace] [-m|--manifest]
instantiate [-v|--verbose] [--workspace] [-p|--project]
Download all the dependencies for the current project at the version given by the project's manifest.
Expand Down Expand Up @@ -391,6 +391,9 @@ PSA[:name => "precompile",
:arg_count => 0 => Inf,
:completions => get_complete_function(:complete_installed_packages),
:description => "precompile all the project dependencies",
:option_spec => [
PSA[:name => "workspace", :api => :workspace => true],
],
:help => md"""
precompile
precompile pkgs...
Expand Down

0 comments on commit cab08da

Please sign in to comment.