feat(manifest): support wildcard platform target selectors#6301
Open
hunger wants to merge 2 commits into
Open
Conversation
2 tasks
Allow a `*` wildcard in target table keys, matched against the workspace platform name, e.g. `[target."cuda-*".tasks]`. This lets configuration be shared across several named platforms (such as `cuda-win-64` and `cuda-linux-64`) instead of duplicating a block per platform. The glob matches the full platform name, is case-sensitive, and uses `*` as the only metacharacter. When several selectors match a platform they combine in manifest order, the same as the existing family/subdir selectors. Wildcards are rejected in `[package.target]` and `[package.build.target]`, which resolve by subdir through the build-types protocol. Closes prefix-dev#6236.
baszalmstra
reviewed
Jun 9, 2026
| /// Anchored wildcard match where `*` matches zero or more bytes. Linear time | ||
| /// with backtracking on the most recent `*`; platform names are ASCII so byte | ||
| /// matching equals character matching. | ||
| fn glob_match(pattern: &[u8], text: &[u8]) -> bool { |
Contributor
There was a problem hiding this comment.
Lets use https://docs.rs/glob/0.3.3/glob/ to stay consistent with the rest of the ecosystem.
baszalmstra
requested changes
Jun 9, 2026
baszalmstra
left a comment
Contributor
There was a problem hiding this comment.
Small request but otherwise looks goodo!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Allow a
*wildcard in target table keys, matched against the workspaceplatform name, e.g.
[target."cuda-*".tasks]. This lets configuration beshared across several named platforms (such as
cuda-win-64andcuda-linux-64) instead of duplicating a block per platform.The glob matches the full platform name, is case-sensitive, and uses
*as the only metacharacter. When several selectors match a platform they
combine in manifest order, the same as the existing family/subdir
selectors. Wildcards are rejected in
[package.target]and[package.build.target], which resolve by subdir through the build-typesprotocol.
Closes #6236.
How Has This Been Tested?
New test
AI Disclosure
Tools: Claude
Checklist:
schema/model.py.