haskell / haskell/cabal

new-test for non-local dependencies

Open
#5,511 0 comments 0 reactions 0 assignees View on GitHub
type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

Currently, trying to `new-test` a package that's not a local dependency fails with this message:

```
$ cabal new-test lens
Resolving dependencies...
cabal: Cannot test the package lens because none of the components are
available to build: the test suite 'templates', the test suite 'properties',
the test suite 'hunit' and the test suite 'doctests' cannot be built because
cabal does not currently support building test suites or benchmarks of
non-local dependencies
```

I think this would actually be a useful feature to have. Consider the situation where you have two local packages, A and B. A depends on a non-local package C, and C depends on B. Being able to test C against the local version of B to ensure compatibility pre-release would be quite nice.

This situation can arise naturally: until recently, `html-conduit` depended on `tagstream-conduit` which depends on `xml-conduit`; `html-conduit` and `xml-conduit` are maintained as a megarepo, but `tagstream-conduit` is separate. Alternatively, this situation can arise when A, B and C are in a megarepo and the user wishes to test A and B against the released version of C before releasing them.

In the latter case, the user will explicitly know which non-local dependencies they'd like to test against. However, the former is a bit more complicated: it may be unknown to the user that C depends on B. Perhaps some way of saying 'test all local dependencies plus all the non-local dependencies in the build plan that (transitively) depend on a local dependency' is needed?

Contributor guide

Open the contributing guide

Research direction

Start with the `new-test` command and the dependency build plan described in the issue. Trace how local and non-local dependencies are selected for testing, including transitive dependencies. Done means `new-test` can support the requested non-local dependency scenarios, with behavior and scope clearly defined for both explicit and inferred selections.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.