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

OCaml 5.3 support #367

Closed
kit-ty-kate opened this issue Dec 12, 2024 · 3 comments
Closed

OCaml 5.3 support #367

kit-ty-kate opened this issue Dec 12, 2024 · 3 comments

Comments

@kit-ty-kate
Copy link

Using OCaml 5.3, archetype fails to build with:

#=== ERROR while compiling archetype.1.5.2 ====================================#
# context              2.4.0~alpha1~dev | linux/x86_64 | ocaml-variants.5.3.0+trunk | file:///home/opam/opam-repository
# path                 ~/.opam/5.3/.opam-switch/build/archetype.1.5.2
# command              ~/.opam/5.3/bin/dune build -p archetype -j 1 @install
# exit-code            1
# env-file             ~/.opam/log/archetype-14-c06b60.env
# output-file          ~/.opam/log/archetype-14-c06b60.out
### output ###
# (cd _build/default && .ppx/6275b1ab6a7c2471cccae8471136173f/ppx.exe --cookie 'library-name="archetype"' -o src/ast.pp.ml --impl src/ast.ml -corrected-suffix .ppx-corrected -diff-cmd - -dump-ast)
# File "src/ast.ml", line 588, characters 2-8:
# 588 |   effect          : instruction option;
#         ^^^^^^
# Error: Syntax error
# (cd _build/default && .ppx/6275b1ab6a7c2471cccae8471136173f/ppx.exe --cookie 'library-name="archetype"' -o src/gen_decompile.pp.ml --impl src/gen_decompile.ml -corrected-suffix .ppx-corrected -diff-cmd - -dump-ast)
# File "src/gen_decompile.ml", line 429, characters 7-13:
# 429 |   type effect = [
#              ^^^^^^
# Error: Syntax error
# (cd _build/default && .ppx/6275b1ab6a7c2471cccae8471136173f/ppx.exe --cookie 'library-name="archetype"' -o src/gen_model.pp.ml --impl src/gen_model.ml -corrected-suffix .ppx-corrected -diff-cmd - -dump-ast)
# File "src/gen_model.ml", line 1493, characters 48-54:
# 1493 |       match transaction.transition, transaction.effect with
#                                                        ^^^^^^
# Error: Syntax error
# (cd _build/default && .ppx/6275b1ab6a7c2471cccae8471136173f/ppx.exe --cookie 'library-name="archetype"' -o src/model.pp.ml --impl src/model.ml -corrected-suffix .ppx-corrected -diff-cmd - -dump-ast)
# File "src/model.ml", line 4196, characters 5-11:
# 4196 | type effect = Eadded of ident | Eremoved of ident | Eupdated of ident
#             ^^^^^^
# Error: Syntax error
# (cd _build/default && .ppx/6275b1ab6a7c2471cccae8471136173f/ppx.exe --cookie 'library-name="archetype"' -o src/printer_ast.pp.ml --impl src/printer_ast.ml -corrected-suffix .ppx-corrected -diff-cmd - -dump-ast)
# File "src/printer_ast.ml", line 1155, characters 98-104:
# 1155 |     (pp_option (fun fmt x -> Format.fprintf fmt "effect {@\n  @[%a@]@\n}@\n" pp_instruction x)) t.effect
#                                                                                                          ^^^^^^
# Error: Syntax error
# (cd _build/default && .ppx/6275b1ab6a7c2471cccae8471136173f/ppx.exe --cookie 'library-name="archetype"' -o src/printer_pt.pp.ml --impl src/printer_pt.ml -corrected-suffix .ppx-corrected -diff-cmd - -dump-ast)
# File "src/printer_pt.ml", line 935, characters 34-35:
# 935 | let pp_to fmt ((to_, when_, effect) : (lident * expr option * expr option)) =
#                                         ^
# Error: Syntax error
# (cd _build/default && .ppx/6275b1ab6a7c2471cccae8471136173f/ppx.exe --cookie 'library-name="archetype"' -o src/typing.pp.ml --impl src/typing.ml -corrected-suffix .ppx-corrected -diff-cmd - -dump-ast)
# File "src/typing.ml", line 6232, characters 74-75:
# 6232 | let for_effect ~(ret : A.type_ option) (kind : ekind) (env : env) (effect : PT.expr) =
#                                                                                  ^
# Error: Syntax error
@guillaumeduhamel
Copy link
Contributor

guillaumeduhamel commented Dec 12, 2024

Thank you for reporting this issue!

I’ve just pushed a fix to the dev branch. It seems that effect has become a reserved word in ocaml, which was causing the build errors. Could you confirm if the fix resolves the problem on your end?

Additionally, do you think this warrants an immediate release, or can it wait for the next scheduled one? Let me know your thoughts.

Best regards,

@kit-ty-kate
Copy link
Author

I can confirm that the fix_ocaml5 branch compiles correctly with OCaml 5.3. Thanks!

Concerning a release, i would almost always encourage an early release as it allows more testing to happen early as well as allowing users to install your package using the default (latest) compiler in opam.

The Release Candidate of 5.3 is planned to be released next week.

@guillaumeduhamel
Copy link
Contributor

Thank you for taking the time to verify compatibility with OCaml 5.3 and for reporting this issue.

We’ve submitted a pull request to fix the problem: ocaml/opam-repository#27127.

I’ll close this issue as it’s now resolved. Thanks again for letting us know!

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

No branches or pull requests

2 participants