Skip to content

Transition mode for library wrapping: emit deprecation warning #985

@hhugo

Description

@hhugo

Discussed with @diml offline.

Switching to library from (wrapped false) to (wrapped true) usually mean that you break most package depending on you. Dune should support a transition mode that will emit warning if modules are accessed directly.

In that mode, for every module in the lib:

  • dune would generate {MOD}.ml-gen
  • compile {MOD}.ml-gen to {MOD}.cm{i,o,x}
  • include these new implementations in the archive.

{MOD}.ml-gen files would look like:

include Lib__{MOD} [@@deprecated "Use Lib.{MOD} instead."]

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