-
Notifications
You must be signed in to change notification settings - Fork 12
Description
As discussed in JuliaLang/Pkg.jl#1251, having registered packages in a subdirectory of a git repository works partially today. If you prepare a registry with the right tree hashes, add Package and add Package@revision work out of the box. Additional Pkg functionality is added in the WIP PR JuliaLang/Pkg.jl#1422.
However, for add Package#branch or dev Package there is no information available in the registry about the subdirectory. Thus either Pkg would have to hunt through the repository for a matching Project.toml or the user would have to provide the subdirectory path for these operations. Neither of these options seems very satisfactory.
My proposal is that Package.toml is modified to include this information. Two possibilities are to change (in a hypothetical world where RegistryTools lives in a subdirectory) today's
name = "RegistryTools"
uuid = "d1eb7eb1-105f-429d-abf5-b0f65cb9e2c4"
repo = "https://github.com/JuliaRegistries/RegistryTools.jl.git"
into either
name = "RegistryTools"
uuid = "d1eb7eb1-105f-429d-abf5-b0f65cb9e2c4"
repo = "https://github.com/JuliaRegistries/RegistryTools.jl.git"
path = "path/to/package"
or
name = "RegistryTools"
uuid = "d1eb7eb1-105f-429d-abf5-b0f65cb9e2c4"
repo = "https://github.com/JuliaRegistries/RegistryTools.jl.git?path=path/to/package"
Both of these would be backwards compatible with current Julia versions since no changes are required for normal packages. For packages in subdirectories they differ in how they don't work properly beyond add Package and add Package@version. In the former case, as well as without path information in the registry, add Package#branch and dev Package downloads/clones the top level repository and end up with a broken package. In the latter case these operations instead result in an immediate, though not very clear, error.
Note that packages in subdirectories is a useful enough feature that it would be worth using even without improved Pkg support. It would be good to settle this issue right away though, since adding path information to existing registries with such packages would be an unnecessary complication.
Opinions?