Skip to content

Support arbitrary selector expressions in package targets#5717

Closed
wolfv wants to merge 1 commit intomainfrom
claude/implement-platform-translation-IVMqR
Closed

Support arbitrary selector expressions in package targets#5717
wolfv wants to merge 1 commit intomainfrom
claude/implement-platform-translation-IVMqR

Conversation

@wolfv
Copy link
Member

@wolfv wolfv commented Mar 17, 2026

Description

This PR adds support for arbitrary selector expressions (e.g., "host_platform == build_platform") in the [package.target] section of manifests. These expressions are passed through directly to rattler-build for evaluation, enabling more complex conditional logic in package configurations.

E.g. this should enable:

# cross-compilation
[package.target."host_platform != build_platform".build-dependencies]

# cross-compilation
[package.target."host_platform == 'linux-64'".build-dependencies]

# variant matching
[package.target."matches(python, '>=3.10')".build-dependencies]

Allow arbitrary selector expressions (e.g. "host_platform == build_platform")
as target keys in the [package] section. These are passed through directly
to rattler-build, enabling full control over conditional dependencies.

Expression selectors are only valid in [package.target] and
[package.build.target] sections. In workspace and feature sections,
unknown platform strings still produce proper error messages.

Closes #4625

https://claude.ai/code/session_013pXmuPTy8PtK6p6jrRKWJc
@wolfv wolfv marked this pull request as draft March 17, 2026 18:43
@wolfv wolfv closed this Mar 17, 2026
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.

2 participants