policeman icon indicating copy to clipboard operation
policeman copied to clipboard

Panic! ... hie file versions don't match

Open vrom911 opened this issue 5 years ago • 3 comments

:cold_sweat: :exclamation: I tried it on the shortcut-links package with the latest changes there but and I got:

policeman: policeman: panic! (the 'impossible' happened)
  (GHC version 8.8.1 for x86_64-unknown-linux):
	readHieFile: hie file versions don't match for file: /home/vrom911/Kowainik/shortcut-links/.policeman-evidence/shortcut-links-0.5.0.0/.hie/ShortcutLinks.hie Expected 8081 but got 8083

Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

Possible reason could be that I currently use GHC-8.8.3 but the policeman was build and installed with GHC-8.8.1. We need to do something with this though :thinking:

vrom911 avatar May 06 '20 14:05 vrom911

@vrom911 Good catch! That's an unpleasant situation 😥 Because there always will be a chance that the policeman will be built with a different version of GHC from what people have on their machines. My common senses tells me that this should be a warning, not a panic, at least for different minor versions... Or at least, the newer GHC should support all older versions in HIE files. I'm not even sure that ghc-lib-parser will help with this, but we can check this.

chshersh avatar May 06 '20 15:05 chshersh

This panic also is raised if an old .hie directory is left over from a previous policeman/ghc version combination which is even more confusing:

I had GHC 8.10.2 installed and policeman installed, upgraded GHC and rebuilt policeman and was faced with this panic in a project I had. The "fix" for the situation was deleting the .hie directory, but this took me a lot of guessing to figure out.

sternenseemann avatar Mar 09 '21 18:03 sternenseemann

Maybe policemen could set a new temporary HIE directory (-hiedir) in .policeman-evidence and also make sure that the GHC version it needs is used for compilation (--with-compiler).

In my case, I was able to solve the issue by running git clean -fxd and uninstalling other GHCs, so that policeman can't choose the wrong one.

xsebek avatar Oct 14 '22 08:10 xsebek