diff --git a/src/Operations.jl b/src/Operations.jl index 652b004af9..d3d93a9a30 100644 --- a/src/Operations.jl +++ b/src/Operations.jl @@ -1653,10 +1653,13 @@ end function gen_test_precompile_code(source_path::String; coverage, julia_args::Cmd, test_args::Cmd) # Note that we cannot load the dev-ed Pkg here during Pkg testing # so the `Pkg.precompile` that is run here is the one in the sysimage + pkgdir = joinpath(@__DIR__, "..") code = """ - Pkg = Base.require(Base.PkgId(Base.UUID("44cfe95a-1eb2-52ea-b672-e2afdf69b78f"), "Pkg")) - $(Base.load_path_setup_code(false)) - append!(empty!(ARGS), $(repr(test_args.exec))) + pushfirst!(LOAD_PATH, $(repr(pkgdir))) + try using Pkg + catch e + @warn "Pkg not loaded, skipping precompilation." + end Pkg.precompile(warn_loaded = false) """ return gen_subprocess_cmd(code, source_path; coverage, julia_args)