ocaml-flambda / flambda-backend

The Flambda backend project for OCaml
105 stars 76 forks source link

ppxlib and merlin-lib do not compile #2858

Open patrick-nicodemus opened 2 months ago

patrick-nicodemus commented 2 months ago

I installed this compiler using this message: https://github.com/ocaml-flambda/flambda-backend/blob/main/HACKING.md#testing-the-compiler-built-locally-with-opam-new-method

I was able to install it successfully and download multiple packages.

While trying to install ppxlib, I encountered the following error message. (The same error is obtained with earlier versions of ppxlib such as 0.30.0.)

#=== ERROR while compiling ppxlib.0.33.0 ======================================#
# context     2.1.6 | linux/x86_64 | ocaml-variants.5.1.1+flambda2 | https://opam.ocaml.org#eceb4d83610133a48b62daa36665ce1292646561
# path        ~/opam/5.1.1+flambda2/.opam-switch/build/ppxlib.0.33.0
# command     ~/opam/opam-init/hooks/sandbox.sh build dune build -p ppxlib -j 7 @install
# exit-code   1
# env-file    ~/opam/log/ppxlib-204623-f5c3ae.env
# output-file ~/opam/log/ppxlib-204623-f5c3ae.out
### output ###
# (cd _build/default && /home/patrick/opam/5.1.1+flambda2/bin/ocamlc.opt -w -9 -g -bin-annot -I astlib/.astlib.objs/byte -I /home/patrick/opam/5.1.1+flambda2/lib/ocaml-compiler-libs/common -I /home/patrick/opam/5.1.1+flambda2/lib/ocaml/compiler-libs -no-alias-deps -open Astlib__ -o astlib/.astlib.objs/byte/astlib__Ast_501.cmo -c -impl astlib/ast_501.pp.ml)
# File "astlib/ast_501.ml", lines 471-478, characters 2-5:
# Error: This variant or record definition does not match that of type
#          Parsetree.value_description
#        An extra field, pval_modalities, is provided in the original definition.

I am using ocaml-compiler-libs version 12.4, apparently the correct one from the flambda-repository.

<><> Version-specific details <><><><><><><><><><><><><><><><><><><><><><><><><>
version      v0.12.4
repository   flambda-backend
url.src      "https://github.com/janestreet/ocaml-compiler-libs/releases/download/v0.12.4/ocaml-compiler-libs-v0.12.4.tbz"
url.checksum "sha256=4ec9c9ec35cc45c18c7a143761154ef1d7663036a29297f80381f47981a07760"
             "sha512=978dba8dfa61f98fa24fda7a9c26c2e837081f37d1685fe636dc19cfc3278a940cf01a10293504b185c406706bc1008bc54313d50f023bcdea6d5ac6c0788b35"

I also was unable to compile merlin-lib.

#=== ERROR while compiling merlin-lib.4.16-501 ================================#
# context     2.1.6 | linux/x86_64 | ocaml-variants.5.1.1+flambda2 | https://opam.ocaml.org#eceb4d83610133a48b62daa36665ce1292646561
# path        ~/opam/5.1.1+flambda2/.opam-switch/build/merlin-lib.4.16-501
# command     ~/opam/opam-init/hooks/sandbox.sh build dune build -p merlin-lib -j 7
# exit-code   1
# env-file    ~/opam/log/merlin-lib-205395-a9e862.env
# output-file ~/opam/log/merlin-lib-205395-a9e862.out
### output ###
# (cd _build/default && /home/patrick/opam/5.1.1+flambda2/bin/ocamlc.opt -w -40 -g -bin-annot -I src/ocaml/compression/.ocaml_compression.objs/byte -I /home/patrick/opam/5.1.1+flambda2/lib/ocaml/compiler-libs -no-alias-deps -o src/ocaml/compression/.ocaml_compression.objs/byte/ocaml_compression.cmo -c -impl src/ocaml/compression/ocaml_compression.ml)
# File "src/ocaml/compression/ocaml_compression.ml", line 3, characters 8-19:
# 3 | include Compression
#             ^^^^^^^^^^^
# Error: Unbound module Compression

I am aware that this project is under ongoing development and so breakages like this are to be expected, but it is my understanding that internal engineers at Jane Street are using some of these features, so I imagine there is some recent version of the compiler which is able to install ppxlib. If anybody can link to a most recent working/stable commit, I will appreciate it!

copy commented 12 hours ago

Same problem here. There's merlin-jst, but it fails with the same error ("Unbound module Compression").

Additionally, the current HACKING.md mentions a 5.2.0+flambda2 switch, which isn't available in opam-repository (neither ocaml/opam-repository nor janestreet/opam-repository)