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

Internal error when building tezos docs with Odoc.2.4.0 #1095

Closed
NicNomadic opened this issue Mar 21, 2024 · 4 comments · Fixed by #1100
Closed

Internal error when building tezos docs with Odoc.2.4.0 #1095

NicNomadic opened this issue Mar 21, 2024 · 4 comments · Fixed by #1100

Comments

@NicNomadic
Copy link

Running dune build @doc on current Tezos master (commit 5f8f680327d6cae1d383c9865ef153c77ae38bd6) causes Odoc 2.4.0 to fail with the following internal error:

$ git clone https://gitlab.com/tezos/tezos.git
$ cd tezos
$ make build-deps
$ eval $(opam env)
$ opam install odoc.2.4.0
$ dune build @doc --stop-on-first-error
[…]
File "src/lib_distributed_plonk/distribution/.distribution.objs/byte/_unknown_", line 1, characters 0-0:
odoc: internal error, uncaught exception:
  Not_found
  Raised at Ident.find_same in file "typing/ident.ml", line 253, characters 6-21
  Called from Odoc_loader__Ident_env.find_exception_identifier in file "src/loader/ident_env.cppo.ml" (inlined), line 654, characters 2-35
  Called from Odoc_loader__Cmi.read_exception in file "src/loader/cmi.ml", line 775, characters 11-47
  Called from Odoc_loader__Cmi.read_signature_noenv.loop in file "src/loader/cmi.ml", line 1028, characters 18-50
  Called from Odoc_loader__Cmt.read_open in file "src/loader/cmt.ml", line 572, characters 21-96
  Called from Odoc_loader__Cmt.read_structure_item in file "src/loader/cmt.ml", line 520, characters 14-38
  Called from Odoc_loader__Cmt.read_structure.(fun) in file "src/loader/cmt.ml", line 592, characters 24-61
  Called from Stdlib__List.fold_left in file "list.ml", line 121, characters 24-34
  Called from Odoc_loader__Cmt.read_structure in file "src/loader/cmt.ml", line 590, characters 4-127
  Called from Odoc_loader__Cmt.read_module_expr in file "src/loader/cmt.ml", line 362, characters 21-83
  Called from Odoc_loader__Cmt.read_module_expr in file "src/loader/cmt.ml", line 380, characters 18-85
  Called from Odoc_loader__Cmt.read_module_expr_maybe_canonical in file "src/loader/cmt.ml", line 422, characters 10-53
  Called from Odoc_loader__Cmt.read_module_binding in file "src/loader/cmt.ml", line 444, characters 10-81
  Called from Odoc_loader__Cmt.read_structure_item in file "src/loader/cmt.ml", line 510, characters 14-47
  Called from Odoc_loader__Cmt.read_structure.(fun) in file "src/loader/cmt.ml", line 592, characters 24-61
  Called from Stdlib__List.fold_left in file "list.ml", line 121, characters 24-34
  Called from Odoc_loader__Cmt.read_structure in file "src/loader/cmt.ml", line 590, characters 4-127
  Called from Odoc_loader__Cmt.read_implementation in file "src/loader/cmt.ml", line 605, characters 4-79
  Called from Odoc_loader.read_cmt in file "src/loader/odoc_loader.ml", line 169, characters 34-74
  Called from Odoc_loader.wrap_errors.(fun) in file "src/loader/odoc_loader.ml", line 192, characters 10-14
  Called from Odoc_model__Error.catch in file "src/model/error.ml", line 54, characters 21-27
  Called from Odoc_model__Error.catch_warnings.(fun) in file "src/model/error.ml", line 89, characters 18-22
  Called from Odoc_model__Error.with_ref in file "src/model/error.ml", line 67, characters 12-16
  Re-raised at Odoc_model__Error.with_ref in file "src/model/error.ml", line 72, characters 4-11
  Called from Odoc_odoc__Compile.resolve_and_substitute in file "src/odoc/compile.ml", line 111, characters 8-72
  Called from Odoc_model__Error.catch in file "src/model/error.ml", line 54, characters 21-27
  Called from Odoc_model__Error.catch_warnings.(fun) in file "src/model/error.ml", line 89, characters 18-22
  Called from Odoc_model__Error.with_ref in file "src/model/error.ml", line 67, characters 12-16
  Re-raised at Odoc_model__Error.with_ref in file "src/model/error.ml", line 72, characters 4-11
  Called from Odoc_odoc__Compile.compile.(fun) in file "src/odoc/compile.ml", line 297, characters 6-180
  Called from Cmdliner_term.app.(fun) in file "cmdliner_term.ml", line 24, characters 19-24
  Called from Cmdliner_term.app.(fun) in file "cmdliner_term.ml", line 22, characters 12-19
  Called from Cmdliner_eval.run_parser in file "cmdliner_eval.ml", line 34, characters 37-44

Note that this error is raised by all odoc versions 2.4.* and 2.3., but not by odoc 2.2..

@jonludlam
Copy link
Member

I wouldn't be surprised to find this is fixed by #1082. It might be worth trying the master branch to see if it still fails?

@NicNomadic
Copy link
Author

I think it doesn't fix it. This what I tried, to be sure:

  • cloned the odoc repo under ~/Tmp/odoc
  • cd odoc
  • make
  • cd ../tezos
  • ln -s ~/Tmp/odoc/_build/default/src/odoc/bin/main.exe _opam/bin/odoc
  • odoc --version
    %%VERSION%%
  • dune build @doc --stop-on-first-error
    odoc: internal error, uncaught exception:
    Not_found
    Raised at Ident.find_same in file "typing/ident.ml", line 253, characters 6-21

So, as I couldn't install the master version with opam, I added a symlink in my path to the binary built on master. Is this test conclusive?

@jonludlam
Copy link
Member

conclusive enough :-) I'll take a look.

jonludlam added a commit to jonludlam/odoc that referenced this issue Mar 27, 2024
This is related to issue ocaml#1066, which was partially fixed by ocaml#1082. This PR
sorts the remaining two instances of the problem: exceptions and type
extensions.

Fixes ocaml#1095
jonludlam added a commit to jonludlam/odoc that referenced this issue Mar 27, 2024
This is related to issue ocaml#1066, which was partially fixed by ocaml#1082. This PR
sorts the remaining two instances of the problem: exceptions and type
extensions.

Fixes ocaml#1095
jonludlam added a commit to jonludlam/odoc that referenced this issue Mar 28, 2024
This is related to issue ocaml#1066, which was partially fixed by ocaml#1082. This PR
sorts the remaining two instances of the problem: exceptions and type
extensions.

Fixes ocaml#1095
jonludlam added a commit to jonludlam/odoc that referenced this issue Mar 28, 2024
This is related to issue ocaml#1066, which was partially fixed by ocaml#1082. This PR
sorts the remaining two instances of the problem: exceptions and type
extensions.

Fixes ocaml#1095
jonludlam added a commit to jonludlam/odoc that referenced this issue Mar 28, 2024
This is related to issue ocaml#1066, which was partially fixed by ocaml#1082. This PR
sorts the remaining two instances of the problem: exceptions and type
extensions.

Fixes ocaml#1095
jonludlam added a commit that referenced this issue Apr 17, 2024
This is related to issue #1066, which was partially fixed by #1082. This PR
sorts the remaining two instances of the problem: exceptions and type
extensions.

Fixes #1095
@NicNomadic
Copy link
Author

I confirm that replaying the test above works fine using the odoc on latest master branch. Thanks a lot!

Do you have an idea about which future odoc release should contain this fix?

jonludlam added a commit to jonludlam/odoc that referenced this issue Apr 29, 2024
This is related to issue ocaml#1066, which was partially fixed by ocaml#1082. This PR
sorts the remaining two instances of the problem: exceptions and type
extensions.

Fixes ocaml#1095
jonludlam added a commit that referenced this issue Apr 29, 2024
This is related to issue #1066, which was partially fixed by #1082. This PR
sorts the remaining two instances of the problem: exceptions and type
extensions.

Fixes #1095
jonludlam added a commit to jonludlam/opam-repository that referenced this issue Apr 29, 2024
CHANGES:

### Added

- OCaml 5.2.0 compatibility (@Octachron, ocaml/odoc#1094, ocaml/odoc#1112)

### Fixed

- Fix issues ocaml/odoc#1066 and ocaml/odoc#1095 with extended opens (@jonludlam, ocaml/odoc#1082, ocaml/odoc#1100)
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

Successfully merging a pull request may close this issue.

2 participants