Skip to content

Using (root_module ...) with a public library results in a build failure #4684

@craigfe

Description

@craigfe

Expected Behavior

The (root_module ...) feature should compose with (public_name ...):

(library
 (name main)
 (public_name main)
 (root_module root)
 (libraries unix))

(Or, it should result in a user-facing error message saying that this isn't supported.)

Actual Behavior

Dune emits an internal build failure:

  $ 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
  ... etc. ...

The build log isn't very interesting, but it's here for completeness: https://gist.github.com/CraigFe/08fdbb18f3d1015cdbaa3de5cf0785d9

Reproduction

Specifications

  • Version of dune (output of dune --version): 2.8.5
  • Version of ocaml (output of ocamlc --version): 4.12.0
  • Operating system (distribution and version): Linux 5.12.6-arch1-1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions