Skip to content

Ambiguity between package target and component target should resolve in favour of the package #9009

Open
@michaelpj

Description

Describe the bug
haskell-language-server has a cabal package of that name, which contains an executable of the same name.

That means that the haskell-language-server target is ambiguous between:

  1. The package target
  2. The component target for lib:haskell-language-server
  3. The component target for exe:haskell-language-server

As a result, cabal says:

Error: cabal: Ambiguous target 'haskell-language-server'. It could be:
exe:haskell-language-server (component)
lib:haskell-language-server (component)

Somehow this doesn't bite if the executable isn't present, even though there is still an ambiguity between 1 and 2.

To Reproduce

Check out https://github.com/haskell/haskell-language-server and run cabal build haskell-language-server.

Expected behavior

I think the package target should always win if it is ambiguous with a component target. You can always disambiguate in favour of the component target, but there is no other way to select the package target (and hence to build all components in the package).

System information

  • cabal-3.10

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions