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

State of multiple home units for HLS #3738

Closed
8 tasks done
Tracked by #181
fendor opened this issue Jul 31, 2023 · 10 comments
Closed
8 tasks done
Tracked by #181

State of multiple home units for HLS #3738

fendor opened this issue Jul 31, 2023 · 10 comments
Labels
type: enhancement New feature or request

Comments

@fendor
Copy link
Collaborator

fendor commented Jul 31, 2023

Loading multiple cabal/stack components into HLS has been a pain point since its early beginnings.
Essentially, it allows us to provide diagnostics and code actions across components, such as libraries, executables, test suites, etc...

In this issue, we outline the current progress of native multiple home unit support.

This means, we have native multi repl support for cabal >=3.11 and GHC >=9.4 once hie-bios's #409 is merged and published.


However, not everyone can switch to cabal-3.12 (once it is released), so we are thinking about adding custom support for older cabal versions, using build-info and exploiting the information from plan.json. The idea is as follows:

  • For all targets, figure out the component they belong to using build-info.json
  • Calculate the dependency closure of all targets that shall be loaded into the same GHC session. This upholds the closure property for GHC.
  • Read the respective build-info.json files to find the build options of local components.
@fendor fendor added the type: enhancement New feature or request label Jul 31, 2023
@wz1000
Copy link
Collaborator

wz1000 commented Jul 31, 2023

I don't think its unreasonable to expect users to upgrade to cabal 3.12 to get this to work reliably.

@michaelpj
Copy link
Collaborator

Right, but things need to work gracefully if they don't have it.

Wasn't there an implicit-hie bit?

@wz1000
Copy link
Collaborator

wz1000 commented Jul 31, 2023

Right, but things need to work gracefully if they don't have it.

Yes, they will continue to work (or not work) as they currently have been.

Wasn't there an implicit-hie bit?

I think implicit-hie can interfere with the cradles and prevent them from being usable for multi-unit support.

@michaelpj
Copy link
Collaborator

I think implicit-hie can interfere with the cradles and prevent them from being usable for multi-unit support

In particular, the thing that I want to be true is that a user who has a new enough cabal and a new enough GHC should just get a multi-repl cradle, without having to do manual configuration.

@michaelpj
Copy link
Collaborator

  • We also need a way to turn it off in case it's buggy.
    • Where to configure? hie.yaml?
  • We want it to be clear from the logs whether it's on or not, since it'll probably be relevant for bug reports.
  • We also need a cabal release.

@michaelpj
Copy link
Collaborator

I think this is almost done, the only question in my mind is whether we're logging this clearly?

@michaelpj
Copy link
Collaborator

I'm not sure if we have in fact got the usability bits I suggested in #3738 (comment) ? @fendor @wz1000 ? I do think it's quite important that we can turn this off and that it's clearly signalled in the logs.

@fendor
Copy link
Collaborator Author

fendor commented Apr 2, 2024

Indeed, as reported by haskell/cabal#9860, we do not have the desired usability bits in place, if I am not mistaken.

However, it should be possible to implement the usability feature entirely on the HLS side.

@michaelpj
Copy link
Collaborator

I think we can close this now!

@jhrcek
Copy link
Collaborator

jhrcek commented Apr 23, 2024

What a journey! Can't wait to migrate our project to cabal and start using it.
Thanks to everyone involved 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants