File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -604,15 +604,20 @@ end
604604
605605# Helper function to install packages also in Julia v1.8
606606function 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+ # auto-precompilation calls `instantiate` which creates `julia_version` related warnings (nothing, or mismatch)
608+ # so manually call precompile after adding the packages with `already_instantiated=true` to avoid warnings
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
620+ Pkg. precompile (;already_instantiated= true )
616621 end
617622end
618623
You can’t perform that action at this time.
0 commit comments