Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC][registries] Allow pattern matching in packages declarations #778

Merged
merged 28 commits into from
Dec 12, 2022

Conversation

vicroms
Copy link
Member

@vicroms vicroms commented Oct 28, 2022

This PR makes the following changes to allow limited pattern matching for package declarations in registries:

  • Allow prefixes in the form foo* in "packages" declarations.
  • The * character is a wildcard that matches any zero or more characters.
  • The port name resolution priority will change to:
    1. Exact match
    2. Pattern match
      1. Longer prefixes have higher priority, e.g.: when resolving boost, boost* > b* > *.
      2. If there is a tie, we use the registry that is declared first in the "packages" array.
        A warning will be emitted to notify the user of possible misconfiguration.
    3. Default registry

Example: expose "beicode" and "beison" via patterns.

vcpkg-configuration.json

{
  "registries": [
    {
      "kind": "git", 
      "repository": "https://github.com/northwindtraders/vcpkg-registry", 
      "baseline": "dacf4de488094a384ca2c202b923ccc097956e0c", 
      "packages": [ "bei*" ] 
    }
  ]
}

Checklist:

@Neumann-A
Copy link
Contributor

oh no. If this is implemented please also add an exclusion list ...

@vicroms vicroms marked this pull request as ready for review November 7, 2022 02:18
@vicroms vicroms force-pushed the package_pattern_matching branch from 274123e to 2664c28 Compare November 7, 2022 03:25
@vicroms vicroms changed the title [RFC][WIP][registries] Allow pattern matching in packages declarations [RFC][registries] Allow pattern matching in packages declarations Nov 7, 2022
@BillyONeal
Copy link
Member

BillyONeal commented Nov 7, 2022

oh no. If this is implemented please also add an exclusion list ...

The "exclusion list" is adding the excluded thing to the registry you actually want used.

Copy link
Member

@BillyONeal BillyONeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Request changes" over the threading concerns in making the serializers mutable. Other changes are suggestions.

@Neumann-A
Copy link
Contributor

The "exclusion list" is adding the excluded thing to the registry you actually want used.

Should be documented.

@vicroms vicroms force-pushed the package_pattern_matching branch from a392057 to 0a80041 Compare November 8, 2022 23:17
@vicroms
Copy link
Member Author

vicroms commented Nov 9, 2022

The "exclusion list" is adding the excluded thing to the registry you actually want used.

Should be documented.

I've added an example in the docs PR.

@vicroms vicroms force-pushed the package_pattern_matching branch 2 times, most recently from 16a55b8 to 380573c Compare December 6, 2022 19:47
@vicroms vicroms force-pushed the package_pattern_matching branch from 380573c to 65afb51 Compare December 6, 2022 20:41
@vicroms vicroms merged commit 02abc66 into microsoft:main Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants