pub fn refine_to_single_linkage<E: ExecutionErrorTrait>(
txn: &mut Transaction,
linkage_analysis: &LinkageAnalyzer,
package_store: &dyn PackageStore,
) -> Result<(), E>Expand description
Replace each command’s per-call linkage with a single linkage shared by the whole transaction.
Done in two passes:
- Fold every command’s package and type-argument constraints into one
ResolutionTable, unifying as we go (an error here means the commands cannot agree on a single set of package versions).- Top level functions are pinned
exact, while their dependencies are pinnedexactorat_leastbased on the visibility of the top-level function. Type-argument packages are alwaysat_least. - Publishes and upgrades introduce their own constraints to the linkage, but only if
they have an
initfunction (otherwise they do not contribute to the linkage). See comments on each of the command arms for details on this.
- Top level functions are pinned
- Write the resulting unified linkage back into every
MoveCall.
Because all calls end up sharing one linkage, every package version selection is consistent across the transaction.