Skip to content

Commit

Permalink
precompile: update kwargs (JuliaLang#3838)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth authored Mar 12, 2024
1 parent 4d73d60 commit 6859d68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,8 @@ 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, flags_cacheflags::Pair{Cmd, Base.CacheFlags}=(``=>Base.CacheFlags()), kwargs...)
_from_loading::Bool=false, configs::Union{Base.Precompilation.Config,Vector{Base.Precompilation.Config}}=(``=>Base.CacheFlags()),
kwargs...)
Context!(ctx; kwargs...)
if !already_instantiated
instantiate(ctx; allow_autoprecomp=false, kwargs...)
Expand All @@ -1154,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, flags_cacheflags, io)
return Base.Precompilation.precompilepkgs(pkgs_name; internal_call, strict, warn_loaded, timing, _from_loading, configs, io)
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2046,7 +2046,7 @@ function test(ctx::Context, pkgs::Vector{PackageSpec};
if should_autoprecompile()
cacheflags = Base.CacheFlags(parse(UInt8, read(`$(Base.julia_cmd()) $(flags) --eval 'show(ccall(:jl_cache_flags, UInt8, ()))'`, String)))
Pkg.activate(sandbox_ctx.env.project_file; #=io=devnull=#) do
Pkg.precompile(sandbox_ctx; io=sandbox_ctx.io, flags_cacheflags = flags => cacheflags)
Pkg.precompile(sandbox_ctx; io=sandbox_ctx.io, configs = flags => cacheflags)
end
end

Expand Down

0 comments on commit 6859d68

Please sign in to comment.