Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hledger-lib doctest suite fails with cabal #1139

Closed
simonmichael opened this issue Nov 29, 2019 · 4 comments
Closed

hledger-lib doctest suite fails with cabal #1139

simonmichael opened this issue Nov 29, 2019 · 4 comments
Labels

Comments

@simonmichael
Copy link
Owner

@simonmichael simonmichael commented Nov 29, 2019

stack test hledger-lib succeeds, but cabal test hledger-lib fails on the doctest suite because packages are not in scope, unless you run it like cabal exec -- cabal test hledger-lib:

Hledger/Utils/Color.hs:14:1: error:
    Could not find module ‘System.Console.ANSI’
    Use -v to see a list of the files searched for.
   |
14 | import System.Console.ANSI
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
@simonmichael simonmichael changed the title hledger-lib test suite fails with cabal hledger-lib doctest suite fails with cabal Nov 29, 2019
simonmichael added a commit that referenced this issue Dec 1, 2019
@simonmichael

This comment has been minimized.

Copy link
Owner Author

@simonmichael simonmichael commented Dec 3, 2019

http://hackage.haskell.org/package/cabal-doctest may be the solution, I won't fiddle with it for 1.16.

@simonmichael

This comment has been minimized.

Copy link
Owner Author

@simonmichael simonmichael commented Dec 3, 2019

Reposting this edit as a comment, testing decreased notifications on #hledger :

hmm, cabal's doctest situation is more complicated than I can understand right now. Maybe I can disable that test suite for cabal only
https://www.haskell.org/cabal/users-guide/developing-packages.html#conditions don't allow distinguishing between build tools like cabal and stack
You could just have the doctest flag default to off and explicitly toggle it on in stack.yaml

@simonmichael

This comment has been minimized.

Copy link
Owner Author

@simonmichael simonmichael commented Dec 30, 2019

Upstream issue: sol/doctest#245

Another possible workaround: make a test suite that runs the "doctest" executable, or fails gracefully if that isn't installed. It must run it with stack exec (optionally: cabal exec if stack not available).

Another doctest issue for future reference: depending on it makes your build plan more fragile; because it depends on ghc, any packages ghc depends on may not be upgraded (containers, in particular). Cf composewell/streamly#83

@simonmichael

This comment has been minimized.

Copy link
Owner Author

@simonmichael simonmichael commented Mar 7, 2020

Should be fixed now (and doctests have been re-enabled in our CI).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.