refactor(iota-framework-snapshot): split the manifest into a leaf crate - #12655
Merged
thibault-martinez merged 7 commits intoAug 18, 2026
Merged
Conversation
`iota-package-management`'s build script reads the bytecode snapshot manifest, a JSON file, through `iota-framework-snapshot`. That pulled `iota-framework` and `iota-types` into its build-dependency tree, and `iota-package-management` is itself a dependency of `iota-move-build` and 27 other crates. The manifest half of the crate has no workspace dependency beyond `ObjectId`, so it becomes a leaf crate: - Add `iota-framework-snapshot-manifest` holding the `Snapshot` / `SnapshotPackage` types, `manifest_path`, and the manifest load and update functions, together with `manifest.json` itself. - Re-export it from `iota-framework-snapshot` so existing consumers are unaffected. - Replace `SnapshotPackage::from_system_package_metadata`, which the orphan rule no longer allows, with the `snapshot_package` function in `iota-framework-snapshot`. - Point the `check_if_manifest_was_modified` test helper at the new manifest path, so `check_manifest_against_tomls` keeps running when the manifest changes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
DaughterOfMars
requested review from
a team,
alexsporn,
luca-moser,
lzpap,
miker83z and
muXxer
as code owners
August 13, 2026 06:57
bingyanglin
approved these changes
Aug 14, 2026
muXxer
approved these changes
Aug 17, 2026
thibault-martinez
approved these changes
Aug 18, 2026
valeriyr
approved these changes
Aug 18, 2026
thibault-martinez
enabled auto-merge
August 18, 2026 11:40
Dkwcs
approved these changes
Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of change
iota-package-management's build script reads the bytecode snapshot manifest — a JSON file — viaiota_framework_snapshot::{load_bytecode_snapshot_manifest, manifest_path}. That single build-dependency edge putiota-frameworkandiota-typesunderneathiota-package-management, whichiota-move-buildand 27 other crates wait for.The crate splits cleanly in two. The manifest half has no workspace dependency beyond
ObjectId, so it can become a leaf crate:iota-framework-snapshot-manifestholding theSnapshot/SnapshotPackage/SnapshotManifesttypes,manifest_path,load_bytecode_snapshot_manifestandupdate_bytecode_snapshot_manifest— unchanged, plusmanifest.jsonitself.iota-framework-snapshot(pub use iota_framework_snapshot_manifest::*), soiota-genesis-builder, the snapshot binary and the compatibility tests are unaffected.iota-package-managementinstead.load_bytecode_snapshot,get_system_package_publish_order,snapshot_path_for_versionand thebytecode_snapshot/directory — stays put, since it deals iniota_framework::SystemPackage.manifest.jsonmoves fromcrates/iota-framework-snapshot/tocrates/iota-framework-snapshot-manifest/, so thatmanifest_path()stays a plainCARGO_MANIFEST_DIRjoin rather than reaching across crates.scripts/update_framework_packages.shandcargo run --bin iota-framework-snapshotare unchanged — they write the file throughupdate_bytecode_snapshot_manifesteither way. CODEOWNERS and.github/crates-filters.ymlgain matching entries for the new crate.Two smaller consequences:
SnapshotPackage::from_system_package_metadatacannot stay an inherent impl once the type lives in another crate, so it becomes thesnapshot_packagefunction iniota-framework-snapshot. Its only caller is the snapshot binary.check_if_manifest_was_modifiedincompatibility_tests.rsmatched the manifest by path substring. Left alone it would have silently stopped matching, socheck_manifest_against_tomlswould have quietly turned into a no-op. It now matches the new path — verified by the test going from 0.05s (skipped) to 28s (cloning and checking out each revision).Build graph effect
Measured with
cargo metadata, workspace crates only, excludingcfg(msim)andwasm32-only edges:iota-package-managementiota-move-buildiota-moveiota-move-lspiota-simulatoriota-source-validationiota-source-validation-serviceThe longest compilation chain is unchanged at 16 — none of these crates sit on it. This shortens the tail that the Move build path waits for.
Links to any relevant issues
Related to #12234.
How the change has been tested
Basic tests (linting, compilation, formatting, unit/integration tests)
Patch-specific tests (correctness, functionality coverage)
I have added tests that prove my fix is effective or that my feature works
I have checked that new and existing unit tests pass locally with my changes
cargo check --workspace --all-targets: zero errors, zero warningscargo nextest run -p iota-framework-snapshot -p iota-package-management: 8 passed, 0 failed — includingcheck_manifest_against_tomls, which validates every historical revision in the manifest against itsMove.toml, and theiota-package-managementversion-table tests, which prove the build script still reads the manifest correctlycargo machete,scripts/cargo_sort/run_consolidate.sh,cargo clippy --all-targetsandcargo +nightly fmtall clean🤖 Generated with Claude Code