`doctest`s need `--write-ghc-environment-files=always`
See:
- https://github.com/isovector/type-errors/issues/9
Can we default to write-ghc-environment-files: always or would that break other packages?
In the latter case, could we allow users to activate write-ghc-environment-files: always in the test settings?
See also:
- #991
- #981
Just noting for myself, ~this allows the DocTests to work~ unreliably:
cabal build --write-ghc-environment-files=always
cabal test DocTests --write-ghc-environment=always
@andreasabel , I can't make this work reliably. Can you give me the command to make the DocTests succeed? Thanks
Do you mean for hackage-server? (Because this issue is about user packages uploaded to hackage that have doctests.)
Oh, I misunderstood. Yes, I meant for hackage-server.
Are you able to run the hackage-server DocTests reliably?
Well, yes, CI runs them every time. I just tried them locally.
cabal.projectsays:write-ghc-environment-files: always, so we are good there.cabal build(necessary!)cabal test DocTests
Works.
For me, locally, with GHC 9.6, either of these causes the error:
cabal build --write-ghc-environment-files=always all; cabal test DocTests --write-ghc-environment=always
cabal build all; cabal test DocTests
However, with GHC 9.8, either succeeds.
The Nix Flake has GHC 9.6.
Thanks @andreasabel , that resolves it for now