Semantic Diff

#8916 Refuse to migrate files that changed since their last build

1 commit, rendered from its record.

Summary

RangeCommitsChangelogAreasJS output changesFormatsFailed checks
58da277de4eeba0d27f17c8056fd4c192e7b7ad9..pr-89161๐Ÿ› Bug fixtoolstestsdocs0none0

Changelog draft

๐Ÿ› Bug fix
  • Make rescript-tools migrate refuse a file that changed since its last build instead of migrating it with stale locations.

58da277de4eeba0d27f17c8056fd4c192e7b7ad9..pr-8916

35b1f7857 ยท Christoph Knittel ยท Oct 19, 2026

Refuse to migrate files that changed since their last build

๐Ÿ› Bug fixtoolstestsdocs

rescript-tools migrate takes the locations of deprecated uses from the file's .cmt/.cmti. When the source changed after that build, for example because the file was already migrated and the project was not rebuilt, the locations point at the wrong code: running the migration twice turned dict<dict<string>> into dict<dict<dict>>. The tool now compares the source digest recorded in the build artifact with the file on disk and fails with an error asking to rebuild when they differ. migrate-all counts such files as failed.

Diagnostic output

error: failed to run migration for /path/to/File.res because build
artifacts are out of date. rebuild the project and run the migration again
๐Ÿ› Bug fixMake rescript-tools migrate refuse a file that changed since its last build instead of migrating it with stale locations.
No effect
Output: unchanged
Tests
other~ tests/tools_tests/test.sh
4 files ยท +46 โˆ’17 ยท changelog 1 ยท tests 1 ยท tools 2
Achanges/migrate-stale-build.fix.md+1โˆ’0
Mtests/tools_tests/test.sh+18โˆ’0
Mtools/src/migrate.md+1โˆ’1
Mtools/src/migrate.ml+26โˆ’16
with Claude Opus 5.5