build-tool-depends with custom setup tries to build the wrong component
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
- 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](https://github.com/haskell/cabal/files/3109995/cabal-subexe-bug.tar.gz)
Occurs on both `2.4.1.0` and HEAD at the time of writing
```bash
$ 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).
```
Contributor guide
Assessment
This issue has not been assessed yet.