Skip to content

feat(manifest): support wildcard platform target selectors#6301

Open
hunger wants to merge 2 commits into
prefix-dev:mainfrom
hunger:push-qovspwowzxpq
Open

feat(manifest): support wildcard platform target selectors#6301
hunger wants to merge 2 commits into
prefix-dev:mainfrom
hunger:push-qovspwowzxpq

Conversation

@hunger

@hunger hunger commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Description

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 #6236.

How Has This Been Tested?

New test

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Claude

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.
  • I have verified that changes that would impact the JSON schema have been made in schema/model.py.

hunger added 2 commits June 9, 2026 11:04
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.
@hunger hunger force-pushed the push-qovspwowzxpq branch from f30f783 to 88d2684 Compare June 9, 2026 11:20
/// 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 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lets use https://docs.rs/glob/0.3.3/glob/ to stay consistent with the rest of the ecosystem.

@baszalmstra baszalmstra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Small request but otherwise looks goodo!

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.

Support wildcards for platform names in the target selector.

2 participants