[ANN] Cabal-3.12.0.0 released!

In my opinion, the most important benefit of multi-repl is correctness and reliability. While HLS works reasonably well, no one can disagree that HLS crashes sometimes. Sometimes HLS reports lovely error messages such as Overlapping instances and reports the same location twice. Sometimes HLS fails with interface file errors. The only way to fix these kinds of errors is restarting HLS, sometimes clearing out the caches.

Many of these hard-errors happen because the support for loading multiple components without cabalā€™s multi-repl feature (like a library, executable, test suites, sub-libraries, etcā€¦) is simply a hack. A pretty good one, and it served us well for many years by now, but a hack nonetheless.

The multi-repl feature will improve the correctness and reliability of HLS, once its infancy issues have been fixed.

13 Likes

Iā€™ve got a confirmation it works simultaneously across components and across packages, as long as all are ā€œlocalā€, that is, covered in your cabal.project.

2 Likes

I was primarily talking about ghci, because I can see what exactly is happening there. As @fendor has noted HLS seems to have quite a few tricks up its sleeve and unlike him Iā€™m not familiar with them, but I also did notice that HLS has gotten better at handling these cross-package scenarios surprisingly well over the years, and thanks to his answer, many mysterious crashes make much more sense now.

That said, when I say ghci, itā€™s also ghcid, because I also like to build various workflows on ghcid --test ... when the :reload cycle is fast.

2 Likes

If you want to see the carnage, go look at the issues labelled multi-component on the HLS repo :joy: Iā€™m hoping we can just close most of thoseā€¦

6 Likes

I have a large multi-library project and I continually get HLS errors about colliding instances because it seems to load both the source and previous compiled versions of the libraries. Itā€™s private code so it would be some effort to report a proper bug, Iā€™m just hoping that this does fix it for me :slight_smile:

6 Likes

Does the Haskell VSCode plugin need anything other than a new option / form field for multicomponent support?

Iā€™m on v2.4.3, and just added "haskell.sessionLoading": "multipleComponents" directly to my settings file, and it seems to be working. Iā€™m seeing references to --enable-multi-repl in cabal commands and overall it feels a lot more stable.

2 Likes