Skip to content

Assertion failure for "stanzas explicitly disabled should not be available" #11568

@hasufell

Description

@hasufell

Describe the bug

While writing the patch #11567 I ran across an assertion:

-- the stanzas explicitly disabled should not be available
. assert
( optStanzaSetNull $
optStanzaKeysFilteredByValue (maybe False not) elabStanzasRequested `optStanzaSetIntersection` elabStanzasAvailable
)

This gets triggered regardless of the patch with a package that has an executable and a test suite and the following cabal.project file:

packages: ./cabal-assert-repro.cabal

package *
  Tests: False

Results in:

$ /home/hasufell/git/cabal/dist-newstyle/build/x86_64-linux/ghc-9.8.4/cabal-install-3.17.0.0/x/cabal/build/cabal/cabal build
Warning: this is a debug build of cabal-install with assertions enabled.
Resolving dependencies...
Build profile: -w ghc-9.8.4 -O1
In order, the following will be built (use -v for more details):
Assertion failed
CallStack (from HasCallStack):
  assert, called at src/Distribution/Client/ProjectPlanning.hs:269:9 in cabal-install-3.17.0.0-inplace:Distribution.Client.ProjectPlanning

To Reproduce
Steps to reproduce the behavior:

  1. build cabal from master with assertions enabled (normal cabal build does, the shipped binaries don't have it)
  2. clone https://github.com/hasufell/cabal-assert-repro
  3. run cabal build

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions