Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading: look for vendored packages in $project/packages #35222

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 7 additions & 1 deletion base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -591,9 +591,15 @@ function explicit_manifest_uuid_path(project_file::String, pkg::PkgId)::Union{No
return path
end
hash === nothing && return nothing
# Look for bundled packages in `$project/packages`
depot_path = DEPOT_PATH
project = active_project()
if project !== nothing
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if project !== nothing
if project !== nothing && project in load_path()

Copy link
Member

Choose a reason for hiding this comment

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

Could you explain this change?

Copy link
Member

Choose a reason for hiding this comment

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

Seems weird to look for stuff in a path that is not on the LOAD_PATH.

Copy link
Member

Choose a reason for hiding this comment

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

Sure. I think this will be true in 99% of cases anyway. The only way that the active project wouldn’t be the first entry in the load path would be if someone manually popped it off.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, so my suggestion fixes that.

Copy link
Member Author

Choose a reason for hiding this comment

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

The situation where this can happen is if @ is removed from the LOAD_PATH. I have to think a little about whether it makes sense for that to interact with this or not...

Then this can be simplified to this:

Suggested change
if project !== nothing
if project in load_path()

That's because load_path already filters out nothing values and only returns strings.

depot_path = [abspath(dirname(project), ".julia"); depot_path]
end
# Keep the 4 since it used to be the default
for slug in (version_slug(uuid, hash, 4), version_slug(uuid, hash))
for depot in DEPOT_PATH
for depot in depot_path
path = abspath(depot, "packages", name, slug)
ispath(path) && return path
end
Expand Down