Skip to content

Commit 7a35bbe

Browse files
authored
ensure stdlibs do not take dependencies from the registry (#2707)
1 parent 2e3912d commit 7a35bbe

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/Operations.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,11 @@ function deps_graph(env::EnvCache, registries::Vector{Registry.RegistryInstance}
410410
stdlib_name, stdlib_version = stdlibs_for_julia_version[uuid]
411411
end
412412

413-
# If we're requesting resolution of a package that is an unregistered stdlib (or one
414-
# that tracks no version information) we must special-case it here. This is further
415-
# complicated by the fact that we can ask this question relative to a Julia version.
416-
if is_unregistered_stdlib(uuid) || (uuid_is_stdlib && stdlib_version === nothing)
413+
# If we're requesting resolution of a package that is an
414+
# unregistered stdlib we must special-case it here. This is further
415+
# complicated by the fact that we can ask this question relative to
416+
# a Julia version.
417+
if is_unregistered_stdlib(uuid) || uuid_is_stdlib
417418
path = Types.stdlib_path(stdlibs_for_julia_version[uuid][1])
418419
proj_file = projectfile_path(path; strict=true)
419420
@assert proj_file !== nothing

test/new.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2767,6 +2767,17 @@ end
27672767
@test linalg_block["uuid"] == linalg_uuid
27682768
@test !haskey(linalg_block, "version")
27692769
end
2770+
2771+
isolate(loaded_depot=true) do
2772+
# Next, test that stdlibs do not get dependencies from the registry
2773+
# NOTE: this test depends on the fact that in Julia v1.6+ we added
2774+
# "fake" JLLs that do not depend on Pkg while the "normal" p7zip_jll does.
2775+
# A future p7zip_jll in the registry may not depend on Pkg, so be sure
2776+
# to verify your assumptions when updating this test.
2777+
Pkg.add("p7zip_jll")
2778+
p7zip_jll_uuid = UUID("3f19e933-33d8-53b3-aaab-bd5110c3b7a0")
2779+
@test !("Pkg" in keys(Pkg.dependencies()[p7zip_jll_uuid].dependencies))
2780+
end
27702781
end
27712782

27722783
end #module

0 commit comments

Comments
 (0)