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

Bad interface file #59

Closed
vladfi1 opened this issue Nov 16, 2015 · 12 comments
Closed

Bad interface file #59

vladfi1 opened this issue Nov 16, 2015 · 12 comments

Comments

@vladfi1
Copy link

vladfi1 commented Nov 16, 2015

Not sure if I'm doing some cabal stuff wrong, but many packages fail to install with errors such as:

Data/Vector/Generic/Mutable/Base.hs:18:1: error:
    Bad interface file: /home/vlad/.cabal/lib/x86_64-linux-ghc-7.11.20151105/primitive-0.6.1.0-8Jz4K59dPOf6o0RskSAcsI/Control/Monad/Primitive.hi
        Something is amiss; requested module  primitive-0.6.1.0@primitive-0.6.1.0-6e2bf8a246570709ff94b3431f90c219:Control.Monad.Primitive differs from name found in the interface file primi_8Jz4K59dPOf6o0RskSAcsI:Control.Monad.Primitive
Failed to install vector-0.11.0.0
@goldfirere
Copy link
Owner

I can't be sure, but my guess is that something is amiss locally on your machine. Recent updates to this branch have changed the interface file format. I recommend doing a make maintainer-clean and then building again from scratch. This will also wipe your package database, but that's a good thing in this case. If my hunch is right, could you close this ticket once you have it working locally? Thanks!

@vladfi1
Copy link
Author

vladfi1 commented Nov 20, 2015

That did not work. After installing should I be using cabal any differently than I normally do? As far as I can tell all packages are separated by ghc version...

@goldfirere
Copy link
Owner

Can you give me steps to reproduce? I use cabal install --with-ghc=<full path, from /, to my built ghc-stage2>

@vladfi1
Copy link
Author

vladfi1 commented Nov 20, 2015

  1. Build following the instructions in the readme.
  2. make install - on my machine this puts ghc in /usr/local/bin which is on my PATH.
  3. cabal install vector

@vladfi1
Copy link
Author

vladfi1 commented Nov 20, 2015

Also, do you have a better way of updating the git submodules than switching the git remote url each time? Possibly related: I notice that one of these submodules is actually vector (edit: and primititive). Could this be conflicting with the cabal installation of vector?

@brprice
Copy link

brprice commented Nov 28, 2015

I'm also having this issue (or something very similar), and now it affects vanilla HEAD also.
As mentioned in the thread starting https://mail.haskell.org/pipermail/ghc-devs/2015-November/010584.html , using cabal HEAD makes the issue go away. (I don't know what the underlying problem is though.)

@vladfi1
Copy link
Author

vladfi1 commented Nov 28, 2015

Using cabal HEAD did not fix it for me.

@goldfirere
Copy link
Owner

I've not tried yet to fix this, but I am surprised by this bug. Then I saw this float by, from Simon Marlow, when Simon PJ hit this same problem:

You probably have .hi files generated by a previous version of HEAD installed under your ~/.cabal/lib, and the current HEAD chokes on them. Try rm -rf ~/.cabal/lib/*ghc-7.11*

Does that fix it for you?

@vladfi1
Copy link
Author

vladfi1 commented Dec 4, 2015

After doing that I get errors such as:

Could not find module ‘Control.Monad.Primitive’
There are files missing in the ‘primitive-0.6.1.0@primitive-0.6.1.0-925bc530f2c1182d9da7d86b705f8e46’ package,
try running 'ghc-pkg check'.

ghc-pkg check tells me that

There are problems in package primitive-0.6.1.0:
  Warning: library-dirs: /home/vlad/.cabal/lib/x86_64-linux-ghc-7.11.20151121/primitive-0.6.1.0-FXpuG5lSLDa5olfPk5aI7f doesn't exist or isn't a directory

...

The following packages are broken, either because they have a problem
listed above, or because they depend on a broken package.
primitive-0.6.1.0
th-lift-0.7.5
safe-0.3.9
mtl-2.2.1
syb-0.6

@goldfirere
Copy link
Owner

What if you ghc-pkg unregister each of those packages and then rebuild your package library from scratch? The comment above that someone ran into this problem in HEAD makes me strongly suspect that the problem is local somehow. (Not saying that GHC couldn't improve in this respect, but that it's all exacerbated by some local setup.)

@int-index
Copy link

I've encountered a similar problem today and solved it by switching to cabal HEAD.

@vladfi1
Copy link
Author

vladfi1 commented Jan 10, 2016

Removed .cabal/lib/ghc-7.11*, ghc-pkg unregistered primitive, cabal installed vector using cabal head, and for some reason this time around it just worked.

@vladfi1 vladfi1 closed this as completed Jan 10, 2016
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

4 participants