haskell / haskell/cabal

Cabal install does not find locally installed dependency ("unknown package")

Open
#8,714 8 comments 0 reactions 0 assignees View on GitHub
cabal-install: cmd/install documentation type: user-question
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**
I have package `b` depending on `a`. `a` is locally installed but when trying to build `b`, the dependency is not found. The error looks like:
```
Error: cabal: Could not resolve dependencies:
[__0] trying: b-0.1.0.0 (user goal)
[__1] unknown package: a (dependency of b)
[__1] fail (backjumping, conflict set: b, a)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: b, a
```

**To Reproduce**
Move to `a`, run `cabal install`, the installation succeeds. Now move to `b` depending on `a`, run `cabal install`, the installation fails with the error mentioned above. These are `v2-` commands.

**Expected behavior**
After installing `a`, i expected it to be locally visible for resolving dependencies.

**System information**
- Ubuntu 20.04.5 LTS
- `cabal` 3.8.1.0, `ghc` 8.6.5

**Additional context**
Executables provided by `a` are accessible and the library it provides gets correctly imported into `ghci`

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.