Skip to main content

select_tools

Function select_tools 

Source
pub fn select_tools(
    providers: &[ToolProvider],
    chosen: &BTreeMap<String, String>,
) -> Result<BTreeMap<String, ToolProvider>, ComposeError>
Expand description

Decide, for every dispatchable name a composition exposes, the ONE provider a bare name resolves to (REQ-REALM2-001 clauses 4c and 4d).

chosen is the pin’s realm-qualified selection, tool name → realm. A name with a single provider needs no entry and is unaffected — every pin written before this existed keeps resolving byte for byte. A name with several providers resolves only where the pin chose, and the choice is the pin’s alone: nothing here reads install order, partition order or a precedence list, because any of those would let adding a tool to one realm silently change which binary a build runs.

Providers are given root-layer-first; that order decides only which one an error names first, never which one wins.