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

Ambiguous target error #370

Open
pepeiborra opened this issue Sep 16, 2022 · 1 comment
Open

Ambiguous target error #370

pepeiborra opened this issue Sep 16, 2022 · 1 comment

Comments

@pepeiborra
Copy link
Contributor

This error arises when using the simple Cabal cradle and a module is listed in more than one targets, e.g. in a library and a test suite:

Failed to parse result of calling cabal
Failed command: cabal --builddir=/home/debian/.cache/hie-bios/dist-glean-b7f5bda3788e268251326113cb8bbe28 v2-repl --with-compiler /home/debian/.cache/hie-bios/wrapper-b54f81dea4c0e6d1626911c526bc4e36 --with-hc-pkg /home/debian/.cache/hie-bios/ghc-pkg-e79adc0e43a6aff15fd0b2054117e35c /home/debian/glean/glean/server/Glean/Server/Sharding.hs

Error: cabal: Ambiguous target
'/home/debian/glean/glean/server/Glean/Server/Sharding.hs'. It could be:
publish-shards:glean/server/Glean/Server/Sharding (file)
glean-server:glean/server/Glean/Server/Sharding (file)

Process Environment:
HIE_BIOS_GHC: /home/debian/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/bin/ghc
HIE_BIOS_GHC_ARGS: -B/home/debian/.ghcup/ghc/8.10.7/lib/ghc-8.10.7

I think it would be always sound to just pick the first target in the list, rather than failing with an unrecoverable error

@fendor
Copy link
Collaborator

fendor commented Sep 16, 2022

Relevant cabal prs:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants