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

Failed to load interface #145

Open
andrewthad opened this issue Jan 9, 2017 · 0 comments
Open

Failed to load interface #145

andrewthad opened this issue Jan 9, 2017 · 0 comments

Comments

@andrewthad
Copy link

I use doctests in the ip package. With version 0.8.7 (and probably with others), running stack test causes everything to run successfully. If instead, I run:

cabal new-build --enable-tests
./dist-newstyle/build/ip-0.8.7/build/doctest/doctest

It fails. I get a lot of Failed to load interface errors:

src/Net/IPv4.hs:30:1: error:
    Failed to load interface for ‘Net.Types’
    Use -v to see a list of the files searched for.

src/Net/IPv4.hs:34:1: error:
    Failed to load interface for ‘Data.Hashable’
    Use -v to see a list of the files searched for.

src/Net/IPv4.hs:35:1: error:
    Failed to load interface for ‘Data.Aeson’
    Perhaps you meant Data.Version (from base-4.9.0.0)
    Use -v to see a list of the files searched for.

src/Net/IPv4.hs:37:1: error:
    Failed to load interface for ‘Net.Internal’
    Use -v to see a list of the files searched for.

src/Net/IPv4.hs:39:1: error:
    Failed to load interface for ‘Data.Text.Internal’
    Use -v to see a list of the files searched for.

src/Net/IPv4.hs:43:1: error:
    Failed to load interface for ‘Data.Vector.Generic.Mutable’
    Use -v to see a list of the files searched for.

src/Net/IPv4.hs:44:1: error:
    Failed to load interface for ‘Control.Monad.Primitive’
    Use -v to see a list of the files searched for.

src/Net/IPv4.hs:45:1: error:
    Failed to load interface for ‘Net.Internal’
    Use -v to see a list of the files searched for.

src/Net/IPv4.hs:46:1: error:
    Failed to load interface for ‘Data.Text.Lazy’
    Perhaps you meant
      Data.Map.Lazy (from containers-0.5.7.1)
      Data.STRef.Lazy (from base-4.9.0.0)
    Use -v to see a list of the files searched for.

src/Net/IPv4.hs:47:1: error:
    Failed to load interface for ‘Data.Text.IO’
    Use -v to see a list of the files searched for.

I'm guessing that the GHCi environment that doctest ends up using is missing almost everything. How can I prevent this from happening? The reason this is actually a problem for me is that on nixpkgs, my tests fail. This can be easily confirmed by running:

nix-build -p "haskellPackages.ip"

Granted, nix actually uses cabal build instead of cabal new-build but I still run into the problem of missing packages.

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

1 participant