rescript-tools migrate refuse a file that changed since its last build instead of migrating it with stale locations.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
- No effect
- Output: unchanged
- Tests
- other~ tests/tools_tests/test.sh
- Changelog fragment changes/migrate-stale-build.fix.md
- No committed generated JS changes
4 files ยท +46 โ17 ยท changelog 1 ยท tests 1 ยท tools 2
| A | changes/migrate-stale-build.fix.md | +1 | โ0 |
| M | tests/tools_tests/test.sh | +18 | โ0 |
| M | tools/src/migrate.md | +1 | โ1 |
| M | tools/src/migrate.ml | +26 | โ16 |