Skip to content

Commit

Permalink
testsuite: Be explicit about runtime test dependencies
Browse files Browse the repository at this point in the history
Issue haskell#8356 reports occasional errors from running the testsuite about
multiple package versions available. This stems from the invokation of
`runghc` not being explicit about all dependencies of the testsuite.

The solution is provide a component in the cabal file which is explicit
about which packages the tests can depend on. This component has a
build-depends section which lists all the dependencies that the tests
require.

It would be better if this component was a library component but we
can't do this with a Custom setup because of limitations to do with
per-component builds.

Then we also enable `-hide-all-packages`, so the dependency will not be
available if it is not explicitly listed as a dependency.

You could also imagine a future where the Setup.hs script found the test
files and compiled a single executable which would run all the tests,
rather than invoking runghc on each one individually.

Fixes haskell#8356
  • Loading branch information
mpickering authored and Mikolaj committed Nov 17, 2023
1 parent 03809b3 commit 75ea384
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions changelog.d/issue-6006
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
synopsis: Fix assertion failure when --enable-documentation is enabled
packages: cabal-install
prs: #9446
issuesa: #6006

description: {

If any non-library components ended up in the install plan for a library and
--enable-documentation was enabled, then cabal would throw an assertion failure
due to mismatched hashes. Now the relevant part of the package description is not
updated after the hash has been calculated, and the check about whether to actually build documentation happens
at the point documentation is built.


}

0 comments on commit 75ea384

Please sign in to comment.