haskell / haskell/cabal

cabal-3.18.1.0 with older lib:Cabal custom setup package crashes HLS

Open
#12,186 0 comments 2 reactions 0 assignees View on GitHub
can-workaround type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

This is intended as a catch-all bug report so I can send users here if the situation arises

In short, the cause of this issue is #11099 but for exe:cabal 3.18.1.0.

We hope, that by now enough users managed to upgrade to lib:Cabal-3.16.1.0, rendering this issue as low-priority (if even).

**Describe the bug**

I attach an example project that exhibits the troublesome behaviour.

[example.tar.gz](https://github.com/user-attachments/files/30538355/example.tar.gz)

In short, if lib:Cabal <3.16 is imposed on the build plan of the current project, then the `--with-repl` (#9115) flag doesn't work, and neither does `--keep-temp-files`.

However, cabal-3.18.1.0 (and lib:Cabal) passes all GHC arguments using a response file.
If we can't use `--with-repl`, then hie-bios breaks due to #10915, as it expects `--interactive` as the first argument to actually interject the interactive

To summarise, what this means is that HLS and hie-bios will not work in projects with older lib:Cabal (<3.16.0.0) versions.
In `hie-bios`, I decided in https://github.com/haskell/hie-bios/pull/519 to essentially ignore this situation for now.
There could be workarounds, but how often does this situation actually arise that you use cabal-3.18 but lib:Cabal-3.14?

So, I am opening this issue, if people feel strongly, we can try to come together to fix it in some hacky way, but as I think that Custom build-types are destined for retirement any way, I am reluctant to spend more time on it, since the workarounds:

* Use cabal-3.16.1.0 (which has #12186 backported and thus doesn't suffer from the described issue)
* or upgrade lib:Cabal to 3.16.0.0

Seem somewhat workable to me.

Contributor guide

Open the contributing guide

Research direction

Start by unpacking the attached example.tar.gz and reproducing the failure with cabal-3.18.1.0 when lib:Cabal is below 3.16, focusing on --with-repl and --keep-temp-files. Trace how response-file arguments reach the custom setup build and verify that HLS and hie-bios work again with the affected older lib:Cabal versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.