Closed farzadbekran closed 2 years ago
I haven't used HLS, but is there any indication of why it can't work automatically and without this generated hie.yaml file?
In my case, it seems the reason was that HLS tried to compile with cabal, which then uses my system-wide GHC. Since I don't use cabal at all, that ended up missing the packages and dependencies. So putting this file there forces HLS to use stack, and renaming stack-ghc8.8.yaml to stack.yaml sloved my HLS issues.
Ah, thanks for the explanation. If we merge this, will cabal users get an error then? Since cabal is my primary dev tool, I'll test it out.
I don't think so. As far as I know, this only affects HLS.
Sorry, to clarify, if a user wants to use HLS without stack (only cabal is installed), will this hie.yaml file prevent them from using HLS? I'll test that before merging.
Yes, in that case they would need to change line 2 to cabal:
We could provide two versions of the hie.yaml file named stack.hie.yaml and cabal.hie.yaml. Then, we add hie.yaml to gitignore.
This way everyone can symlink whichever version they want to use to hie.yaml and everyone wins.
On Mon, 1 Nov 2021 at 08:21, Farzad Bekran @.***> wrote:
Yes, in that case they would need to change line 2 to cabal:
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/agentm/project-m36/pull/323#issuecomment-955942711, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPMAW7LLXX26JWYWP3YC6DUJYPV7ANCNFSM5HBRZ5AA .
We could provide two versions of the hie.yaml file named stack.hie.yaml and cabal.hie.yaml. Then, we add hie.yaml to gitignore. This way everyone can symlink whichever version they want to use to hie.yaml and everyone wins. … On Mon, 1 Nov 2021 at 08:21, Farzad Bekran @.***> wrote: Yes, in that case they would need to change line 2 to cabal: — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#323 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPMAW7LLXX26JWYWP3YC6DUJYPV7ANCNFSM5HBRZ5AA .
Yeah makes sense. Thanks for the suggestion.
@agentm do you want me to close this?
No, I intend to test this myself- I just haven't had yet time. Sorry for the delay!
No it's allright, I thought maybe you are just being nice to me and want me to do it myself XD
project-m36.cabal includes -f-external-interpreter
which causes HLS to crash. The hie.yaml for cabal mode will need to override this flag.
Makes sense I guess. The other day which I was trying to reach you, my HLS was acting up again. I eventually ended up changing my hie.yaml
to this:
cradle:
stack:
stackYaml: "./stack.yaml"
component: "project-m36:lib"
Also, in my project-m36.cabal
I changed the haskell-scripting
flag's default to False. This got things working again. Could you check on your end @agentm? This seems to work correctly for me.
I added some developer-oriented documentation and two files (cabal.hie.yaml
and stack.hie.yaml
) which the user can choose. Stackage LTS 18.20 was released a few days ago which support GHC 8.10.7, so I bumped up the stack.ghc8.10.yaml configuration to use that and pointed the stack.hie.yaml
configuration at that.
Auto generated via:
then changed cradle type (line 2) from cabal to stack.