haskell / haskell/cabal

detailed-0.9 tests break when cabal executable and Cabal library do not match versions

Open
#2,529 4 comments 0 reactions 1 assignee Claimed by @ttuegel View on GitHub
blocked: info-needed Cabal: stanza/test-suite/detailed-0.9 type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

When using the detailed-0.9 interface, the cabal executable generates some boilerplate code.
Mismatches between the cabal version and the Cabal library version can trigger errors of the form:

```
[1 of 1] Compiling Main ( dist/dist-sandbox-4144f191/build/test-distributed-simple-cellStub/test-distributed-simple-cellStub-tmp/test-distributed-simple-cellStub.hs, dist/dist-sandbox-4144f191/build/test-distributed-simple-cellStub/test-distributed-simple-cellStub-tmp/Main.o )

dist/dist-sandbox-4144f191/build/test-distributed-simple-cellStub/test-distributed-simple-cellStub-tmp/test-distributed-simple-cellStub.hs:2:35:
Module ‘Distribution.Simple.Test’ does not export ‘stubMain’
```

(This error generated by attempting to build tests against Cabal 1.22.2.0 using cabal executable version 1.22.0.0)
This is caused by the cabal executable generating boilerplate code which expects the module interface exported by a particular version of the Cabal library, but attempting to compile that code against a different version of the Cabal library. However, there is currently no way to write a dependency constraint for the Cabal library which takes into account the version of the cabal executable being used. Constraints on the version of cabal used to build the package would have to use only one minor version, and thus are not a solution.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.