@@ -14,7 +14,7 @@ import ..Artifacts: ensure_artifact_installed, artifact_names, extract_all_hashe
1414 artifact_exists, select_downloadable_artifacts
1515using Base. BinaryPlatforms
1616import ... Pkg
17- import ... Pkg: pkg_server, Registry, pathrepr, can_fancyprint, printpkgstyle, stderr_f, OFFLINE_MODE, UPDATED_REGISTRY_THIS_SESSION
17+ import ... Pkg: pkg_server, Registry, pathrepr, can_fancyprint, printpkgstyle, stderr_f, OFFLINE_MODE, UPDATED_REGISTRY_THIS_SESSION, RESPECT_SYSIMAGE_VERSIONS
1818
1919# ########
2020# Utils #
389389get_or_make! (d:: Dict{K,V} , k:: K ) where {K,V} = get! (d, k) do ; V () end
390390
391391const JULIA_UUID = UUID (" 1222c4b2-2114-5bfd-aeef-88e4692bbb3e" )
392+ const PKGORIGIN_HAVE_VERSION = :version in fieldnames (Base. PkgOrigin)
392393function deps_graph (env:: EnvCache , registries:: Vector{Registry.RegistryInstance} , uuid_to_name:: Dict{UUID,String} ,
393394 reqs:: Resolve.Requires , fixed:: Dict{UUID,Resolve.Fixed} , julia_version)
394395 uuids = Set {UUID} ()
@@ -456,6 +457,19 @@ function deps_graph(env::EnvCache, registries::Vector{Registry.RegistryInstance}
456457 is_package_downloaded (env. project_file, pkg_spec) || continue
457458 end
458459
460+ # Skip package version that are not the same as external packages in sysimage
461+ if PKGORIGIN_HAVE_VERSION && RESPECT_SYSIMAGE_VERSIONS[] && julia_version == VERSION
462+ pkgid = Base. PkgId (uuid, pkg. name)
463+ if Base. in_sysimage (pkgid)
464+ pkgorigin = get (Base. pkgorigins, pkgid, nothing )
465+ if pkgorigin != = nothing && pkgorigin. version != = nothing
466+ if v != pkgorigin. version
467+ continue
468+ end
469+ end
470+ end
471+ end
472+
459473 all_compat_u[v] = compat_info
460474 union! (uuids, keys (compat_info))
461475 end
@@ -1857,6 +1871,14 @@ function status_compat_info(pkg::PackageSpec, env::EnvCache, regs::Vector{Regist
18571871 max_version == v " 0" && return nothing
18581872 pkg. version >= max_version && return nothing
18591873
1874+ pkgid = Base. PkgId (pkg. uuid, pkg. name)
1875+ if PKGORIGIN_HAVE_VERSION && RESPECT_SYSIMAGE_VERSIONS[] && Base. in_sysimage (pkgid)
1876+ pkgorigin = get (Base. pkgorigins, pkgid, nothing )
1877+ if pkgorigin != = nothing && pkg. version != = nothing && pkg. version == pkgorigin. version
1878+ return [" sysimage" ], max_version, max_version_in_compat
1879+ end
1880+ end
1881+
18601882 # Check compat of project
18611883 if pkg. version == max_version_in_compat && max_version_in_compat != max_version
18621884 return [" compat" ], max_version, max_version_in_compat
@@ -2055,6 +2077,8 @@ function print_status(env::EnvCache, old_env::Union{Nothing,EnvCache}, registrie
20552077 printstyled (io, " (<v" , max_version, " )" ; color= Base. warn_color ())
20562078 if packages_holding_back == [" compat" ]
20572079 printstyled (io, " [compat]" ; color= :light_magenta )
2080+ elseif packages_holding_back == [" sysimage" ]
2081+ printstyled (io, " [sysimage]" ; color= :light_magenta )
20582082 else
20592083 pkg_str = isempty (packages_holding_back) ? " " : string (" : " , join (packages_holding_back, " , " ))
20602084 printstyled (io, pkg_str; color= Base. warn_color ())
0 commit comments