-
Notifications
You must be signed in to change notification settings - Fork 210
Extract Cabal-Helper specific code into its own library #1631
Comments
I've just discovered that |
In case we decided to create the library, what about |
I really like the abstraction boundary that hie-bios figures out what the flags for the session should be. If it became a plugin API that I could then configure I'd be much less happy, as it's something I'm super grateful to not have to care about. Whether it incorporates or includes cabal-helper like functionality under the hood is a detail, so if this is transparent, I'm fine with it. |
I would not have considered it a plugin API, but I think I see what you mean. |
Is the cabal-helper to hie-bios cradle something ghcide has to mix in? I don't like that idea. Or something that hie-bios always links in? If so, I don't see the advantage of separating the package. |
No, currently only hie uses it and hls copied the code to https://github.com/haskell/haskell-language-server/blob/master/src/Ide/Cradle.hs |
I think hls and ghcide should converge on this as much as possible. |
Absolutely agreed. I think, somewhere it was mentioned that you agreed in bristol to use cabal-helper? Should there be an attempt to use cabal-helper in ghcide?
|
@ndmitchell just in case it would be solvable, what are your concerns about link statically cabal-helper in ghcide? is it that it depends on the Cabal library or another problematic lib? or the runtime compilation it triggers? If hls uses cabal helper directly it will need to pass the cradle generated by c-h to ghcide (the component that actually is using it directly). Not sure if ithat is already possible in ghcide or it should be changed to accept "external" cradles. Obviously if we add support in ghcide both would have the implicit cradle available. Imo it would be the desirable option over the former one. Other options i can think of:
|
I've heard cabal-helper takes a lot of work to support. At the moment, if there's an issue with the GHC flags, I go to hie-bios because the contract is hie-bios provides the flags to start a GHC session. I like the abstract interface "give me the flags" and the support model "ping Matthew et al". It's as much lines of communication and separation of responsibilities as it is code. If you guys want to shove cabal-helper behind the same interface and support model, provided there is no GPL impact, I'm happy (and moreover, consider it none of my business). |
That is exactly how we integrated cabal-helper. It is hidden within a |
Which should end up wherever we agree |
Well i think the consesus had been using the cabal-helper cradle in haskell-language-server, cause cradle setup is in the main exe module owned by h-l-s: haskell/haskell-language-server#38 (comment) EDIT: well, a concern is we have to port manually each change in the cabal-helper cradle between hie and hls |
I still think outsourcing it into different package does no harm and makes it easier to support both hls and hie. |
@fendor no other than the usual overhead of maintain a separate lib: github repo, maybe upload to hackage/stackage, etc and the fact hie will be deprecated at some point. |
Other option could be integrate the cabal-helper cradle in cabal-helper itself, if @DanielG agree it is a good idea add hie-bios as dependency. |
I think, for now I would prefer it as a separate library. I feel like it does not really belong into cabal-helper. However, lets wait for @DanielG opinion :) |
Talking with @jneira on irc, we realized this makes it easier to share code between the projects hie, hls and, potentially, ghcide!
Code would be entirely taken from
Cradle.hs
inhie-plugin-api
and the entire logic of discovering cradles with cabal-helper would be moved into its own library.Opinions?
The text was updated successfully, but these errors were encountered: