ocaml / ocaml/dune

"The module X is an alias for module Y.X, which is missing" when X comes from a virtual library

Open
#3,645 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Expected Behavior

Aliased module just works.

Actual Behavior

Error message The module X is an alias for module Y.X, which is missing is the result. To work-around this, I have to spell out the module signature completely during re-export instead of declaring it as an alias.

Reproduction

X comes from a virtual library, and is exported as a submodule of some master-library Y, which is then exported by some platform-dependent flavor Y' that also links the implementation of virtual library for specific platform.

Y' is then used in some other project either via opam pin or via opam install to exhibit this behavior. If Y' along with Y and Y.X are vendored (they live in one git repo), everything builds just fine.

Specifications

  • Version of dune: 2.4.0
  • Version of ocaml: 4.08.1
  • Operating system: Linux buster 4.19.0-5-amd64 #1 SMP Debian 4.19.37-5 (2019-06-19) x86_64 GNU/Linux

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

Start by reproducing the failure with Dune 2.4.0 and OCaml 4.08.1 using separate vendored and opam-installed or pinned virtual-library packages. Trace the aliased submodule export from Y.X through the platform-dependent Y' package; done means the alias works without spelling out the complete module signature.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.