@@ -763,7 +763,7 @@ function resolve_versions!(
763763
764764 jll_fix = Dict {UUID, VersionNumber} ()
765765 for pkg in pkgs
766- if ! is_stdlib (pkg. uuid) && endswith (pkg. name, " _jll" ) && pkg. version isa VersionNumber
766+ if ! is_stdlib (pkg. uuid, julia_version ) && endswith (pkg. name, " _jll" ) && pkg. version isa VersionNumber
767767 jll_fix[pkg. uuid] = pkg. version
768768 end
769769 end
@@ -814,7 +814,7 @@ function resolve_versions!(
814814 # Unless using the unbounded or historical resolver, always allow stdlibs to update. Helps if the previous resolve
815815 # happened on a different julia version / commit and the stdlib version in the manifest is not the current stdlib version
816816 unbind_stdlibs = julia_version === VERSION
817- reqs = Resolve. Requires (pkg. uuid => is_stdlib (pkg. uuid) && unbind_stdlibs ? VersionSpec (" *" ) : VersionSpec (pkg. version) for pkg in pkgs)
817+ reqs = Resolve. Requires (pkg. uuid => is_stdlib (pkg. uuid, julia_version ) && unbind_stdlibs ? VersionSpec (" *" ) : VersionSpec (pkg. version) for pkg in pkgs)
818818 deps_map_compressed, compat_map_compressed, weak_deps_map_compressed, weak_compat_map_compressed, pkg_versions_map, pkg_versions_per_registry, uuid_to_name, reqs, fixed = deps_graph (env, registries, names, reqs, fixed, julia_version, installed_only)
819819 graph = Resolve. Graph (deps_map_compressed, compat_map_compressed, weak_deps_map_compressed, weak_compat_map_compressed, pkg_versions_map, pkg_versions_per_registry, uuid_to_name, reqs, fixed, false , julia_version)
820820 Resolve. simplify_graph! (graph)
@@ -945,6 +945,7 @@ function deps_graph(
945945 # unregistered stdlib we must special-case it here. This is further
946946 # complicated by the fact that we can ask this question relative to
947947 # a Julia version.
948+ # CRITICAL: Never resolve stdlibs from registry for target julia_version
948949 if (julia_version != VERSION && is_unregistered_stdlib (uuid)) || uuid_is_stdlib
949950 # We use our historical stdlib versioning data to unpack the version, deps and weakdeps of this uuid
950951 stdlib_info = stdlibs_for_julia_version[uuid]
@@ -2012,7 +2013,7 @@ function update_package_add(ctx::Context, pkg::PackageSpec, entry::PackageEntry,
20122013 if entry. path != = nothing || entry. repo. source != = nothing || pkg. repo. source != = nothing
20132014 return pkg # overwrite everything, nothing to copy over
20142015 end
2015- if is_stdlib (pkg. uuid)
2016+ if is_stdlib (pkg. uuid, ctx . julia_version )
20162017 return pkg # stdlibs are not versioned like other packages
20172018 elseif is_dep && (
20182019 (isa (pkg. version, VersionNumber) && entry. version == pkg. version) ||
@@ -2511,18 +2512,19 @@ function up(
25112512 return build_versions (ctx, union (new_apply, new_git))
25122513end
25132514
2514- function update_package_pin! (registries :: Vector{Registry.RegistryInstance} , pkg:: PackageSpec , entry:: Union{Nothing, PackageEntry} )
2515+ function update_package_pin! (ctx :: Context , pkg:: PackageSpec , entry:: Union{Nothing, PackageEntry} )
25152516 if entry === nothing
25162517 cmd = Pkg. in_repl_mode () ? " pkg> resolve" : " Pkg.resolve()"
25172518 pkgerror (" package $(err_rep (pkg)) not found in the manifest, run `$cmd ` and retry." )
25182519 end
2520+ registries = ctx. registries
25192521
25202522 # if entry.pinned && pkg.version == VersionSpec()
25212523 # println(ctx.io, "package $(err_rep(pkg)) already pinned")
25222524 # end
25232525 # update pinned package
25242526 pkg. pinned = true
2525- if is_stdlib (pkg. uuid)
2527+ if is_stdlib (pkg. uuid, ctx . julia_version )
25262528 return nothing # nothing left to do
25272529 elseif pkg. version == VersionSpec ()
25282530 pkg. version = entry. version # pin at current version
@@ -2543,7 +2545,7 @@ end
25432545is_fully_pinned (ctx:: Context ) = ! isempty (ctx. env. manifest. deps) && all (kv -> last (kv). pinned, ctx. env. manifest. deps)
25442546
25452547function pin (ctx:: Context , pkgs:: Vector{PackageSpec} )
2546- foreach (pkg -> update_package_pin! (ctx. registries , pkg, manifest_info (ctx. env. manifest, pkg. uuid)), pkgs)
2548+ foreach (pkg -> update_package_pin! (ctx, pkg, manifest_info (ctx. env. manifest, pkg. uuid)), pkgs)
25472549 pkgs = load_direct_deps (ctx. env, pkgs)
25482550
25492551 # TODO : change pin to not take a version and just have it pin on the current version. Then there is no need to resolve after a pin
0 commit comments