'cabal new-build test:test-suite' doesn't force tests to be enabled.
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
If there is a conflict involving the test dependencies, the solver disables the tests. I think that is because tests are only enabled with a preference in new-build. The build fails later with "cabal: Encountered missing dependencies: ...", unless the tests' dependencies are already required by another component.
```
name: example
version: 1
cabal-version: >=1.2
build-type: Simple
library
test-suite test-suite
type: exitcode-stdio-1.0
main-is: Tests.hs
build-depends: unknown
```
```
$ cabal new-build test:test-suite
Resolving dependencies...
In order, the following will be built (use -v for more details):
- example-1 (test:test-suite) (first run)
Configuring example-1...
cabal: Encountered missing dependencies:
unknown -any
```
Solver log with -v3:
```
Resolving dependencies...
targets: example
constraints:
base installed (non-upgradeable package)
ghc-prim installed (non-upgradeable package)
integer-gmp installed (non-upgradeable package)
example ==1 (user target)
preferences:
example [TestStanzas,BenchStanzas]
ADPfusion <0.4.0.0 || >0.4.0.0
[...]
zip-archive <0.2.3 || >0.2.3 && <0.2.3.1 || >0.2.3.1
strategy: PreferLatestForSelected
reorder goals: False
count conflicts: True
independent goals: False
avoid reinstalls: False
shadow packages: False
strong flags: False
max backjumps: 2000
[__0] trying: example-1 (user goal)
[__1] trying: example-1:*test
[__2] unknown package: unknown (dependency of example-1:*test)
[__2] fail (backjumping, conflict set: unknown, example-1:test)
[__1] trying: example-1:!test
[__2] done
```
Contributor guide
Assessment
This issue has not been assessed yet.