Build failure on a type error
rolfmorel opened this issue · 1 comments
rolfmorel commented
I am trying to build the L2 project and facing type errors during compilation. I have set the compiler version to 4.06.0, as in issue #3, and the dependencies seem to install fine, but am getting the following error:
$ jbuilder build @install
ocamlc src/.l2.eobjs/util.{cmi,cmo,cmt} (exit 2)
(cd _build/default && /home/rolf/.opam/4.06.0/bin/ocamlc.opt -w -40 -g -bin-annot -I src/.l2.eobjs -I /home/rolf/.opam/4.06.0/lib/base -I /home/rolf/.opam/4.06.0/lib/base/caml -I /home/rolf/.opam/4.06.0/lib/base/md5 -I /home/rolf/.opam/4.06.0/lib/base/shadow_stdlib -I /home/rolf/.opam/4.06.0/lib/bin_prot -I /home/rolf/.opam/4.06.0/lib/bin_prot/shape -I /home/rolf/.opam/4.06.0/lib/biniou -I /home/rolf/.opam/4.06.0/lib/bytes -I /home/rolf/.opam/4.06.0/lib/core -I /home/rolf/.opam/4.06.0/lib/core_kernel -I /home/rolf/.opam/4.06.0/lib/core_kernel/base_for_tests -I /home/rolf/.opam/4.06.0/lib/easy-format -I /home/rolf/.opam/4.06.0/lib/fieldslib -I /home/rolf/.opam/4.06.0/lib/jane-street-headers -I /home/rolf/.opam/4.06.0/lib/oUnit -I /home/rolf/.opam/4.06.0/lib/ocaml/threads -I /home/rolf/.opam/4.06.0/lib/parsexp -I /home/rolf/.opam/4.06.0/lib/ppx_assert/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_bench/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_compare/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_expect/collector -I /home/rolf/.opam/4.06.0/lib/ppx_expect/common -I /home/rolf/.opam/4.06.0/lib/ppx_expect/config -I /home/rolf/.opam/4.06.0/lib/ppx_hash/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_inline_test/config -I /home/rolf/.opam/4.06.0/lib/ppx_inline_test/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_sexp_conv/runtime-lib -I /home/rolf/.opam/4.06.0/lib/sexplib -I /home/rolf/.opam/4.06.0/lib/sexplib/unix -I /home/rolf/.opam/4.06.0/lib/sexplib0 -I /home/rolf/.opam/4.06.0/lib/spawn -I /home/rolf/.opam/4.06.0/lib/splittable_random -I /home/rolf/.opam/4.06.0/lib/stdio -I /home/rolf/.opam/4.06.0/lib/typerep -I /home/rolf/.opam/4.06.0/lib/variantslib -I /home/rolf/.opam/4.06.0/lib/yojson -no-alias-deps -o src/.l2.eobjs/util.cmo -c -impl src/util.pp.ml)
File "src/util.ml", line 68, characters 44-55:
Error: The function applied to this argument has type
compare:('a -> 'a -> int) -> 'a list
This argument cannot be applied with label ~cmp
This error I can fix by removing the label. With this fix the compilation errors out with the following output:
$ jbuilder build @install
ocamlc src/.l2.eobjs/expr.{cmi,cmo,cmt}
File "src/expr.ml", line 80, characters 17-26:
Warning 3: deprecated: Not_found
[since 2018-02] Instead of raising [Not_found], consider using [raise_s] with an
informative error message. If code needs to distinguish [Not_found] from other
exceptions, please change it to handle both [Not_found] and [Not_found_s]. Then, instead
of raising [Not_found], raise [Not_found_s] with an informative error message.
ocamlc src/.l2.eobjs/structure.{cmi,cmo,cmt} (exit 2)
(cd _build/default && /home/rolf/.opam/4.06.0/bin/ocamlc.opt -w -40 -g -bin-annot -I src/.l2.eobjs -I /home/rolf/.opam/4.06.0/lib/base -I /home/rolf/.opam/4.06.0/lib/base/caml -I /home/rolf/.opam/4.06.0/lib/base/md5 -I /home/rolf/.opam/4.06.0/lib/base/shadow_stdlib -I /home/rolf/.opam/4.06.0/lib/bin_prot -I /home/rolf/.opam/4.06.0/lib/bin_prot/shape -I /home/rolf/.opam/4.06.0/lib/biniou -I /home/rolf/.opam/4.06.0/lib/bytes -I /home/rolf/.opam/4.06.0/lib/core -I /home/rolf/.opam/4.06.0/lib/core_kernel -I /home/rolf/.opam/4.06.0/lib/core_kernel/base_for_tests -I /home/rolf/.opam/4.06.0/lib/easy-format -I /home/rolf/.opam/4.06.0/lib/fieldslib -I /home/rolf/.opam/4.06.0/lib/jane-street-headers -I /home/rolf/.opam/4.06.0/lib/oUnit -I /home/rolf/.opam/4.06.0/lib/ocaml/threads -I /home/rolf/.opam/4.06.0/lib/parsexp -I /home/rolf/.opam/4.06.0/lib/ppx_assert/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_bench/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_compare/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_expect/collector -I /home/rolf/.opam/4.06.0/lib/ppx_expect/common -I /home/rolf/.opam/4.06.0/lib/ppx_expect/config -I /home/rolf/.opam/4.06.0/lib/ppx_hash/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_inline_test/config -I /home/rolf/.opam/4.06.0/lib/ppx_inline_test/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_sexp_conv/runtime-lib -I /home/rolf/.opam/4.06.0/lib/sexplib -I /home/rolf/.opam/4.06.0/lib/sexplib/unix -I /home/rolf/.opam/4.06.0/lib/sexplib0 -I /home/rolf/.opam/4.06.0/lib/spawn -I /home/rolf/.opam/4.06.0/lib/splittable_random -I /home/rolf/.opam/4.06.0/lib/stdio -I /home/rolf/.opam/4.06.0/lib/typerep -I /home/rolf/.opam/4.06.0/lib/variantslib -I /home/rolf/.opam/4.06.0/lib/yojson -no-alias-deps -o src/.l2.eobjs/structure.cmo -c -impl src/structure.pp.ml)
File "src/structure.ml", line 57, characters 23-25:
Error: This expression has type
compare:(Ast.example *
([> `List of Ast.expr Core.List.t
| `Tree of Ast.expr Ast.Tree.t ]
as 'a)
Util.SMap.t Core.ref ->
Ast.example * 'a Util.SMap.t Core.ref -> int) ->
(Ast.example * 'a Util.SMap.t Core.ref) Core.List.t
but an expression was expected of type
(Example.t * Ast.expr Util.Ctx.t) list
ocamlopt src/.l2.eobjs/expr.{cmx,o}
File "src/expr.ml", line 80, characters 17-26:
Warning 3: deprecated: Not_found
[since 2018-02] Instead of raising [Not_found], consider using [raise_s] with an
informative error message. If code needs to distinguish [Not_found] from other
exceptions, please change it to handle both [Not_found] and [Not_found_s]. Then, instead
of raising [Not_found], raise [Not_found_s] with an informative error message.
Let me know if I can provide you with any additional info in order to get the compilation to work.
jfeser commented
Should be fixed now. Thanks for the report!