Skip to content

Commit 76ecd63

Browse files
disable auto-precompilation on Pkg.add
1 parent 3b444f5 commit 76ecd63

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/Prefix.jl

+11-7
Original file line numberDiff line numberDiff line change
@@ -604,14 +604,18 @@ end
604604

605605
# Helper function to install packages also in Julia v1.8
606606
function Pkg_add(args...; kwargs...)
607-
@static if VERSION < v"1.8.0"
608-
Pkg.add(args...; kwargs...)
609-
else
610-
try
611-
Pkg.respect_sysimage_versions(false)
607+
# we don't want to precompile packages during installation
608+
# auto-precompilation also calls `Pkg.instantiate` which will warn about non-VERSION `julia_version` values
609+
withenv("JULIA_PKG_AUTO_PRECOMPILE" => "false") do
610+
@static if VERSION < v"1.8.0"
612611
Pkg.add(args...; kwargs...)
613-
finally
614-
Pkg.respect_sysimage_versions(true)
612+
else
613+
try
614+
Pkg.respect_sysimage_versions(false)
615+
Pkg.add(args...; kwargs...)
616+
finally
617+
Pkg.respect_sysimage_versions(true)
618+
end
615619
end
616620
end
617621
end

0 commit comments

Comments
 (0)