Semantic Diff

#9238 Remove the Rust build system

8 commits

7c5e704f47fe43ce799da4ff2bfe2199de9a175c..pr-9238

06d6bb558 · cknitt + Claude · Nov 05, 2026, 17:08 UTC

Check rewatch output against snapshots instead of Rust rewatch

The check_*.sh scripts compared the OCaml build system with the Rust one, which is about to be removed. They now run rescript alone: each case keeps its expected outcome, and output the scripts used to compare with Rust's is compared with snapshots under rewatch-ocaml/tests/snapshots, written with UPDATE_SNAPSHOTS=1. Paths are replaced by placeholders, line endings and separators normalized, so one snapshot serves Unix and Windows.

Review

  • Do the snapshots still describe Rust's output? Yes: before removing Rust, every snapshot was checked against the Rust executable too; the verbose, interactive and command-validation snapshots match it. Remaining differences are the documented ones, whose cases already expected OCaml's outcome.
  • Which checks were dropped? Only Rust-only ones: the three missing-RESCRIPT_BSC_EXE cases (OCaml ignores the variable), Rust's exit codes and error wording. Config cases named for Rust's last-key-wins behavior (duplicate-last) were renamed, since duplicates are rejected.
8789a233b · cknitt + Claude · Nov 05, 2026, 17:08 UTC

Remove the Rust build system

rescript has run the OCaml build system since 13.0.0-alpha.7; the Rust implementation only shipped as rescript-rust for comparison. This removes its sources, the rescript-rust executable and launcher, the Cargo build in the Makefile and CI, the Rust/OCaml performance gates, Rust formatting and version constraints, and the Rust toolchain from the dev container. rewatch/ keeps the integration suite and the behavior documents; the implementation stays in rewatch-ocaml/.

70a624238 · cknitt + Claude · Nov 05, 2026, 18:23 UTC

Make the command-validation snapshots hold in CI

CI sets CLICOLOR_FORCE=1, which colored the redirected-output cases, so the script now unsets it. On Windows the runner's TEMP is an 8.3 short path, so check_snapshot also replaces the explicit long spelling that bsc prints.

0c1b07df0 · cknitt + Claude · Nov 05, 2026, 18:34 UTC

Sort verbose events in the C locale

macOS CI sorts with a locale that puts compile dirty: before DEBUG:, so the sorted events did not match the snapshot written in the C locale.

e93d8285c · cknitt + Claude · Nov 05, 2026, 18:39 UTC

Normalize escaped Windows paths in snapshots

Some diagnostics print a path as a quoted string, so on Windows its backslashes are doubled (C:\\Users\\...). check_snapshot now replaces that spelling of each root and turns escaped separators into slashes as well.

ab6306d91 · cknitt + Claude · Nov 05, 2026, 19:23 UTC

Keep backslashes in Unix snapshots and share path normalization

Review of #9238: check_snapshot turned every backslash into a slash, so a snapshot could not hold an escape such as \n, and a path printed with backslashes on Unix went unnoticed. It now rewrites separators on Windows only. The command-validation checks that grep for paths (normalize_project_path, require_error_contains) use the same normalization through the new normalize_paths helper, instead of deriving short paths from USERPROFILE.

09736cb85 · cknitt + Claude · Nov 05, 2026, 19:23 UTC

Drop the remaining Rust settings from rewatch tests

Review of #9238: the integration tests still set RUST_BACKTRACE and RAYON_NUM_THREADS, which rescript ignores. The two tests that ran Rust on one thread now set REWATCH_COMPILER_DOMAINS=1, so they again check scheduling with a single compiler worker. Comments shortened when the Rust mentions were removed are rewrapped.

290323e96 · cknitt + Claude · Nov 05, 2026, 19:45 UTC

Accept every regular expression Re can match in --filter

--filter rejected valid Perl constructs, such as \Q...\E, \Z and [z-a], because Rust's regex crate read them differently. With the Rust build system gone, that parity check only refuses valid filters, so the filter now accepts what Re's Perl syntax parses and still rejects what Re cannot match, such as backreferences.