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

HIE automatically uses old HIE #1177

Open falsandtru opened 5 years ago

falsandtru commented 5 years ago

It makes a lot of unnecessary debugging.

2019-04-17 03:08:19.057640292 [ThreadId 4] - run entered for hie-wrapper(hie-wrapper) Version 0.8.0.0 (2530 commits) x86_64 ghc-8.6.4
2019-04-17 03:08:19.06195586 [ThreadId 4] - Current directory:.../foundationdb-haskell
Downloading lts-11.13 build plan ...
Downloaded lts-11.13 build plan.
2019-04-17 03:08:51.325263859 [ThreadId 4] - Cradle directory:.../foundationdb-haskell
2019-04-17 03:08:51.325999133 [ThreadId 4] - Using stack GHC version
2019-04-17 03:08:51.586280534 [ThreadId 4] - Project GHC version:8.2.2
2019-04-17 03:08:51.587647332 [ThreadId 4] - hie exe candidates :["hie-8.2.2","hie-8.2","hie"]
2019-04-17 03:08:51.60171636 [ThreadId 4] - found hie exe at:.../.local/bin/hie-8.2.2
2019-04-17 03:08:51.602510839 [ThreadId 4] - args:["--lsp"]
2019-04-17 03:08:51.604104318 [ThreadId 4] - launching ....

2019-04-17 03:08:51.975795 [ThreadId 4] - Using stack GHC version
2019-04-17 03:08:52.243654 [ThreadId 4] - Run entered for HIE(hie-8.2.2) Version 0.6.0.0, Git revision 5245042a317944f394de20b29c55afd0bb0dbc76 (dirty) (2426 commits) x86_64 ghc-8.2.2
2019-04-17 03:08:52.318327 [ThreadId 4] - Current directory:.../foundationdb-haskell
2019-04-17 03:08:55.498324 [ThreadId 10] - Using stack GHC version
Using hie version: Version 0.6.0.0, Git revision 5245042a317944f394de20b29c55afd0bb0dbc76 (dirty) (2426 commits) x86_64 ghc-8.2.2
Using hoogle db at: .../.hoogle/default-haskell-5.0.17.hoo
hie-8.2.2: user error (Failed to find requested hint files:
  .../.local/bin/data/hlint.yaml
)
mpickering commented 5 years ago

What is the bug here? Are you actually reporting the final line ?

hie-8.2.2: user error (Failed to find requested hint files:
  .../.local/bin/data/hlint.yaml
)
falsandtru commented 5 years ago

HIE shouldn't try to use such old version in the first place: HIE(hie-8.2.2) Version 0.6.0.0, Git revision 5245042a317944f394de20b29c55afd0bb0dbc76 (dirty) (2426 commits) x86_64 ghc-8.2.2

mpickering commented 5 years ago

That is a good point. The wrapper should be a lot more precise about which version of hie it invokes.

fendor commented 5 years ago

Why shouldn't it try to use a version of hie that fits to the used GHC?

No old hie version is ever being downloaded, if this version is being used, then it was installed on the system. I dont see why the wrapper should perform a version check in this case. I should be able to use an old hie version if I want to, maybe it is more stable for my project, or I dont want to recompile every version.

EDIT: Also, the error in the last line is fixed in 0.8.0.0, or at least does not cause hie to crash.

falsandtru commented 5 years ago

I think very old versions should be rejected (Accept only 8.x.x in this case). And should warn or notice the use of old version (with 8.x.x).

fendor commented 5 years ago

Why should it? they are still working, older versions support sometimes older ghc versions, e.g. pre 8.x.x is supported only by very old versions. However, if they work for you, why should you be spammed for it?

falsandtru commented 5 years ago

I thought old versions such as 6.x.x of HIE are not needed. If old versions are sometimes needed, they have to be accepted. However, warning/notification for the use of old version would still be helpful.

fendor commented 5 years ago

They are not really needed, but also it is not a strict requirement to always have the most up-to-date version. It is also somewhat hard to know when there is a more recent version, what should the wrapper do, call home and ask what the most recent version is? Or is the version hard-coded in each wrapper version? If we can define a solution here, it shouldn't be too hard to implement.

mpickering commented 5 years ago

I think I would prefer it if the wrapper used absolute paths but I'm not a user.