diff --git a/base/loading.jl b/base/loading.jl index d7382e1f879484..3b3d3461cda35d 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -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 + 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 diff --git a/test/loading.jl b/test/loading.jl index b621ba44237f0f..56a2e34910b86a 100644 --- a/test/loading.jl +++ b/test/loading.jl @@ -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 diff --git a/test/project/SubProject/Manifest.toml b/test/project/SubProject/Manifest.toml new file mode 100644 index 00000000000000..1ea3c408cebfa0 --- /dev/null +++ b/test/project/SubProject/Manifest.toml @@ -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" diff --git a/test/project/SubProject/Project.toml b/test/project/SubProject/Project.toml index b4ef3b6a082a72..8540f445bd0972 100644 --- a/test/project/SubProject/Project.toml +++ b/test/project/SubProject/Project.toml @@ -1,3 +1,6 @@ +name = "MyPkg" +uuid = "0cafdeb2-d7a2-40d0-8d22-4411fcc2c4ee" + subprojects = ["sub"] [deps] diff --git a/test/project/SubProject/src/MyPkg.jl b/test/project/SubProject/src/MyPkg.jl new file mode 100644 index 00000000000000..6d84954645d553 --- /dev/null +++ b/test/project/SubProject/src/MyPkg.jl @@ -0,0 +1,3 @@ +module MyPkg + +end