Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -985,11 +985,7 @@ function explicit_manifest_entry_path(manifest_file::String, pkg::PkgId, entry::
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is inconsistent now, since the function is supposed to return the path to the file (due to this branch and the stdlib one), but this PR only changes the stdlib one

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But path here will be the path to the directory, no (dirname(manifest_file))?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, is it? I was confused by the documentation implying it is the path to the source code:
https://docs.julialang.org/en/v1/manual/code-loading/#Project-environments

But okay, seems you are right that it is expected to be either the path to the source code exactly or a directory containing the source code:

"If any of these result in success, the path to the source code entry point will be that result or the relative path from that result plus src/X.jl")

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what I have changed to here is correct actually because I think in implicit envs you can just have the file Package.jl without putting it in any folder. So maybe this PR should be closed.

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
Expand Down
11 changes: 11 additions & 0 deletions test/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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