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

Allow specifying the GHC to be used for the cabal cradle #148

Closed
alanz opened this issue Jan 31, 2020 · 10 comments
Closed

Allow specifying the GHC to be used for the cabal cradle #148

alanz opened this issue Jan 31, 2020 · 10 comments

Comments

@alanz
Copy link

alanz commented Jan 31, 2020

A standard idiom is cabal new-configure --with-compiler=ghc-8.8.2.

Given a hie.yaml file is intended to set up the local developer's intentions, we should be able to specify the GHC compiler version with a cabal cradle.

As a side-effect, this can help tooling like hie and its successors to choose an appropriate version to run.

@sureyeaah
Copy link

I would like to take this on. It seems like a relatively easy task. What do you think?

@fendor
Copy link
Collaborator

fendor commented Feb 2, 2020

That sounds nice! However, designing a nice API doesnt sound as easy. Also, we got to think about #44 of which this could be an extension. In a different approach, we could use cabal-install-parsers in hie/ghcide/hls to find the ghc version automatically.
I am happy for PR's but would like to discuss design ideas such as modifications in hie.yaml as well as changes in the types before.

@sureyeaah
Copy link

Has there been any progress on #44 ?

@fendor
Copy link
Collaborator

fendor commented Feb 2, 2020

I have been implementing a prototype but there is not much to show at the moment.
First step would be discussing an hie.yaml format for it and should it be a global option, per cradle, etc... A lot to discuss. If you have any ideas, you can write them in #44!

@fendor
Copy link
Collaborator

fendor commented Feb 3, 2020

@alanz Would it be better if hie-bios honours the configuration in cabal.project, etc... or if it was possible to specify the ghc version in hie.yaml?

@jneira
Copy link
Member

jneira commented Feb 3, 2020

both? 😝
but i see the first one in cabal-parser/cabal-helper and the explicit one in hie-bios
We will have to link to cabal-parser/helper in hie-bios to get the first one, right?

@fendor
Copy link
Collaborator

fendor commented Feb 3, 2020

Not sure if both is really nice. E.g. cabal configure -w ghc-8.6.4 but you specify a different ghc in hie.yaml?

@alanz
Copy link
Author

alanz commented Feb 3, 2020

Hmm, I have been mentally using a workflow where the cabal.project is under version control, and is "general", without specifying the GHC version. This simplifies things like CI.

Then when working with a particular GHC version you configure it to use that. And I guess the same effect comes from using cabal.project.local.

But I have had experiences where I am working on a project which I manually configured with one version of GHC (say ghc-8.8.2), and then hie-bios periodically reconfigures it with the "default" ghc, being 8.6.5. So you end up fighting with it.

@fendor
Copy link
Collaborator

fendor commented Feb 3, 2020

Yes, and I think the most intuitive approach would be that hie-bios uses the correctly configured version from cabal.project.local. However, if it does that, a custom field in hie.yaml would be superfluous.

@jneira
Copy link
Member

jneira commented Jul 30, 2021

closing as duplicate in favor of #194 (As there is a technical discussion on how to accomplish and a linked pr)

@jneira jneira closed this as completed Jul 30, 2021
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

No branches or pull requests

4 participants