ocaml-migrate-parsetree icon indicating copy to clipboard operation
ocaml-migrate-parsetree copied to clipboard

Does not compile with multicore-ocaml

Open anmolsahoo25 opened this issue 5 years ago • 7 comments

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 avatar Jan 10 '20 08:01 anmolsahoo25

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

anmolsahoo25 avatar Jan 10 '20 08:01 anmolsahoo25

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.

ghost avatar Jan 13 '20 12:01 ghost

@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!

shakthimaan avatar Jun 20 '20 20:06 shakthimaan

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.

ghost avatar Jun 22 '20 13:06 ghost

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.

avsm avatar Jun 22 '20 13:06 avsm

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.

ghost avatar Jun 22 '20 15:06 ghost

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?

Termina1 avatar Jul 20 '21 11:07 Termina1