Skip to content

doctests need --write-ghc-environment-files=always #1197

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

Open
andreasabel opened this issue Apr 9, 2023 · 6 comments
Open

doctests need --write-ghc-environment-files=always #1197

andreasabel opened this issue Apr 9, 2023 · 6 comments
Labels

Comments

@andreasabel
Copy link
Member

See:

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:

@peterbecich
Copy link
Member

peterbecich commented Mar 9, 2024

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

@peterbecich
Copy link
Member

@andreasabel , I can't make this work reliably. Can you give me the command to make the DocTests succeed? Thanks

@andreasabel
Copy link
Member Author

Do you mean for hackage-server? (Because this issue is about user packages uploaded to hackage that have doctests.)

@peterbecich
Copy link
Member

Oh, I misunderstood. Yes, I meant for hackage-server.

Are you able to run the hackage-server DocTests reliably?

@andreasabel
Copy link
Member Author

Well, yes, CI runs them every time.
I just tried them locally.

  • cabal.project says: write-ghc-environment-files: always, so we are good there.
  • cabal build (necessary!)
  • cabal test DocTests

Works.

@peterbecich
Copy link
Member

peterbecich commented Mar 10, 2024

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

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

No branches or pull requests

2 participants