Skip to content

Synchronize misc.ml with the compiler#2059

Open
liam923 wants to merge 5 commits intoocaml:mainfrom
liam923:synchronize-misc
Open

Synchronize misc.ml with the compiler#2059
liam923 wants to merge 5 commits intoocaml:mainfrom
liam923:synchronize-misc

Conversation

@liam923
Copy link
Copy Markdown
Contributor

@liam923 liam923 commented Apr 15, 2026

The compiler's utils/misc.ml(i) module contains a large number of miscellaneous functions. Merlin has a similar file, src/utils/misc.ml(i), that shares a lot of code with the compiler's version, but it makes some small changes and also adds a few functions. Merlin's misc.ml(i) and the compiler's misc.ml(i) should be kept in sync with each other, just as other shared files should. However, they historically have not been kept in sync. There's a large amount of diff between the two files that is the result of changes to the compiler version not being applied to the Merlin version.

This PR brings these files back in sync by:

  1. Repairing the diff so that all diff is intentional.
  2. Moving src/utils/misc.ml to src/ocaml/utils/misc.ml so that the file is kept in sync in the future.

I suggest reviewing this PR by-commit:

  • 889d185 moves src/utils/misc.ml(i) to src/ocaml/utils/misc.ml(i), and it modifies some build rules and module paths to reflect this.
  • e899a9f moves src/utils/format_doc.ml(i) to src/ocaml/utils/format_doc.ml(i). Format_doc is a module that comes from the compiler, and as far as I can tell, is was only in src/utils rather than src/ocaml/utils to avoid a dependency cycle, as misc.ml depends on it.
  • 56c71d0 replaces the content of Merlin's misc.ml(i) with the content of the compiler's misc.ml(i) (at compiler revision 82bcb707388fa8df0126d43b1bfd16780ba5df9f). You shouldn't read the diff of this commit - you should just compare the file against the expected.
  • aef567d is the meat of this PR. It is the result of manually comparing Merlin's misc against the compilers and applying all diff that is meaningful.
  • ce1c397 rewrites a bunch of module paths in the compiler that changed due to the previous commits. This commit purely reduces the diff with the compiler - it simply reverts changes that were made due to the differences between Merlin's misc and the compiler's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant