Skip to content

Commit

Permalink
Fix #4684
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <[email protected]>
  • Loading branch information
rgrinberg committed Jun 14, 2021
1 parent c93714f commit 9af5a79
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 77 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ Unreleased
`INSIDE_EMACS` in order to improve reproducibility (#4680,
@jeremiedimino)

- Fix `root_module` when used in public libraries (#4685, fixes #4684,
@rgrinberg, @CraigFe)

2.9.0 (unreleased)
------------------

Expand Down
7 changes: 6 additions & 1 deletion src/dune_rules/dune_file.ml
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,12 @@ module Library = struct
false
in
Obj_dir.make_lib ~dir
~has_private_modules:(t.private_modules <> None)
~has_private_modules:
((* TODO instead of this fragile approximation, we should be looking at
[Modules.t] and deciding. Unfortunately, [Obj_dir.t] is currently
used in some places where [Modules.t] is not yet constructed. *)
t.private_modules <> None
|| t.buildable.root_module <> None)
~private_lib (snd t.name)

let main_module_name t : Lib_info.Main_module_name.t =
Expand Down
76 changes: 0 additions & 76 deletions test/blackbox-tests/test-cases/github4684.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,80 +12,4 @@ build failure:
> EOF

$ dune build
Internal error, please report upstream including the contents of _build/log.
Description:
("External.cm_dir",
{ t =
{ public_dir = In_build_dir "default"
; private_dir = None
; public_cmi_dir = None
}
})
Raised at file "otherlibs/stdune-unstable/code_error.ml", line 11, characters
30-62
Called from file "src/dune_rules/install_rules.ml", line 148, characters
19-69
Called from file "src/dune_rules/install_rules.ml" (inlined), line 165,
characters 23-31
Called from file "src/dune_rules/install_rules.ml", line 180, characters
49-63
Called from file "list.ml", line 103, characters 22-25
Called from file "otherlibs/stdune-unstable/list.ml", line 5, characters
19-33
Called from file "list.ml", line 103, characters 22-25
Called from file "otherlibs/stdune-unstable/list.ml" (inlined), line 5,
characters 19-33
Called from file "otherlibs/stdune-unstable/list.ml", line 40, characters
29-39
Called from file "src/dune_rules/install_rules.ml", line 155, characters
6-1023
Called from file "src/fiber/fiber.ml", line 182, characters 9-14
Re-raised at file "otherlibs/stdune-unstable/exn.ml", line 36, characters
27-56
Called from file "src/fiber/fiber.ml", line 204, characters 8-13
Re-raised at file "otherlibs/stdune-unstable/exn.ml", line 36, characters
27-56
Called from file "src/fiber/fiber.ml", line 204, characters 8-13
Re-raised at file "otherlibs/stdune-unstable/exn.ml", line 36, characters
27-56
Called from file "src/fiber/fiber.ml", line 204, characters 8-13
Re-raised at file "otherlibs/stdune-unstable/exn.ml", line 36, characters
27-56
Called from file "src/fiber/fiber.ml", line 204, characters 8-13
Re-raised at file "otherlibs/stdune-unstable/exn.ml", line 36, characters
27-56
Called from file "src/fiber/fiber.ml", line 204, characters 8-13
Re-raised at file "otherlibs/stdune-unstable/exn.ml", line 36, characters
27-56
Called from file "src/fiber/fiber.ml", line 204, characters 8-13
Re-raised at file "otherlibs/stdune-unstable/exn.ml", line 36, characters
27-56
Called from file "src/fiber/fiber.ml", line 204, characters 8-13
Re-raised at file "otherlibs/stdune-unstable/exn.ml", line 36, characters
27-56
Called from file "src/fiber/fiber.ml", line 204, characters 8-13
Re-raised at file "otherlibs/stdune-unstable/exn.ml", line 36, characters
27-56
Called from file "src/fiber/fiber.ml", line 472, characters 10-22
Called from file "src/fiber/fiber.ml", line 127, characters 10-17
Re-raised at file "otherlibs/stdune-unstable/exn.ml", line 36, characters
27-56
Called from file "src/fiber/fiber.ml", line 204, characters 8-13
Re-raised at file "otherlibs/stdune-unstable/exn.ml", line 36, characters
27-56
Called from file "src/fiber/fiber.ml", line 204, characters 8-13
-> required by ("stanzas-to-entries", "default")
-> required by ("<unnamed>", ())
-> required by ("<unnamed>", ())
-> required by ("<unnamed>", ())
-> required by ("<unnamed>", ())
-> required by ("load-dir", In_build_dir "default")
-> required by ("build-alias", { dir = "default"; name = "default" })

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.
[1]

0 comments on commit 9af5a79

Please sign in to comment.