Allow a "git" registry to be consumed from a repository subdirectory
@Cheney-W is already working on this.
Since Feb 20, 2024.
- Dominant language
- CMake
- Stars
- 27.5k
- Forks
- 7.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 321
Description
Currently, vcpkg assumes that a registry is its own separately versioned project and that its content directories live at the root of the repository. It would be convenient to also allow hosting a custom port directly from a project subdirectory as an alternative to bundling multiple ports together under a single custom registry.
Proposed solution
Here is an example vcpkg-configuration.json showing the single "path" entry needed to support this registry model. Supporting the "path" field does not change the semantics or configuration of the current registry model, only that of the "git" registry entry in vcpkg-configuration.json.
The repository and branch reference show below are live as of Sep 14, 2022:
{
"default-registry": {
"$info": "The currently support vcpkg baseline",
"kind": "builtin",
"baseline": "d474b26040207c89d81f50dd39be7d335f1d3745"
},
"registries": [
{
"$info": "A custom git registry published as a relative subdirectory of a project",
"kind": "git",
"repository": "https://github.com/propulsortech/lexertl14",
"path": "vcpkg",
"packages": [ "lexertl14" ],
"baseline": "5dbc61f0ced9aef6d75f8c9025e7a9366137a94d",
"reference": "1-experiment-with-lexertl14-as-its-own-vcpkg-registry"
}
]
}
Describe alternatives you've considered
At the moment, I have a single custom registry containing ports for several projects. The other alternatives I have considered include exposing the ports and versions directories in the root of the project and creating a separate project under the same namespace just for the registry (e.g. propulsortech/lexertl14-vcpkg). Both options work as expected but are not as elegant or straightforward to maintain as having the custom registry under the project itself.
Additional context
I dove into the vcpkg-tool source (at 3c502fa609 on main) to convince myself that this feature is even possible. The files affected appear to be vcpkg/configuration.cpp and vcpkg/registries.cpp, as well as vcpkg-test/registries.cpp for verifying that parsing works and azure-pipelines/end-to-end-tests-dir/registries.ps1 for e2e testing. Documentation for the git registry would also need to be updated to include a description of how the "path" field works.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.