Skip to content

Commit

Permalink
also find base project package
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Mar 12, 2024
1 parent c305926 commit e5ccebf
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
8 changes: 8 additions & 0 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,14 @@ function manifest_uuid_path(env::String, pkg::PkgId)::Union{Nothing,String,Missi
# if `pkg` matches the project, return the project itself
return project_file_path(project_file)
end
base_project_file = base_project(project_file)
if base_proejct_file !== nothing

Check warning on line 697 in base/loading.jl

View workflow job for this annotation

GitHub Actions / Check for new typos

perhaps "proejct" should be "project".
base_proj = project_file_name_uuid(base_project_file, pkg.name)
if base_proj == pkg
# if `pkg` matches the project, return the project itself
return project_file_path(base_project_file)
end
end
mby_ext = project_file_ext_path(project_file, pkg.name)
mby_ext === nothing || return mby_ext
# look for manifest file and `where` stanza
Expand Down
2 changes: 2 additions & 0 deletions test/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1561,6 +1561,8 @@ end
@test isfile(Base.locate_package(id))
id2 = Base.identify_package("Devved2")
@test isfile(Base.locate_package(id2))
id3 = Base.identify_package("MyPkg")
@test isfile(Base.locate_package(id3))
finally
copy!(LOAD_PATH, old_load_path)
end
Expand Down
15 changes: 15 additions & 0 deletions test/project/SubProject/Manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file is machine-generated - editing it directly is not advised

julia_version = "1.12.0-DEV"
manifest_format = "2.0"
project_hash = "620b9377bc807ff657e6618c8ccc24887eb40285"

[[deps.Devved]]
path = "Devved"
uuid = "cbce3a6e-7a3d-4e84-8e6d-b87208df7599"
version = "0.1.0"

[[deps.Devved2]]
path = "Devved2"
uuid = "08f74b90-50f5-462f-80b9-a72b1258a17b"
version = "0.1.0"
3 changes: 3 additions & 0 deletions test/project/SubProject/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
name = "MyPkg"
uuid = "0cafdeb2-d7a2-40d0-8d22-4411fcc2c4ee"

subprojects = ["sub"]

[deps]
Expand Down
3 changes: 3 additions & 0 deletions test/project/SubProject/src/MyPkg.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module MyPkg

end

0 comments on commit e5ccebf

Please sign in to comment.