Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Melange 1.0.0 documentation build failure. #983

Open
tmcgilchrist opened this issue Jul 24, 2023 · 4 comments
Open

Melange 1.0.0 documentation build failure. #983

tmcgilchrist opened this issue Jul 24, 2023 · 4 comments

Comments

@tmcgilchrist
Copy link
Contributor

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
Copy link

sabine commented Jul 24, 2023

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

@jchavarri
Copy link

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: melange-re/melange#603.

@tmcgilchrist
Copy link
Contributor Author

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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants