Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Unknown build target" when using Custom setup and build-tool-depends #8043

Open
martijnbastiaan opened this issue Mar 13, 2022 · 0 comments

Comments

@martijnbastiaan
Copy link
Collaborator

Describe the bug
Compilation fails when some project A has a Custom setup and some project B has a build-tool-depends on an executable from project A.

To Reproduce

git clone https://github.com/martijnbastiaan/cabal-build-tool-depends-issue.git
cd cabal-build-tool-depends-issue
cabal v2-build all

Expected behavior
I would expect a custom setup that loos like:

module Main where

import Distribution.Simple (defaultMain)

main :: IO ()
main = defaultMain

to behave the same as build-type: Simple, alas, it doesn't.

Actual behavior

$ cabal v2-build all
Build profile: -w ghc-8.10.2 -O1
In order, the following will be built (use -v for more details):
 - project-a-0.1.0.0 (exe:the-exe, exe:project-a) (additional components to build)
 - project-b-0.1.0.0 (exe:project-b) (configuration changed)
setup: Unknown build target 'exe:project-a'.
There is no executable component 'project-a'.

cabal: Failed to build project-a-0.1.0.0 (which is required by exe:project-b
from project-b-0.1.0.0).

If I use a Simple build-type, it works as expected.

System information

  • Ubuntu 20.04
  • Cabal 3.6
  • GHC 8.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants