haskell / haskell/cabal

cabal can't find modules from private package - error message is unhelpful

Open
#8,575 1 comment 0 reactions 0 assignees View on GitHub
attention: pr-welcome re: config-file re: error-message
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**
I have a test suite which imports modules from a private library. Those modules are not found, even though the private library is added as build-depends.

The cabal file is here: [foo.cabal.txt](https://github.com/haskell/cabal/files/9950093/foo.cabal.txt)
(I had to add .txt so GitHub would take it)

**Expected behavior**

after a bunch of time spent experimenting, this seems to be alleviated by doing `build-depends: foo:foo-test-lib`. The error message should be more helpful. If I am in a package quux that contains baz as a private library, and I do `build-depends: baz`, then the error message should tell me to instead do `build-depends: quux:baz`. As in, "did you mean ...?" etc. Otherwise, the behavior is perceived as a bug - no one on IRC knew that the prefix (`quux:`) should be done, for example. Please include the actual name of the library or package in the error message.

**System information**

cabal-install version 3.8.1.0
compiled using version 3.8.1.0 of the Cabal library
The Glorious Glasgow Haskell Compilation System, version 9.0.2

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.