Skip to main content

Module target

Module target 

Source
Expand description

Typed TargetPredicate — conditional-dependency activation.

Every package manager has its own syntax for “only install this dep on platform X” / “only on node 18+” / “only on Linux”:

  • Cargo: target.'cfg(unix)'.dependencies
  • npm: "engines": { "node": ">=18" } + "os": ["linux"]
  • pip: [platform_python_implementation == 'CPython'] markers
  • Bundler: platforms :ruby, :mswin
  • Composer: "php": ">=8.0"

Adapters normalise their native predicate into the canonical typed shape here. The resolver in gen-engine consults this once + decides per-target whether the dep is active.

Structs§

CompoundTargetPredicate
Compound predicate combining atomic TargetPredicates. Kept separate from TargetPredicate to avoid serde recursion- overflow on the derive macros — same trick as crate::CompoundConstraint.
Target
A concrete target the engine evaluates predicates against. Typically derived from the host system the engine is running on, optionally overridden via shikumi config (e.g. --target aarch64-linux cross-build).

Enums§

PredicateCombinator
TargetPredicate
Typed conditional-activation predicate. Adapters set this on crate::Dependency when the dep is conditional.