ocaml / odoc

Documentation compiler for OCaml and Reason
Other
313 stars 87 forks source link

Melange 1.0.0 documentation build failure. #983

Open tmcgilchrist opened 11 months ago

tmcgilchrist commented 11 months ago

Generated from voodoo using odoc 2.2.0

odoc: internal error, uncaught exception:
      Cmi_format.Error(_)
      Raised at Cmi_format.read_cmi in file "file_formats/cmi_format.ml", line 82, characters 6-21
      Called from Odoc_odoc__Depends.for_compile_step_cmi_or_cmti in file "src/odoc/depends.ml", line 37, characters 18-62
      Called from Dune__exe__Main.Depends.Compile.list_dependencies in file "src/odoc/bin/main.ml", line 689, characters 17-72
      Called from Cmdliner_term.app.(fun) in file "cmdliner_term.ml", line 24, characters 19-24
      Called from Cmdliner_eval.run_parser in file "cmdliner_eval.ml", line 34, characters 37-44
voodoo-do: internal error, uncaught exception:
           Failure("Error: run ['odoc' 'compile-deps'\n     'prep/universes/dedca8b145196cc6f91089b48ba61ab2/melange/1.0.0/lib/melange/runtime/melange/bs_stdlib_mini.cmi']: exited with 2")
           Raised at Stdlib.failwith in file "stdlib.ml", line 29, characters 17-33
           Called from Voodoo_lib__Odoc.compile_deps in file "src/voodoo/odoc.ml", line 37, characters 8-94
           Called from Dune__exe__Do.get_source_info in file "src/voodoo-do/do.ml", line 69, characters 12-34
           Called from Stdlib__List.map in file "list.ml", line 92, characters 20-23
           Called from Voodoo_lib__Compat.List.concat_map in file "src/voodoo/compat.ml" (inlined), line 2, characters 36-50
           Called from Dune__exe__Do.run in file "src/voodoo-do/do.ml", line 200, characters 12-64
           Called from Cmdliner_term.app.(fun) in file "cmdliner_term.ml", line 24, characters 19-24
           Called from Cmdliner_eval.run_parser in file "cmdliner_eval.ml", line 34, characters 37-44
"/bin/bash" "-c" "(OCAMLRUNPARAM=b opam exec -- /home/opam/voodoo-do -p melange -b ) && (shopt -s nullglob && ((tar -cvf compile/p/melange/1.0.0.tar compile/p/melange/1.0.0/*  && rm -R compile/p/melange/1.0.0/* && mv compile/p/melange/1.0.0.tar compile/p/melange/1.0.0/content.tar) || (echo 'Empty directory'))) && (mkdir -p linked && mkdir -p epoch-804419edbd92ec13bc06b69d15132959 && mv linked epoch-804419edbd92ec13bc06b69d15132959/) && (mkdir -p epoch-804419edbd92ec13bc06b69d15132959/linked/p/melange/1.0.0) && (shopt -s nullglob && ((tar -cvf epoch-804419edbd92ec13bc06b69d15132959/linked/p/melange/1.0.0.tar epoch-804419edbd92ec13bc06b69d15132959/linked/p/melange/1.0.0/*  && rm -R epoch-804419edbd92ec13bc06b69d15132959/linked/p/melange/1.0.0/* && mv epoch-804419edbd92ec13bc06b69d15132959/linked/p/melange/1.0.0.tar epoch-804419edbd92ec13bc06b69d15132959/linked/p/melange/1.0.0/content.tar) || (echo 'Empty directory')))" failed with exit status 125
2023-07-22 14:49.20: Job failed: Failed: Build failed

Full logs at https://docs.ci.ocaml.org/job/2023-07-22/144556-voodoo-do-7dec6a

sabine commented 11 months ago

That we present odoc with unreadable .cmi file is, as I understand a voodoo issue: https://github.com/ocaml-doc/voodoo/issues/60. I'll put my attempted fix (https://github.com/ocaml-doc/voodoo/pull/115) on staging, so we can see if Melange 1.0.0 builds then.

jchavarri commented 10 months ago

I believe this is an issue on Melange side, rather than something that odoc or voodoo should fix.

Melange v1 depends on a fork of the OCaml compiler, based on the 4.14 version of OCaml, but the lower bound in opam package is 4.13 and there's no upper bound. This relaxation of bounds is beneficial in some cases (e.g. if dune devs or any user want to build melange on a 5.0 switch), but it breaks tooling like odoc or ocaml-lsp-server, that rely on the switch version to match that of Melange.

I think in subsequent versions, Melange will constraint the version of OCaml to just the one that it is compatible with, so e.g. version 2.0.0 will be compatible with just OCaml 5.1. @anmonteiro is that correct? If that's the case, this would become a non-issue.

See related: https://github.com/melange-re/melange/issues/603.

tmcgilchrist commented 8 months ago

This error can also be seen in the ocaml-src.5.0.dev and ocaml-src.5.0.0 packages so it's not just a melange issue.

$ opam switch create . 5.0.0 --no-install
$ opam install odoc.2.2.1
$ opam install ocaml-src.5.0.dev
$ odoc compile-deps _opam/lib/ocaml-src/testsuite/tests/no-alias-deps/b.cmi 
odoc: internal error, uncaught exception:
      Cmi_format.Error(_)
      Raised at Cmi_format.read_cmi in file "file_formats/cmi_format.ml", line 82, characters 6-21
      Called from Odoc_odoc__Depends.for_compile_step_cmi_or_cmti in file "src/odoc/depends.ml", line 37, characters 18-62
      Called from Dune__exe__Main.Depends.Compile.list_dependencies in file "src/odoc/bin/main.ml", line 689, characters 17-72
      Called from Cmdliner_term.app.(fun) in file "cmdliner_term.ml", line 24, characters 19-24
      Called from Cmdliner_eval.run_parser in file "cmdliner_eval.ml", line 34, characters 37-44
jonludlam commented 4 months ago

The only thing odoc can do here is error more gracefully, but that would be a lot nicer than the horrendous backtrace, so let's do that.