forc_pkg

Function compilation_order

Source
pub fn compilation_order(graph: &Graph) -> Result<Vec<NodeIx>>
Expand description

The pkg::Graph is of a -> b where a depends on b. We can determine compilation order by performing a toposort of the graph with reversed weights. The resulting order ensures all dependencies are always compiled before their dependents.