haskell-ide-engine icon indicating copy to clipboard operation
haskell-ide-engine copied to clipboard

Panic on due to order of installation of hie-8.6.5 and hie-8.4.4 for ghc-8.6.5 projects

Open qenep opened this issue 4 years ago • 1 comments

  1. For a stub project,

    $ stack new project hpack
    $ cd project && stack setup && stack build
    

    which goes now with resolver: lts-14.19 (has no effect if reduced to lts-14.18) in stack.yaml,

  2. having previously installed hie via

    $ pwd
    ~/<omitted>/haskell-ide-engine
    $ stack ./install.hs hie-8.6.5
    $ stack ./install.hs hie-8.4.4
    

    (the binaries hie and hie-wrapper were copied), opening in the new stub project nvim src/Main.hs with resolver: lts-14.19 or 14.18,

  3. using hie-wrapper or stack exec ghcide for the invocation of the language server,

results in

Error:hie: "panic! (the 'impossible' happened)
  (GHC version 8.4.4 for x86_64-unknown-linux):
        Dynamic linker not initialised

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

even though the project resolver is for GHC 8.6.5. The wrong version of hie is run, but the process hie-8.4.4 has not been started.

For background, see https://gitlab.haskell.org/ghc/ghc/issues/9868, resolved in GHC 8.6.1.

Simply reinstalling hie-8.6.5,

$ stack ./install.hs hie-8.6.5

was not enough, but then terminating the hie processes,

$ killall -9 hie-wrapper hie hie-8.6.5 ghcide

solved the issue.

#1386 is somewhat related. I'll investigate the issue further a bit later.

I believe that hie and hie-wrapper should not depend on the order of installation. For instance, I have older hie-8.* binaries (2019-11-01) for all but hie-8.4.4 and hie-8.6.5 (2019-12-28), which I'd expect not to have to rebuild unnecessarily. It is clear, that the overhead from running stack ./install ... for compiled binaries is minimal, but to maintain the order would involve rebuilding the entire hie project.

qenep avatar Dec 30 '19 09:12 qenep

I am a bit confused, why was the older HIE version selected? What were the hie candidate exes from hie-wrapper? Do you still have the logs for that?

fendor avatar Dec 30 '19 09:12 fendor