Skip to content

componentAvailableTargetStatus: impossible; cname=test #8719

@phadej

Description

@phadej

When a project uses local package tarballs, project planning fails.

Small reproducer:

take any package with tests, e.g. splitmix (I pick that because it depends only on bundled libraries): https://hackage.haskell.org/package/splitmix-0.1.0.4/splitmix-0.1.0.4.tar.gz

% ls
cabal.project  foo.cabal  splitmix-0.1.0.4.tar.gz

cabal.project

packages: .
packages: splitmix-0.1.0.4.tar.gz

foo.cabal

cabal-version: 3.6
name: foo
version: 0

library
  build-depends: base, splitmix

Then if you try to build the project enabling tests, it fails:

% ~/.ghcup/bin/cabal-3.9.0.0 build --enable-tests all
componentAvailableTargetStatus: impossible; cname=test:examples
CallStack (from HasCallStack):
  error, called at src/Distribution/Client/ProjectPlanning.hs:2698:17 in cabal-install-3.9.0.0-inplace:Distribution.Client.ProjectPlanning

The :test:examples component is a test-suite of splitmix. It shouldn't be required or built. This seems to be a regression since cabal-3.8.1.0.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions