ITADN

[vcpkg.json] Add `alias` entry

#1892OpenSunBlack 创建于 2025-12-27
S
SunBlackcommented
Currently, I repeatedly find ports that have been renamed. Sometimes version `0` is specified, but sometimes the version that was current at the time of renaming is specified. And sometimes a port is renamed, but the old version keep for reasons. The second causes you to think you have version X installed and only the dependencies have changed, but in reality you have version Y installed. // Edit: Found more variants Examples: - Version `0`: [`beast`](https://github.com/microsoft/vcpkg/blob/11bbc873e00e9e58d4e9dffb30b7a5493a030e0b/ports/beast/vcpkg.json#L3) - Version during renaming port: [`gz-utils3`](https://github.com/microsoft/vcpkg/blob/11bbc873e00e9e58d4e9dffb30b7a5493a030e0b/ports/gz-cmake3/vcpkg.json#L3) (will currently insteall version 4.1.1 instead of 3.x) - Intended copy: [`kf5archive`](https://github.com/microsoft/vcpkg/blob/11bbc873e00e9e58d4e9dffb30b7a5493a030e0b/ports/kf5archive/vcpkg.json#L3) vs [`kf6archive`](https://github.com/microsoft/vcpkg/blob/11bbc873e00e9e58d4e9dffb30b7a5493a030e0b/ports/kf6archive/vcpkg.json#L3) (I think this was done so there is still a version using Qt 5, during the other is using Qt 6) - Version `alias`: [`catch`](https://github.com/microsoft/vcpkg/blob/11bbc873e00e9e58d4e9dffb30b7a5493a030e0b/ports/catch/vcpkg.json#L3) - Version `replaced`: [`libp7-baical`](https://github.com/microsoft/vcpkg/blob/11bbc873e00e9e58d4e9dffb30b7a5493a030e0b/ports/libp7-baical/vcpkg.json#L3) - Version `deprecated`: [`lodepng-c`](https://github.com/microsoft/vcpkg/blob/11bbc873e00e9e58d4e9dffb30b7a5493a030e0b/ports/lodepng-c/vcpkg.json#L3) I think it would be advantageous to have an alias rule. Either you adjust the `vcpkg.json` or a `vcpkg-alias.json` (so): ```json { "name": "beast", "alias": [ "name": "boost-beast", "remains-until": "2026-12-27" ] } ``` This would also have other advantages: - The CI could, for example, go through monthly before creating a tag and use `remains-until` to see if the package can be removed (a bot could create the commits for this, similar to dependabot). - During a port update, the CI could check whether an alias package is still included, for example, if a dependency was renamed between the start of implementation and the merge and is therefore overlooked (e.g, currently 9 ports still depends on `pthread` instead of `pthreads`). - When someone runs `vcpkg install <port>`, it would be better to make the user aware of the renaming (or reject it and only allow upgrades, if necessary). During the upgrade, vcpkg could also automatically remove the old package and switch to the new one. - In case `alias` is defined, no or only dependency can be defined - Third-party tools such as Repology could detect this better (so [this doesn't happens](https://repology.org/projects/?search=gz-utils&inrepo=vcpkg)). During checking packages with `VCPKG_POLICY_EMPTY_PACKAGE` in their portfile: Another variant would be to define a `package-type`, which could be `port`, `alias`, `meta-package` (boost), ...
3 条评论