haskell / haskell/cabal

Improve suggestion for adding build-depends

Open
#8,262 3 comments 0 reactions 0 assignees View on GitHub
attention: pr-welcome cabal-install: cmd/build type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**

When trying to build [facebookincubator/Glean](https://github.com/facebookincubator/Glean), I got an error with a suggestion:

```
Could not load module ‘Glean.Internal.Types’
It is a member of the hidden package ‘glean-0.1.0.0’.
Perhaps you need to add ‘glean’ to the build-depends in your .cabal file.
```

This suggestion is incorrect, because the error came about when trying to build the `gen-schema` target in `glean.cabal`.

**To Reproduce**
You can follow the Glean [build instructions](https://glean.software/docs/building/) but that's probably overkill. It should be possible to repro this by creating a minimal version of `glean.cabal`.

**Expected behavior**
In this context, the correct suggestion would be to add a dependency on `glean:if-internal-hs` since that is the only library target which includes `Glean.Internal.Types`.

**System information**
- Ubuntu 22.04
- cabal 3.6.2.0, ghc 8.10.7

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.