mod select

module select

Stack selection via resolvo CDCL SAT (fed by parsed easyconfig candidates).

Also provides resolvo_resolve_dep_versions: joint SAT co-select of dependency pins for a single recipe (used by canonical package planning and bumps), so version selection is not hierarchy-lookup-only.

Functions

fn policy_constraints_report(policy: &Policy, candidates: &[Candidate]) -> String

The policy’s own constraints, and what each one leaves standing.

A solver reports that a package could not be selected. It cannot report whether the tree made that impossible or whether the policy did, because a pin reaches it as a constraint like any other and it has no way to know one was hand-written. Those need opposite fixes: widen the pin, or go author a recipe. Read as an explanation the failure is non-contrastive in Miller’s sense (doi:10.1016/j.artint.2018.07.007), naming what happened and not the alternative that did not.

A pin admitting nothing is the usual cause and is stated first. Only on the failure path, so a solve that succeeds pays nothing for it.

fn resolvo_resolve_dep_versions(specs: &[SourceDepSpec], cands: &[Candidate], hierarchy: &ToolchainHierarchy, toolchain: &Toolchain, root_name: &str, root_version: &str, preferred_pins: Option<&HashMap<String, String>>) -> Result<(HashMap<String, String>, String), String>

Joint resolvo co-select of dependency versions for one recipe.

Builds a synthetic root candidate whose dependencies are the foreign or source-recipe deps that exist under the generation hierarchy, solves with select_stack, and returns name→version for co-selected deps plus a human note (engine id). Hierarchy members (GCCcore, gfbf, …) are rewritten to the policy toolchain label so crate::resolvo_provider::EbProvider keeps them — membership is already enforced by filter_candidates_in_hierarchy.

When preferred_pins is set (typically hierarchy consensus), those packages are exact pins in the policy: resolvo joint-checks feasibility under generation-native versions rather than free prefer_newer overriding consensus (which would re-select SYSTEM/out-of-generation newest). Unpinned resolvable specs still free-select under residual floors.

Specs with SYSTEM toolchain or a non-empty versionsuffix are skipped (frozen pins). Pure SYSTEM install candidates are dropped when a non-SYSTEM hierarchy candidate for the same name exists.

fn select_stack(universe: &Universe, policy: &Policy, baseline: Option<&StackLock>) -> Result<StackLock, SelectError>

Select a stack using resolvo (CDCL SAT) over EasyBuild-derived candidates.

Enums

enum SelectError

Why a co-selection could not be produced.

MissingPackage(String)

No candidate in the tree provides the named package.

Unsat(String)

The requested set has no simultaneously satisfiable solution.

InvalidCriteria(String)

A named optimisation criterion is not one the solver implements.