Skip to content

build-tool-depends with custom setup tries to build the wrong component #6011

Open
@lukel97

Description

@lukel97
  • The test case contains a sub-package foo that exposes an executable called bar
  • The parent package has a build-tool-depends on foo:bar
  • foo also has build-type: Custom
  • During cabal new-build, cabal tries to build exe:foo when it should build exe:bar

cabal-subexe-bug.tar.gz

Occurs on both 2.4.1.0 and HEAD at the time of writing

$ cabal new-build
Resolving dependencies...
Build profile: -w ghc-8.6.4 -O1
In order, the following will be built (use -v for more details):
 - foo-0.1.0.0 (lib:foo, exe:foo) (configuration changed)
 - cabal-subexe-bug-0.1.0.0 (lib) (configuration changed)
 - cabal-subexe-bug-0.1.0.0 (lib) (configuration changed)
Configuring foo-0.1.0.0...
setup: Unknown build target 'exe:foo'.
There is no executable component 'foo' or component 'exe'.

cabal: Failed to build foo-0.1.0.0 (which is required by
cabal-subexe-bug-0.1.0.0).

Metadata

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