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

Reenable doctests #317

Closed
wants to merge 4 commits into from
Closed

Reenable doctests #317

wants to merge 4 commits into from

Conversation

sjoerdvisscher
Copy link
Member

Cabal 3.4.0.0 is out now, so I reenabled the doctest.

But most the doctests are failing with an error like:

attempting to use module ‘main:Foreign.Marshal.Pure’ (...) which is not loaded

@utdemir Do you know what might cause this?

@utdemir
Copy link
Contributor

utdemir commented Mar 2, 2021

@utdemir Do you know what might cause this?

@sjoerdvisscher Unfortunately, I don't remember seeing that error with cabal-doctests before, I just had a quick look and couldn't solve it easily.

One interesting thing to note is that, only some of the doctests fail, eg. the test in Data/Array/Mutable/Linear.hs seems to be fine. My guess is that it's something about the dependency order, where importing something from above the dependency chain in a test fails. This might be the reason of tests in Data.V.Linear failing to import Prelude.Linear, but this is not the case Data.Array.Mutable.Linear (which is not a dependency of Prelude.Linear).

So, when I built the linear-base and passed the package to doctests, it works (after fixing one legitimate test failure):

$ cabal build
$ cabal exec -- doctest -package linear-base src/**/*.hs

However, I don't have any opinion on how we can fix it.

@andreabedini
Copy link
Contributor

I am looking at this and FWIW, I seem to be able to succesfully run the doctests in the configured nix shell using cabal-docspec, just as Oleg suggests in the issue linked above.

In that issue Oleg says

But cabal-docspec doesn't work with stack nor Nix(pkgs) based setup, so it's probably not an option for you.

I am not sure what this means. Given the current setup, I belive the only missing bit is including cabal-docspec in the nix shell.

@andreabedini
Copy link
Contributor

Closing in favour of #361

@sjoerdvisscher sjoerdvisscher deleted the sv/reenable-doctest branch January 19, 2022 15:17
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

Successfully merging this pull request may close these issues.

None yet

4 participants