haskell / haskell/cabal

Assertion failed when adding `tests: False` to `~/.cabal/config`

Open
#5,270 1 comment 0 reactions 0 assignees View on GitHub
cabal-install: v2-build system type: assertion-fail type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

The default `~/.cabal/config` contains the commented out line `tests: False`, implying that this is the default, and yet when uncommenting that line and building a project which contains tests with `cabal-custom new-build all`, I get an [assertion error](https://github.com/haskell/cabal/blob/335fa8d82520bad1a6980fd55230e65889c99860/cabal-install/Distribution/Client/ProjectPlanning.hs#L240):

$ cabal-custom new-build all
Build profile: -w ghc-8.2.2 -O1
In order, the following will be built (use -v for more details):
Assertion failed
CallStack (from HasCallStack):
assert, called at ./Distribution/Client/ProjectPlanning.hs:240:5 in cabal-install-2.3.0.0-inplace:Distribution.Client.ProjectPlanning

I believe this is yet another consequence of the fact that the default is neither to enable nor to disable the tests, but a [third option](https://github.com/haskell/cabal/issues/5255#issuecomment-381432190).

Contributor guide

Open the contributing guide

Research direction

Start in cabal-install/Distribution/Client/ProjectPlanning.hs at the assertion reported on line 240, then trace how the tests setting from ~/.cabal/config is represented during `cabal-custom new-build all`. Reproduce the failure with `tests: False`; done means the project builds without the assertion and tests remain disabled.

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
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.