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

Distribution.Extra.Doctest is deprecated and makes installing with nix more difficult #60

Open
tysonzero opened this issue Nov 27, 2021 · 9 comments

Comments

@tysonzero
Copy link

Deprecation indicator

When installing with nix:

setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 +RTS -A64M -RTS -threaded -rtsopts
[1 of 1] Compiling Main             ( Setup.hs, /build/Main.o )

Setup.hs:3:1: error:
    Could not find module ‘Distribution.Extra.Doctest’
    Perhaps you meant Distribution.Simple.Doctest (from Cabal-3.2.1.0)
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
3 | import Distribution.Extra.Doctest (defaultMainWithDoctests)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@tysonzero
Copy link
Author

Looks like the build issue only occurs when building with ghcjs.

@kim
Copy link
Collaborator

kim commented Nov 28, 2021 via email

@tysonzero
Copy link
Author

Potentially? Although the GPL license seems like it could be a problem.

@kim
Copy link
Collaborator

kim commented Nov 28, 2021

The interpretation seems to be that a library which uses it to drive its doctest suite is not a derived work. As evidenced by lens (BSD2) using cabal-docspec, which @phadej himself proposed.

@tysonzero
Copy link
Author

Ah perfect! It seems like cabal-docspec doesn't require a custom-setup stanza, so perhaps this will fix the nix/ghcjs issue.

My attempts to use CPP to workaround the issue have been unsuccessful. It appears that __GHCJS__ and ghcjs_HOST_OS are not set when compiling Setup.hs.

@kim
Copy link
Collaborator

kim commented Nov 29, 2021 via email

@tysonzero
Copy link
Author

tysonzero commented Nov 29, 2021

To be honest I have never used any of the doctest variants.

I've tried to install cabal-docspec from source via various cabal commands but they all give different error messages. Are there proper install and usage instructions anywhere?

In terms of fixing GHCJS I'm fairly sure that anything not using a custom-setup clause should work just fine.

@kim
Copy link
Collaborator

kim commented Nov 29, 2021 via email

@tysonzero
Copy link
Author

A normal test suite sounds reasonable to me.

Hmm yeah git may need some PR's or a fork.

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

No branches or pull requests

2 participants