Skip to content

Commit ec5b551

Browse files
authored
Merge pull request #4140 from stemann/feature/1.11_test_precompile_threads
Ensure precompilation when testing runs without threads on Julia 1.11
1 parent 9ca5e30 commit ec5b551

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Operations.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,9 +2067,11 @@ function test(ctx::Context, pkgs::Vector{PackageSpec};
20672067
flags = gen_subprocess_flags(source_path; coverage, julia_args)
20682068

20692069
if should_autoprecompile()
2070-
cacheflags = Base.CacheFlags(parse(UInt8, read(`$(Base.julia_cmd()) $(flags) --eval 'show(ccall(:jl_cache_flags, UInt8, ()))'`, String)))
2070+
precompile_julia_args = Cmd(filter(!startswith("--threads"), julia_args.exec)) # precompilation with threads is not supported
2071+
precompile_flags = gen_subprocess_flags(source_path; coverage, julia_args = precompile_julia_args)
2072+
cacheflags = Base.CacheFlags(parse(UInt8, read(`$(Base.julia_cmd()) $(precompile_flags) --eval 'show(ccall(:jl_cache_flags, UInt8, ()))'`, String)))
20712073
Pkg.activate(sandbox_ctx.env.project_file; #=io=devnull=#) do
2072-
Pkg.precompile(sandbox_ctx; io=sandbox_ctx.io, configs = flags => cacheflags)
2074+
Pkg.precompile(sandbox_ctx; io=sandbox_ctx.io, configs = precompile_flags => cacheflags)
20732075
end
20742076
end
20752077

0 commit comments

Comments
 (0)