Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added hie.yaml, fixes HLS problems #323

Merged
merged 1 commit into from
Jan 1, 2022

Conversation

farzadbekran
Copy link
Contributor

Auto generated via:

> stack install implicit-hie
> gen-hie > hie.yaml

then changed cradle type (line 2) from cabal to stack.

Auto generated via:
> stack install implicit-hie
> gen-hie > hie.yaml
@agentm
Copy link
Owner

agentm commented Oct 31, 2021

I haven't used HLS, but is there any indication of why it can't work automatically and without this generated hie.yaml file?

@farzadbekran
Copy link
Contributor Author

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.

@agentm
Copy link
Owner

agentm commented Oct 31, 2021

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.

@farzadbekran
Copy link
Contributor Author

I don't think so. As far as I know, this only affects HLS.

@agentm
Copy link
Owner

agentm commented Oct 31, 2021

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.

@farzadbekran
Copy link
Contributor Author

Yes, in that case they would need to change line 2 to cabal:

@ilyakooo0
Copy link
Contributor

ilyakooo0 commented Nov 1, 2021 via email

@farzadbekran
Copy link
Contributor Author

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.

@farzadbekran
Copy link
Contributor Author

@agentm do you want me to close this?

@agentm
Copy link
Owner

agentm commented Nov 30, 2021

No, I intend to test this myself- I just haven't had yet time. Sorry for the delay!

@farzadbekran
Copy link
Contributor Author

No it's allright, I thought maybe you are just being nice to me and want me to do it myself XD

@agentm
Copy link
Owner

agentm commented Dec 5, 2021

project-m36.cabal includes -f-external-interpreter which causes HLS to crash. The hie.yaml for cabal mode will need to override this flag.

@farzadbekran
Copy link
Contributor Author

farzadbekran commented Dec 5, 2021

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.

@agentm agentm merged commit 0990a90 into agentm:master Jan 1, 2022
@agentm
Copy link
Owner

agentm commented Jan 1, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants