Skip to content

(public_name -) different behaviour between executable and executables #5852

@maiste

Description

@maiste

Expected Behavior

Hi, dear dune maintainers,
While working with executable and executables I noticed a difference in behaviour with the stanza (public_name -) and (public_names - -).
As described in the documentation, they should work the same way:

The executables stanza is the same as the executable stanza except that it’s used to describe several executables sharing the same configuration, so the plural executables stanza is used to represent more than one executable.

Actual Behavior

IIUC, the two executables descriptions should work the same way as one is just a contraction of the other one:

 (executable
   (public_name -)
   (name example_1)
   (modules example_1)
   (package dune-example))

 (executable
   (public_name -)
   (name example_2)
   (modules example_2)
   (package dune-example))
 (executables
   (public_names - -)
   (names example_1 example_2)
   (package dune-example))

Whereas 2. works without any issue and the - name is taken as ignored this field, 1. raised the following error:

Error: Multiple rules generated for _build/install/default/bin/-:
- examples/dune:3
- examples/dune:9
-> required by _build/default/dune-example.install
-> required by alias all
-> required by alias default

Reproduction

The reproduction steps are:

git clone https://github.com/maiste/dune-example.git
cd dune-example
dune build .

Specifications

  • Version of dune (output of dune --version): 3.2.0
  • Version of ocaml (output of ocamlc --version): 4.14.0
  • Operating system (distribution and version): Ubuntu 20.04 / EndeavourOS Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation improvements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions