Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.11] 1.11 Backports #3846

Merged
merged 2 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 2 additions & 3 deletions src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1753,7 +1753,6 @@ function gen_subprocess_flags(source_path::String; coverage, julia_args)
--inline=$(Bool(Base.JLOptions().can_inline) ? "yes" : "no")
--startup-file=$(Base.JLOptions().startupfile == 1 ? "yes" : "no")
--track-allocation=$(("none", "user", "all")[Base.JLOptions().malloc_log + 1])
--threads=$(get_threads_spec())
$(julia_args)
```
end
Expand Down Expand Up @@ -2047,14 +2046,14 @@ 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

printpkgstyle(ctx.io, :Testing, "Running tests...")
flush(ctx.io)
code = gen_test_code(source_path; test_args)
cmd = `$(Base.julia_cmd()) $(flags) --eval $code`
cmd = `$(Base.julia_cmd()) $(flags) --threads=$(get_threads_spec()) --eval $code`
p, interrupted = subprocess_handler(cmd, ctx, sandbox_ctx, "Tests interrupted. Exiting the test process")
if success(p)
printpkgstyle(ctx.io, :Testing, pkg.name * " tests passed ")
Expand Down
Loading