Skip to content

Convert BuildPointers to the shared LibSnapshot (drop the local deployTag/freezeSnapshot copy) #2809

Description

@thedavidmeister

Context

LibSnapshot now owns the per-release snapshot canon in rain-sol-codegen (rainlanguage/rain.sol.codegen#26, closing #25): deployTag(vm) and freezeSnapshot(vm, contractNames), with the immutability guard that reverts rather than rewrite a frozen record without a [package].version bump.

It was upstreamed because the canon was copy-pasted across four repos and had already divergeddeployTag() byte-identical in three, the freezing half in three different shapes, and the guard present in only half of them.

The change

script/BuildPointers.sol in this repo carries its own copy. Replace it:

  1. Import LibSnapshot from rain-sol-codegen (this repo already depends on the package — BuildPointers.sol imports LibFs/LibCodeGen from it).
  2. Delete the local deployTag() / freezing code.
  3. Call LibSnapshot.freezeSnapshot(vm, names) with the generated contract names.
  4. Ensure foundry.toml fs_permissions grants { access = "read", path = "foundry.toml" } (needed by deployTag).

Verification

Regenerating must be a no-op against the existing committed snapshots — same tag dir, byte-identical files. If anything changes, that is a real finding, not a formatting difference: stop and surface it rather than committing the diff.

Blocked on

rain-sol-codegen needs a version bump + publish — LibSnapshot is on main but the published package is still 0.1.0, so there is nothing to import yet.

This repo specifically

Carries both deployTag() and freezeSnapshot(), and is the copy the guard was taken from — so this is the straight swap with no behaviour change. 60 frozen tag dirs under src/generated/, so the no-op regeneration check matters here more than anywhere: a diff in any of those is a corrupted historical record.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions