haskell / haskell/cabal

cabal test all "Failed to find the installed unit"

Open
#11,677 7 comments 0 reactions 0 assignees View on GitHub
blocked: info-needed type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**
`cabal test all` fails with an error

```
Error: [Cabal-9341]
Failed to find the installed unit 'containers-tests-0-inplace-test-utils' in package database stack.
```

This showed up in https://github.com/haskell/containers/pull/1191.

**To Reproduce**
Steps to reproduce the behavior:

```sh
$ git clone -b check-laws https://github.com/meooow25/containers.git
$ cd containers
$ sed -i 's/containers\//-- &/' cabal.project # optional, to save some time
$ cabal test all
```

**Expected behavior**
Tests compile and run.

**System information**
```sh
$ cabal --version
cabal-install version 3.16.1.0
compiled using version 3.16.1.0 of the Cabal library (in-tree)
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.14.1
```

**Additional context**
While looking this error up I found #10046, which may be related. The workaround there of doing `cabal build all` first works here too.

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with the commands in the issue, using cabal.project and the reported Cabal and GHC versions. Read the related discussion in #10046 and compare behavior with the suggested cabal build all workaround. Done means cabal test all builds and runs the tests without the installed-unit error.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.