Skip to content

build-type: Custom seems to break doctests when using haddock #7213

Open
@ezzieyguywuf

Description

@ezzieyguywuf

Describe the bug
If the build-type: Custom is used, which is necessary for doctest, then running ./setup haddock ends up deleting some files that are necessary for the test-suite to run. Re-running ./setup build will re-generate the deleted files.

To Reproduce

  1. Set up a project using doctest
  2. Make sure that the test-suite target depends on the library
  3. Run the following commands
ghc Setup.lhs -o setup
./setup configure --enable-tests
./setup build
./setup haddock
./setup test # tests fail
./setup build # the deleted files are re-built
./setup test # tests pass

Please use version-prefixed commands (e.g. `v2-build` or `v1-build`) to avoid ambiguity.

**Expected behavior**
I expect that regardless of the `build-type`, the `test-suite` will pass if indeed the code is sound. I do **not** expect for the `./setup haddock` call to delete anything.

**System information**
 - Gentoo Linux
 - ghc 8.10.2
 - cabal library version 3.2.0.0

**Additional context**
A full working, minimal project can be found [here](https://gitlab.com/ezzieyguywuf/testfailure) which reproduces the error.

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