Repository navigation
feat(manifest): support wildcard platform target selectors - #6301
Conversation
| /// 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 { |
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
left a comment
There was a problem hiding this comment.
Small request but otherwise looks goodo!
|
I changed the code to use glob pattern, but still error out for anything but Tested with the It does not re-evaluate when you ask to install the same environment again with a different CODA_OVERRIDE. A install of some installed package should be a NOOP, so that is as I expect it to be.
|
88d2684 to
ab82328
Compare
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.
ab82328 to
4bfd494
Compare
|
@bas: I am wondering whether I should just add in more glob pattern matching than just On the other hand: I doubt that would be used widely. |
|
Lets leave it as is for now, can always make it more complex 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.