haskell / hie-bios

Set up a GHC API session for various Haskell Projects
https://hackage.haskell.org/package/hie-bios
BSD 3-Clause "New" or "Revised" License
181 stars 63 forks source link

bios cradle: Allow `with-ghc` to be specified programmatically #401

Open sol opened 1 year ago

sol commented 1 year ago

Similar to how you can specify dependencies programmatically by writing to $HIE_BIOS_DEPS I would like to be able to specify with-ghc programmatically by writing to e.g. $HIE_BIOS_WITH_GHC.

fendor commented 1 year ago

Unfortunately, what you are proposing is too late for HLS. The GHC version is cradle wide, but what you are describing is per Component. See https://github.com/haskell/hie-bios/pull/274 for a discussion.

sol commented 1 year ago

@fendor just to make sure that I understand your point correctly, are you saying that instead of

cradle:
  bios:
    shell: ... # determine options and path to ghc

we would need something like

cradle:
  bios:
    shell: ... # determine options
    with-ghc:
      shell: ... # determine path to ghc

(That is, we need the user to specify two separate commands, one for options, and one for the GHC version.).

Is that where you are heading at?

fendor commented 1 year ago

Yes, exactly!