Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge in upstream main for 5.2 merge #82

Merged

Conversation

ncik-roberts
Copy link
Contributor

@ncik-roberts ncik-roberts commented Aug 14, 2024

Merges the HEAD of the parent PR #81 with a reasonably recent upstream/main. Fix all tests.

Caveat: I probably should have done the merge with upstream/v5.1-502, which is the tagged version for 5.2. I skimmed through the commits to main since then (there are about 20) and almost all of them are bugfixes. There is a new feature: ocaml/merlin#1745, but I'm not worried about it as it doesn't touch existing code paths.

Note for next version bump: be sure to merge with the tagged version! I don't think we hit any difficulty in this merge, but that's half by luck.

This merge was difficult. The last merge was done with https://github.com/ocaml/merlin/tree/v4.14-501, which does not share history with upstream main (or v5.1-502). This means that git merge creates a lot of spurious conflicts.

The way I created this PR was as follows:

  1. I created a parallel branch B where I checked out to v4.14-501, and committed a change bringing the files to the same state as upstream/main.
  2. I then merged B with the HEAD of 5.2 Merge #81.
  3. I returned to the branch of the present PR, and merged with upstream/main to make the branches share history (6b3f6af).
  4. I then made two further commits: (i) a commit making files look like B after step 2 (240f8aa), and (ii) a series of commits fixing up the conflicts and fixing the tests.

I expect that future merges will be less painful — I think we'll just be able to run git merge with the tagged version.

The reason I went to all this effort is because it halved the number of conflicts. There are about 400 conflicts in B, and about 800 conflicts that I would have had to fix if I had just merged with upstream/main from the start.

There might have been a better way to do this. Let me know if you think of one.

Instructions for reviewer

Review this diff: https://github.com/janestreet/merlin-jst/pull/82/files/6b3f6af65d1088e1c7d66aec170b90ed1a50427e..150f7876a9dbf4c50674be292a330b2b5df0afd3

This is the diff between:

  • The conflicts created by merging with upstream/main
  • The final resolution.

Explanation of three-way diff:

  • The top third is the version of 5.2 merlin as of 5.2 Merge #81.
  • The middle third is...I don't really know. I really didn't look at this. It's just the auto-detected merge base, which isn't useful here.
  • The bottom third is upstream merlin as of a recent-ish upstream main (just after v5.1-502).

I usually take the upper third of the diff. Places where I don't are notable.

TODO: We should scan through the diff between merlin-jst's implementation of type-checking and flambda-backend's.

Notable diffs

  • src/ocaml/typing/typecore.ml drops upstream's approach for recovery when typing functions. Our approach is slightly different. We should make them converge, but this PR is not the place to do it: it's tricky, and there's a lot going on in this PR already.
  • The lack of diff in the overall PR for occurrences-related files is important. @liam923 says this is the right outcome.

voodoos added 30 commits May 2, 2024 18:32
Merlin has no use for the `-cmi-file` flag but should not reject it.
(35fdd0226e2e05a1a8244ecfec780b563b23b59c)
rev: 02b39701d81ef4d4f5824a2d018e6387b1eeb5a7
- enable or disable aliases traversal
- mark approximated results as such
- improve constr / labels cases + traverse aliases
- refactor locate and env_lookup
FIXME Merlin recovery and other feature related to functions are probably broken
and expected locations improvements
Copy link
Contributor

@liam923 liam923 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good to me

tests/test-dirs/hidden-deps/dash-h.t Outdated Show resolved Hide resolved
tests/test-dirs/locate/dune Outdated Show resolved Hide resolved
tests/test-dirs/type-enclosing/underscore-ids.t Outdated Show resolved Hide resolved
src/analysis/construct.ml Outdated Show resolved Hide resolved
src/analysis/locate.ml Outdated Show resolved Hide resolved
src/frontend/query_commands.ml Outdated Show resolved Hide resolved
src/ocaml/merlin_specific/browse_raw.ml Show resolved Hide resolved
src/ocaml/merlin_specific/tast_helper.ml Show resolved Hide resolved
src/kernel/mconfig.ml Outdated Show resolved Hide resolved
src/kernel/mconfig.ml Outdated Show resolved Hide resolved
@ncik-roberts
Copy link
Contributor Author

Thanks for the review. It should be back to you @liam923

Copy link
Contributor

@liam923 liam923 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the CI stuff, things look good to me

.github/dependabot.yml Outdated Show resolved Hide resolved
@ncik-roberts
Copy link
Contributor Author

I'll leave instructions for how to merge this.

ncik-roberts and others added 20 commits August 23, 2024 13:04
* Add test using cms files

* Add -H flag

* Add test demonstrating need for -H flag

* Fixup based on pr feedback
* Make shape reduction use shapes from read files

* Incorporate pr feedback
* Add UNIT_NAME_FOR directive

* Promote tests

* Capitalize unitname to match UNIT_NAME behavior

* Fix stray grep

* Add Misc.unitname for wrapping prefix case

* Fix WRAPPING_PREFIX removals

* Rename tag_error

* Use rev_split_words

* Add error message to merlin_dot_protocol parser
* Import ocaml sources for ocaml-flambda/flambda-backend@af06aef5b8

* Import OCaml for minus-23

* Update magic numbers

* Fix compilation errors
* Import ocaml sources for ocaml-flambda/flambda-backend@a54ec041f

* Automatic merges

* Bump magic numbers

* Fix build error in profile.ml

* Promote tests

* Add ignored flags
…of github.com:janestreet/merlin-jst into merge-with-upstream-merlin-round-2-of-conflict-fixing
…nd-2-of-conflict-fixing

5.2 merge: round 2 of conflict fixing
@ncik-roberts ncik-roberts merged commit ece8c65 into merge-with-flambda-backend-5.2-merge Sep 23, 2024
1 of 2 checks passed
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.

10 participants