Cabal developers meeting of the 17/08/2023

Theophile Hécate Choutri hecate at haskell.foundation
Thu Aug 17 20:25:12 UTC 2023


Hi everyone, here are the minutes of the meeting:
---
# Cabal meeting (17/08/2023)

Previously: https://hackmd.io/2EPSwwg8QqqZ96cFdW2wTQ

## Next Release

- Help needed with [#9088](https://github.com/haskell/cabal/pull/9088).
  - Hécate: If we can't get it through, we'll skip it for this backport.

## Cabal exact-printing in HLS

* HLS has a cabal plugin:
https://discourse.haskell.org/t/hsoc-hls-cabal-file-support/7331/2
    * Establishing a context for completions (Value Context, Keyword
Context, ...) is not easily possible
    * Custom parsing that works 95% of the time is used.
    * Fitting .cabal intermediate structures would improve the code and
reduce maintenance burden for HLS team.
* Often requested feature in HLS:
https://github.com/haskell/haskell-language-server/issues/3595
    * Requires parsing and modifying .cabal files without modifying the
rest of the cabal file
    * GenericPackageDescription insufficient due to loss of Source Positions
    * Intermediate representations of .cabal files are unknown / hard to
discover
    * Custom megaparsec parser used for POC of Code Action "Add module to
exposed-modules" field.
        * FYI, this code action is working for a lot of use-cases already
    * Explicit goal of being an exactprinter
* See [megaissue](
https://github.com/haskell/cabal/issues/7544#issuecomment-934009792) (and
there is a whole github project, linked to in the issue).
* While the HLS's custom parser serves a different purpose, it'd be much
nicer  if we could re-use Cabal directly
* In a dicussion, @fendor and @andreabedini talked about a way forward:
    * Let's make `[Field ann]` roundtripping by modifying the lexer
        * Trailing whitespace needs to be handled
        * Comments need to be handled
        * Are braces currently handled in the lexer or are they a part of
`ann`?
        * POC branch by @andreabedini available
    * `Field ann` gives us enough information to implement the Code Action
for HLS
    * Ideally, we also make `Fields ann` (note: different intermediate
representation) roundtrip with `[Field ann]`

Pros:
* We are relatively close to achieving roundtrips of `[Field ann] <->
.cabal`
* Immense help for tooling already

Cons:
* No field analysis, further parsing required.

Proposed roadmap:
1. HLS releases with the Code Action using a custom parser
2. The custom parser is replaced by `[Field ann]` internally, but still
permitting an interface HLS can use
3. Improve the lexer and enable roundtripping of `[Field ann] <-> .cabal
file`
4. Evaluate what Code Actions and IDE features can be implemented on top of
that

## Cabal nix integration

- [Users’ survey](
https://discourse.haskell.org/t/community-survey-removing-cabals-nix-integration/7201/12
).
- tl;dr: most people do not use it, with some exceptions (see message by
neil.mayhew).
- Some use *stack* nix integration, but I am not sure it is actually the
same thing as `cabal`.
  (I am told it is by various `stack` users. *++bsa*)
  *Action Item: We kill it.*

## Other topics

- GHC 9.8

Hécate: 3.10.2.0 release will also be shipped with GHC 9.8. It needs to be
patched in order to recognise it as a legal version.

On Sat, 12 Aug 2023 at 15:53, Theophile Hécate Choutri
<hecate at haskell.foundation> wrote:

> Hi everyone,
> You'll find below the link to the agenda and minutes:
>
> https://hackmd.io/78RP9BOAQFiq_GM1qNRpYQ?both
>
> Please do take the time to add the topics you want to raise. We already
> have a discussion about the exact-print parser that is being developed for
> HLS, and this would be an appropriate moment to determine our current
> legacy in terms of parsers within the code base.
>
> See you next week,
> Hécate
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/cabal-devel/attachments/20230817/fc5fd034/attachment.html>


More information about the cabal-devel mailing list