haskell / haskell-ide-engine

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

Can not parse platformConstants #1793

Open jdevoto opened 4 years ago

jdevoto commented 4 years ago

Hi

I just installed hie on linux mint 19.3. When I try to run it on a project i get

hie: Can't parse "/usr/lib/ghc/platformConstants"

The file platformConstants exists. Here is the file.

plat.txt

Any help is wellcome

Jorge

fendor commented 4 years ago

Hi, thank you for your bug report!

I have never seen this error, so we will need more information! E.g. cabal version (if any) stack version (if any) ghc version (if any)

and how you installed all of the above.

Also, which ghc version is stored in /usr/lib/ghc/ and how did you install HIE?

jdevoto commented 4 years ago

I have

cabal-install version 1.24.0.2 compiled using version 1.24.2.0 of the Cabal library

stack Version 2.3.1, ghc version 8.0.2

I installed it using apt-get install.

I installed hie with stack ./install.hs hie

fendor commented 4 years ago

cabal-install version 1.24.0.2

This is insanely old, I suggest to either remove or upgrade it.


Can you provide some logs? E.g. execute hie-wrapper --debug . in the root of your project?

jdevoto commented 4 years ago

Here is the log

2020-07-19 14:01:17.061074861 [ThreadId 4] - run entered for hie-wrapper(hie-wrapper) Version 1.4, Git revision a9005b2ba2050bdfdd4438f1d471a3f7985492cd (3901 commits) x86_64 ghc-8.8.3
2020-07-19 14:01:17.061804745 [ThreadId 4] - Current directory:/home/jorge/Haskell/Projects/Plotting
2020-07-19 14:01:17.062226526 [ThreadId 4] - Operating system:linux
2020-07-19 14:01:17.062398278 [ThreadId 4] - args:["--debug"]
2020-07-19 14:01:17.071946258 [ThreadId 4] - Cabal-Helper found these projects: ["ProjLocV2Dir {plProjectDirV2 = \"/home/jorge/Haskell/Projects/Plotting\"}","ProjLocV1Dir {plProjectDirV1 = \"/home/jorge/Haskell/Projects/Plotting\"}"]
2020-07-19 14:01:17.072313459 [ThreadId 4] - These projects have the build tools installed: ["ProjLocV2Dir {plProjectDirV2 = \"/home/jorge/Haskell/Projects/Plotting\"}","ProjLocV1Dir {plProjectDirV1 = \"/home/jorge/Haskell/Projects/Plotting\"}"]
2020-07-19 14:01:17.072426244 [ThreadId 4] - Cabal-Helper decided to use: ProjLocV2Dir {plProjectDirV2 = "/home/jorge/Haskell/Projects/Plotting"}
2020-07-19 14:01:17.072541762 [ThreadId 4] - Cabal-Helper dirs: ["/home/jorge/Haskell/Projects/Plotting","/home/jorge/Haskell/Projects/Plotting/File.hs"]
2020-07-19 14:01:17.07265335 [ThreadId 4] - Module "/home/jorge/Haskell/Projects/Plotting/File.hs" is loaded by Cradle: Cradle {cradleRootDir = "/home/jorge/Haskell/Projects/Plotting", cradleOptsProg = CradleAction: Other CabalV2}
2020-07-19 14:01:17.07278918 [ThreadId 4] - Cradle directory:/home/jorge/Haskell/Projects/Plotting
2020-07-19 14:01:17.073029816 [ThreadId 4] - Executing GHC on path with args: --numeric-version
2020-07-19 14:01:17.121206663 [ThreadId 4] - GHC Output: "Just "8.0.2""
2020-07-19 14:01:17.121324217 [ThreadId 4] - Project GHC version:8.0.2
2020-07-19 14:01:17.121387045 [ThreadId 4] - hie exe candidates :["hie-8.0.2","hie-8.0","hie"]
2020-07-19 14:01:17.121671781 [ThreadId 4] - found hie exe at:/home/jorge/.local/bin/hie
2020-07-19 14:01:17.121729222 [ThreadId 4] - args:["--debug"]
2020-07-19 14:01:17.121887863 [ThreadId 4] - launching ....

2020-07-19 14:01:17.170418996 [ThreadId 4] - Cabal-Helper found these projects: ["ProjLocV2Dir {plProjectDirV2 = \"/home/jorge/Haskell/Projects/Plotting\"}","ProjLocV1Dir {plProjectDirV1 = \"/home/jorge/Haskell/Projects/Plotting\"}"]
2020-07-19 14:01:17.170878072 [ThreadId 4] - These projects have the build tools installed: ["ProjLocV2Dir {plProjectDirV2 = \"/home/jorge/Haskell/Projects/Plotting\"}","ProjLocV1Dir {plProjectDirV1 = \"/home/jorge/Haskell/Projects/Plotting\"}"]
2020-07-19 14:01:17.17097161 [ThreadId 4] - Cabal-Helper decided to use: ProjLocV2Dir {plProjectDirV2 = "/home/jorge/Haskell/Projects/Plotting"}
2020-07-19 14:01:17.171037663 [ThreadId 4] - Cabal-Helper dirs: ["/home/jorge/Haskell/Projects/Plotting","/home/jorge/Haskell/Projects/Plotting/File.hs"]
2020-07-19 14:01:17.171098482 [ThreadId 4] - Module "/home/jorge/Haskell/Projects/Plotting/File.hs" is loaded by Cradle: Cradle {cradleRootDir = "/home/jorge/Haskell/Projects/Plotting", cradleOptsProg = CradleAction: Other CabalV2}
2020-07-19 14:01:17.171220651 [ThreadId 4] - Executing GHC on path with args: --numeric-version
2020-07-19 14:01:17.220518956 [ThreadId 4] - GHC Output: "Just "8.0.2""
2020-07-19 14:01:17.220721488 [ThreadId 4] - Executing GHC on path with args: --print-libdir
2020-07-19 14:01:17.28473491 [ThreadId 4] - GHC Output: "Just "/usr/lib/ghc""
hie: Can't parse "/usr/lib/ghc/platformConstants"
hie-wrapper: callProcess: /home/jorge/.local/bin/hie "--debug" (exit 1): failed
fendor commented 4 years ago

You're ghc version for the project seems to be wrong. So, essentially, the problem is that you are a very old cabal version, you must upgrade it and you should have ghc-8.8.3 on your path. E.g. ghc --numeric-version should return 8.8.3. If that happens, then the error message should go away. Or you use a stack project, but then you have to make sure to have a stack.yaml on your path.