Replace CPPO browser branches with platform modules - #8541
Conversation
Replace BROWSER conditionals with Dune-selected ordinary modules. The browser profile selects playground implementations while every other profile selects native implementations, keeping dev and release builds functionally identical and documenting the convention where it is applied. Keep the platform boundary narrow: native builds use C primitives and artifact persistence, while the playground uses JavaScript-compatible primitives and no-op persistence. Keep shared Cmt_format behavior in an ordinary module and use generated source rules instead of virtual libraries, which trigger a Dune internal error with the compiler's unwrapped libraries and break @check and ocaml-lsp. Remove CPPO from compiler sources that no longer need preprocessing, remove the unused hash_small_int test hook, and retain CPPO only for genuine type-specialization templates. Update architecture guidance and the error-variant catalog for the new source layout. Signed-off-by: Cristiano Calcagno <cristianoc@users.noreply.github.com>
14821f2 to
b0c5f42
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8541 +/- ##
==========================================
+ Coverage 74.70% 74.78% +0.08%
==========================================
Files 460 466 +6
Lines 62389 62821 +432
==========================================
+ Hits 46608 46983 +375
- Misses 15781 15838 +57
🚀 New features to boost your workflow:
|
rescript
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-8541 |
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
cknitt
left a comment
There was a problem hiding this comment.
Great to get rid of CPPO! Platform-specific modules are a much better mechanism. 🎉
Replace BROWSER conditionals with Dune-selected ordinary modules. The browser profile selects playground implementations while every other profile selects native implementations, keeping dev and release builds functionally identical and documenting the convention where it is applied.
Keep the platform boundary narrow: native builds use C primitives and artifact persistence, while the playground uses JavaScript-compatible primitives and no-op persistence. Keep shared Cmt_format behavior in an ordinary module and use generated source rules instead of virtual libraries, which trigger a Dune internal error with the compiler's unwrapped libraries and break @check and ocaml-lsp.
Remove CPPO from compiler sources that no longer need preprocessing, remove the unused hash_small_int test hook, and retain CPPO only for genuine type-specialization templates. Update architecture guidance and the error-variant catalog for the new source layout.
Signed-off-by: Cristiano Calcagno cristianoc@users.noreply.github.com
Stack created with GitHub Stacks CLI • Give Feedback 💬