ocaml-ppx / ocaml-migrate-parsetree

DEPRECATED. See https://ocaml.org/changelog/2023-10-23-omp-deprecation. Convert OCaml parsetrees between different major versions
Other
87 stars 43 forks source link

Does not compile with multicore-ocaml #89

Open anmolsahoo25 opened 4 years ago

anmolsahoo25 commented 4 years ago

Currently investigating why it does not build with multicore-ocaml trunk.

This is the error message

File "src/ast_406.ml", line 237, characters 2-1773:
Error: This variant or record definition does not match that of type
         Parsetree.pattern_desc
       Fields number 17 have different names, Ppat_effect and Ppat_extension.

Any help would be appreciated. Thanks!

anmolsahoo25 commented 4 years ago

Got it. The compiler is trying to build the ast_406.ml, but multicore has changed the parsetree. Will try to fix it.

ghost commented 4 years ago

If you change the AST in the compiler, you will also need a separate branch of ocaml-migrate-parsetree with the modified AST. You might need that as well for other projects such as ppxlib and maybe individual ppx rewriters as well.

shakthimaan commented 4 years ago

@anmolsahoo25 I am hitting this error with Multicore OCaml 4.10.0 when building with dune-2.5.1:

# File "src/ast_410.ml", lines 248-303, characters 2-44:
# Error: This variant or record definition does not match that of type
#          Parsetree.pattern_desc
#        Constructors number 17 have different names, Ppat_effect and Ppat_extension.

Any suggestions for a fix? This package is a pre-requisite to build js_of_ocaml-compiler.3.6.0. Thanks!

ghost commented 4 years ago

The only possible explanation I can think of is that the Multicore branch modified the parsetree. If that's the case, then there is nothing omp can do.

avsm commented 4 years ago

We only add a single effect keyword into the language. Would it be practical to write a transformer that would convert from the multicore AST in to the conventional one? No ppxes actually use or generate the effect keyword, so we'd just want to 'downgrade' to the conventional OCaml AST so that existing ppxes work.

ghost commented 4 years ago

That seems complicated with the current OMP. Perhaps it will be easier once we have OMP2. But really, once we have Astlib that should become quite easy.

Termina1 commented 3 years ago

Hi, tried to migrate to multicore ocaml and got the message

# Error: This variant or record definition does not match that of type
#          Parsetree.pattern_desc
#        Constructors number 17 have different names, Ppat_effect and Ppat_extension.

I guess this is the same issue?