upstream(move): Port upstream Move package tooling - #12653
Conversation
There was a problem hiding this comment.
new rule was added to exclude the traces folder, but traces were not removed. Is there a reason why it is now gitignored? 🤔
There was a problem hiding this comment.
Good point - that's inherited behavior from the upstream commit, which added the .gitignore without removing traces/.
The rule doesn't affect the 24 already-tracked trace files - gitignore only applies to untracked ones. Its actual purpose is to suppress what a local run newly produces: the two traces from the new differential_test module (which upstream deliberately did not commit - they're recorded in args.exp as expected Only in traces: … output) plus the generated lcov.info files.
Upstream still tracks traces/ on main today, so we match their state.
| At C | ||
| C = { local = "deps_only/C-v1" } |
There was a problem hiding this comment.
Yes - this comes from the upstream patch and our regenerated output matches it exactly (the test passes on this snapshot).
It's the visible effect of the override-pruning rewrite: one of the two conflicting entries is now attributed to the overridden package itself rather than to the path through the intermediate one.
All 44 override/diamond test cases pass with the rewrite.
There was a problem hiding this comment.
not sure all these changes are needed
There was a problem hiding this comment.
i mean bumping all these packages versions
There was a problem hiding this comment.
Nothing hand-edited - the lock is byte-for-byte what cargo generates (checked by re-resolving from the base lock).
Only three real changes: petgraph 0.5.1 → the 0.8.3 entry already in the lock, fixedbitset 0.2.0 dropped (only 0.5.1 used it), lcov + thiserror added.
The rand/itertools lines aren't upgrades - both versions were already present, cargo just re-pointed which one other crates use after petgraph 0.5.1 left the graph.
[run-ci]
Description of change
Ports two upstream Move package tooling changes:
move coverage lcovsubcommand that turns Move unit test execution traces intolcov.info, with--only-testand--differential-testvariants.move-packageare reworked.Upstream commits
04d8b4a19092103424e527a5ad1421dc4c71199bdcd4f884989419934a431f793f7d38d438d49534Skipped
No commit was skipped. One hunk and one related upstream commit were deliberately left out:
move-compiler/src/cfgir/translate.rshunk from #22220 (DiGraphMap::<ConstantName, ()>::new())606fb4a52980b92df65a5042b43339e08df7ff82(#21876, "Ignore override when comparing dependencies")wont-mergefor vm-language. #22220 does not depend on it — it touches onlyDependency::eq,format_depsand a doc comment, none of which #22220 referencesDownstream adaptations
move-coverage/src/lcov.rsVMControlFlowGraphimported frommove_bytecode_verifier::absintinstead ofmove_abstract_interpreter::control_flow_graphlcov.rsat the time because the file did not exist downstream yetmove-coverage/Cargo.toml+ move-bytecode-verifier; new dependencies sorted into the existing# external/# internalgroupsmove-cli/src/base/coverage.rs,move-coverage/src/lib.rs,move-cli/Cargo.tomlmove-coverage/src/lcov.rs,move-coverage/src/differential_coverage.rsmove-package/src/resolution/dependency_graph.rsprune_overriden_pkgs, so it was namedprune_overridden_pkgs— the exact name upstream gives its new function. Both old functions were removed and replaced by the new onemove-package/src/resolution/dependency_graph.rsfetch_kind/reroothandling incollect_graphs(#12111) and the localstr_escapesignature preservedCargo.lock,external-crates/move/Cargo.lock#12652 Links to any relevant issues
Fixes #10834 .
How the change has been tested
Ran locally:
cargo check --workspace --all-targetsonexternal-crates/move: clean. The petgraph 0.5 → 0.8 bump needed no API fixes across the ten crates that use it.cargo check -p iota-movein the root workspace: clean.cargo test -p move-package: 200 passed, 0 failed — including all 44 override/diamond cases, the surface the pruning rewrite affects. No pending insta snapshots.cargo test -p move-cli --test tracing_testsuite --features tracing: 1 passed. Generatedlcov.infoline counts match the expected output exactly (6012 / 5828 / 26).cargo +nightly fmt,cargo ci-license: clean.dependency_graph.rsthe code lines match exactly — 152 added / 229 removed on both sides; the only differences anywhere are comment re-wrapping at the downstream rustfmt width and theprune_overriden_pkgs→prune_overridden_pkgsspelling noted above.Two things worth a reviewer's attention:
The tracing_testsuite target is gated behind #[cfg(feature = "tracing")]. CI enables it: scripts/ci_tests/rust_tests.py runs external-crate tests with --features tracing. Note that rust-tests runs in the merge queue, not on the PR, so the lcov assertions execute at merge time rather than on this PR's checks.
needless_borrowclippy warnings in the ported upstream code (&path.join(...)) were left as upstream wrote them.external-crates/moveis a separate workspace and these crates are path dependencies, socargo ci-clippydoes not lint them.Release Notes
iota move coverage lcovsubcommand emits LCOV data from Move unit test traces;move-packageoverride resolution reworked, which changes the wording of conflicting-dependency errors.