haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 210 forks source link

ByteCodeLink.lookupCE During interactive linking #1339

Open CapSel opened 5 years ago

CapSel commented 5 years ago

I use Archlinux... and I installed haskell-ide-engine according to instructions here. Then I created a new project with "stack new bonsai-hs yesod/sqlite". Then I set up neovim, and atom to use hie. Both are now reporting this error:

Got error while processing diagnostics: ByteCodeLink.lookupCE During interactive linking, GHCi couldn't find the following symbol: persistentzmsqlitezm2zi9zi3zm3vTiF1ekhY7K8mC4ISF5xR_DatabaseziPersistziSqlite_zdfFromJSONSqliteConf_closure This may be due to you not asking GHCi to load extra object files, archives or DLLs needed by your current session. Restart GHCi, specifying the missing library using the -L/path/to/object/dir and -lmissinglibname flags, or simply by naming the relevant files on the GHCi command line. Alternatively, this link failure might indicate a bug in GHCi. If you suspect the latter, please send a bug report to: glasgow-haskell-bugs@haskell.org
Anrock commented 5 years ago

Does stack ghci work for this project?

CapSel commented 5 years ago

Yes, it does:


Using main module: 1. Package `bonsai-hs' component bonsai-hs:exe:bonsai-hs with main-is file: /home/capsel/projects/bonsai-hs/app/main.hs
bonsai-hs> configure (lib + exe)
Configuring bonsai-hs-0.0.0...
bonsai-hs> initial-build-steps (lib + exe)
The following GHC options are incompatible with GHCi and have not been passed to it: -O2 -threaded
Configuring GHCi with the following packages: bonsai-hs
GHCi, version 8.6.5: http://www.haskell.org/ghc/  :? for help
[ 1 of 13] Compiling Model            ( /home/capsel/projects/bonsai-hs/src/Model.hs, interpreted )
[ 2 of 13] Compiling Settings         ( /home/capsel/projects/bonsai-hs/src/Settings.hs, interpreted )
[ 3 of 13] Compiling Settings.StaticFiles ( /home/capsel/projects/bonsai-hs/src/Settings/StaticFiles.hs, interpreted )
[ 4 of 13] Compiling Import.NoFoundation ( /home/capsel/projects/bonsai-hs/src/Import/NoFoundation.hs, interpreted )
[ 5 of 13] Compiling Foundation       ( /home/capsel/projects/bonsai-hs/src/Foundation.hs, interpreted )
[ 6 of 13] Compiling Import           ( /home/capsel/projects/bonsai-hs/src/Import.hs, interpreted )
[ 7 of 13] Compiling Handler.Profile  ( /home/capsel/projects/bonsai-hs/src/Handler/Profile.hs, interpreted )
[ 8 of 13] Compiling Handler.Home     ( /home/capsel/projects/bonsai-hs/src/Handler/Home.hs, interpreted )
[ 9 of 13] Compiling Handler.Common   ( /home/capsel/projects/bonsai-hs/src/Handler/Common.hs, interpreted )
[10 of 13] Compiling Handler.Comment  ( /home/capsel/projects/bonsai-hs/src/Handler/Comment.hs, interpreted )
[11 of 13] Compiling Application      ( /home/capsel/projects/bonsai-hs/src/Application.hs, interpreted )
[12 of 13] Compiling Main             ( /home/capsel/projects/bonsai-hs/app/main.hs, interpreted )
[13 of 13] Compiling DevelMain        ( /home/capsel/projects/bonsai-hs/app/DevelMain.hs, interpreted )
Ok, 13 modules loaded.
Loaded GHCi configuration from /tmp/haskell-stack-ghci/23f2448c/ghci-script
*Main Application DevelMain Foundation Handler.Comment Handler.Common Handler.Home Handler.Profile Import Import.NoFoundation Model Settings Settings.StaticFiles>```
samuelpilz commented 5 years ago

I am able to reproduce this error. The error message is exactly the same for me. I installed hie fresh form master.

CapSel commented 5 years ago

Should I install hie not from master?

samuelpilz commented 5 years ago

@CapSel master is fine. We will try to investigate this issue

Anrock commented 5 years ago

Should I try reproducing it on OSX/Win/Gentoo or is it arch-only issue?

samuelpilz commented 5 years ago

@Anrock please do. I suspect this is a general issue.

To reproduce:

Anrock commented 5 years ago

Hm, just checked on OSX, hie-8.6.5 from a3840a8, neovim + CoC, stack resolver lts-13.29. In src/Application.hs I only get hlint parse error on line 64.

CapSel commented 5 years ago

Try with src/Handler/Comment.hs

Anrock commented 5 years ago

Still fine on OSX with hie-8.6.5 from cea1b9c4. Hlint parse error in src/Application.hs disappeared, in src/Handler/Comment.hs everything is fine too, only hlint complains about redundant bracket.

fendor commented 5 years ago

Can not reproduce on NixOS with current master 0.11.0.0 built from all-hies

CapSel commented 5 years ago

I just pulled from master, installed it, then stack clean and stack purge, stack build inside yesod project.

I'm installing hie with:

stack ./install.hs hie-8.6.5
stack ./install.hs build-data

Same effect. It shows in neovim few seconds after opening file. First it shows some message about "redundant bracket found".

nvim ./src/Handler/Comment.hs

fendor commented 5 years ago

Maybe this is one of these legendary dynamic linking bugs?

samuelpilz commented 5 years ago

The system-ghc does indeed have linking issues. However, the ghcs installed via stack and ghcup are linked statically. How do I know which ghc is used by ghc-mod?

CapSel commented 5 years ago

I just removed ghc from system (pacman -Rucs ghc) then:

No ghc was installed by stack - according to logs. Problem persists.