ocaml / ocaml/dune

Exception when secondary .opam with bad name exists while runnning build doc

Open
#8,281 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

build odoc
Dominant language
OCaml
Stars
1.9k
Forks
500
Avg merge
15h 21m
Merged PRs (30d)
277

Description

Expected Behavior

No exception when doing build doc

Actual Behavior

Internal error, please report upstream including the contents of _build/log.
Description:
  ("[gen_rules] returned rules in a directory that is not a descendant of the directory it was called for",
  { dir = In_build_dir "default/_doc/_html/simple_httpd.chaml"
  ; example =
      Rule
        { targets =
            { files = set { "default/_doc/_html/simple_httpd/index.html" }
            ; dirs = set {}
            }
        }
  })
Raised at Stdune__Code_error.raise in file
  "otherlibs/stdune/src/code_error.ml", line 11, characters 30-62
Called from
  Dune_engine__Load_rules.Load_rules.Normal.make_rules_gen_result.(fun) in
  file "src/dune_engine/load_rules.ml", line 583, characters 12-53
Called from Fiber__Core.O.(>>|).(fun) in file "otherlibs/fiber/src/core.ml",
  line 250, characters 36-41
Called from Fiber__Scheduler.exec in file "otherlibs/fiber/src/scheduler.ml",
  line 73, characters 8-11
-> required by ("<unnamed>", ())
-> required by
   ("load-dir", In_build_dir "default/_doc/_html/simple_httpd.chaml")
-> required by
   ("build-alias",
   { dir = In_build_dir "default/_doc/_html/simple_httpd.chaml"
   ; name = "doc"
   })
-> required by ("<unnamed>", ())
-> required by
   ("build-alias", { dir = In_build_dir "default"; name = "doc" })
-> required by ("toplevel", ())

I must not crash.  Uncertainty is the mind-killer. Exceptions are the
little-death that brings total obliteration.  I will fully express my cases. 
Execution will pass over me and through me.  And when it has gone past, I
will unwind the stack along its path.  Where the cases are handled there will
be nothing.  Only I will remain.
make: *** [Makefile:27 : doc] Erreur 1 

Reproduction

Have to opam file x.opam and x.y.opam.

If this is not enough download simple_httpd, rename simple_httpd_chaml.opam in
simple_httpd.chaml.opam and run build doc or make doc

Specifications

  • Version of dune (output of dune --version): 3.9.1
  • Version of ocaml (output of ocamlc --version): 5.0.0 with flambda
  • Operating system (distribution and version): debian 12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with both x.opam and x.y.opam present, using the simple_httpd example and build doc or make doc. Start by reading the rule-loading path named in src/dune_engine/load_rules.ml and inspect the generated path under default/_doc/_html. Done means the documentation build completes without the reported internal error.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.