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

feat: upgrade core to OCaml 5.2 #1074

Merged
merged 20 commits into from
Mar 18, 2024
Merged

feat: upgrade core to OCaml 5.2 #1074

merged 20 commits into from
Mar 18, 2024

Conversation

anmonteiro
Copy link
Member

@anmonteiro anmonteiro commented Feb 25, 2024

fixes #1071

@anmonteiro anmonteiro marked this pull request as ready for review March 12, 2024 01:34
(modules_without_implementation annot))))
(modules_without_implementation
annot
(:include ../gen/optional_5_2_modules.txt)))))
Copy link
Member Author

Choose a reason for hiding this comment

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

this is the reason why we have to bump the dune lang version to 3.13

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@jchavarri jchavarri left a comment

Choose a reason for hiding this comment

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

I mostly have questions 🙃

@@ -26,6 +26,7 @@ jobs:
# - windows-latest # for some reason windows build is not picking dune 3.5
ocaml-compiler:
- ocaml-base-compiler.5.1.1
# - 'ocaml-base-compiler.5.2.0~alpha1'
Copy link
Member

Choose a reason for hiding this comment

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

Will this be uncommented before merging?

Copy link
Member Author

Choose a reason for hiding this comment

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

No. The compiler libs submodule is on 5.1 according to the proposal I shared: have melange remain on 5.1 but ready to integrate the 5.2 submodule once OCamlformat and odoc have compatible releases.

@@ -10,6 +10,7 @@
(* *)
(***********************************************************************)

open Melange_compiler_libs
Copy link
Member

Choose a reason for hiding this comment

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

Why was this needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

otherwise it doesn't know about coming from Melange_compiler_libs.Unit_info.

(Unit_info.make ~check_modname:false ~source_file:fname outputprefix
|> Unit_info.cmi)
#else
modulename
(Artifact_extension.append_extension outputprefix Cmi)
Copy link
Member

Choose a reason for hiding this comment

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

Why can't Artifact_extension be used in 5.2?

Copy link
Member Author

Choose a reason for hiding this comment

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

The signature of the upstream functions changed to take a new Unit_info type

@@ -1903,7 +1903,7 @@ class ['loc] mapper =
updated to override those individually. *)
method function_expression_or_method loc (stmt : ('loc, 'loc) Ast.Function.t) =
this#function_ loc stmt
[@@alert deprecated "Use either function_expression or class_method"]
(* [@@alert deprecated "Use either function_expression or class_method"] *)
Copy link
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Member Author

Choose a reason for hiding this comment

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

5.2 errors on these misplaced attributes ocaml/ocaml#12451

Comment on lines +190 to +191
Ocaml_common.Location.input_lexbuf := Some lexbuf;
Location.input_lexbuf := Some lexbuf;
Copy link
Member

Choose a reason for hiding this comment

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

I saw these used in Ast_io too, is this something new that 5.2 requires? And does it affect somehow the older versions?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is related to ocaml/ocaml#12991

Copy link
Member Author

@anmonteiro anmonteiro Mar 18, 2024

Choose a reason for hiding this comment

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

basically if we don't do this, errors won't include source code quotations.

@anmonteiro anmonteiro merged commit 8efac91 into main Mar 18, 2024
4 checks passed
@anmonteiro anmonteiro deleted the anmonteiro/5.2-upgrade branch March 18, 2024 22:48
@anmonteiro anmonteiro mentioned this pull request Mar 29, 2024
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.

OCaml 5.2 support
2 participants