From 7fe12bcf6166a386ac2fe9c009b3e3cf28bf1710 Mon Sep 17 00:00:00 2001 From: Kristoffer Date: Tue, 20 Feb 2024 16:50:42 +0100 Subject: [PATCH] tweak code loading to make Revise happy --- base/loading.jl | 6 +----- test/loading.jl | 11 +++++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/base/loading.jl b/base/loading.jl index f4db43d80640b..18aba4836e420 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -985,11 +985,7 @@ function explicit_manifest_entry_path(manifest_file::String, pkg::PkgId, entry:: end hash = get(entry, "git-tree-sha1", nothing)::Union{Nothing, String} if hash === nothing - mbypath = manifest_uuid_path(Sys.STDLIB, pkg) - if mbypath isa String - return entry_path(mbypath, pkg.name) - end - return nothing + return joinpath(Sys.STDLIB, pkg.name) end hash = SHA1(hash) # Keep the 4 since it used to be the default diff --git a/test/loading.jl b/test/loading.jl index 4a72a0f8060ad..4991cf6a4229f 100644 --- a/test/loading.jl +++ b/test/loading.jl @@ -1545,3 +1545,14 @@ end @test_throws SystemError("opening file $(repr(file))") include(file) end end + +@testset "Revise internals" begin + entry = Dict{String, Any}( + "SparseArrays" => [Dict("deps" => ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"], + "uuid" => "2f01184e-e22b-5df5-ae63-d93ebab69eaf", + "version" => "1.10.0")]) + id = Base.PkgId(Base.UUID("2f01184e-e22b-5df5-ae63-d93ebab69eaf"), "SparseArrays") + manifest_file = mktemp()[1] + dir = Base.explicit_manifest_entry_path(manifest_file, id, entry) + @test isdir(dir) +end