haskell / haskell/cabal

Assertion when new-building base with tests enabled in cabal.project

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

Description

When having a slightly patched Cabal (see #4209) to rebuild base, and `cabal.project` contains `tests: True`, then running `cabal new-build base` yields the following assertion [pkgStanzasEnabled `Set.isSubsetOf` pkgStanzasAvailable](https://github.com/haskell/cabal/blob/3d6dbe695c20c6bcceca77ebd8307ff0e3157762/cabal-install/Distribution/Client/ProjectPlanning.hs#L259) - though the sanity check code at head seems somewhat newer than the 1.24.0.2 code.

Adding

package base
tests: False

works around it.

Originally in [mail thread](https://mail.haskell.org/pipermail/haskell-cafe/2017-January/125895.html).

Contributor guide

Open the contributing guide

Research direction

Reproduce `cabal new-build base` with a patched Cabal from #4209 and `tests: True` in `cabal.project`. Start at `cabal-install/Distribution/Client/ProjectPlanning.hs` near the `pkgStanzasEnabled Set.isSubsetOf pkgStanzasAvailable` assertion; done means the scenario no longer asserts while preserving the intended test setting.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.