Skip to content

dune-build-info only works when public_name is specified, even if only mode is JS #4444

@phated

Description

@phated

Expected Behavior

I was expecting to be able to include dune-build-info (specifically the project version) in an executable target that only supports the js mode.

For example:

(executable
 (name Example)
 (modes js)
 (modules Example)
 (libraries dune-build-info))

Actual Behavior

Build_info.V1.version () is always None because the executable doesn't specify a public_name, but adding a public_name if I'm only specifying (modes js) results in this error:

Error: No installable mode found for this executable.
When public_name is set, one of the following modes is required:
- exe
- native
- byte

Reproduction

  1. Clone https://github.com/phated/dune-build-info-jsoo
  2. Run esy inside the repo
  3. Run esy test

Adding an exe mode and public_name to that executable allows the JS to include the project version.

Specifications

  • Version of dune (output of dune --version): 2.8.5
  • Version of ocaml (output of ocamlc --version): 4.11.0
  • Operating system (distribution and version): MacOS 10.15 (Catalina)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions