Switching between Cabal 3.18.1.0 and 3.18.2.0 breaks one or the other
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- haskell
- Domain
- build-system
Research direction
The report identifies haskell-language-server's functional test setup and the cabal v2-repl invocation, but does not name Cabal source files or tests. Start by comparing the captured command and failure with runs under each GHCup-selected Cabal version, then inspect how Cabal selects packages for the REPL. Done means switching between 3.18.1.0 and 3.18.2.0 no longer leaves the reported command failing.
Written by the indexing model from the issue text.
Description
Describe the bug
Switching between Cabal 3.18.1.0 and 3.18.2.0 seems to break one or the other. With the error copied below.
Foreword to the reproduction steps
-
I'm perfectly open to be proved wrong in reporting this bug, if the bug is indeed on my end's configuration, rather than on the Cabal tool; in this sense, please, do ask me for more logs, experiments, and so on, if that can help the investigation.
-
Following the steps below does not require using the Haskell Language Server, but just cloning its repository and using it as the project on which Cabal is to be used. Despite I haven't been able to reproduce the issue on a smaller, more "hello world"-y project, I think that HLS codebase is just incidental, and necessary only to the extent that it is non-toy enough for the Cabal erroneous behavior to emerge.
-
More crucial, possibly, is the coupling with GHCup, in the sense that the reproduction steps build on the fact that
ghcup set cabal x.y.z; cmddo different thingsghcup run --cabal x.y.z -- cmd; I'm not sure what's the expected difference, but in any case Julian claims the tool is simple enough, and that it's doing the right thing, according to the information I've provided to him (see https://codeberg.org/haskell/ghcup-hs/issues/1410, but I might hunt down some older conversation in the Element chat, if you want). -
You'll see I prepend commands that end up building stuff with
ionice nice. This should be entirely irrelevant to the issue; as far as I understand, I'm just doing that to prevent GHC's from hogging my RAM and therefore making my system unresponsive, possibly causing the OOM killer to take down the whole tmux session I'm working in (yes, it happened ot me serveral times).
To Reproduce
- Clone HLS and checkout its current
origin/master, which is https://github.com/haskell/haskell-language-server/commit/95eb9af94282fd2244a3c4679072b8a7e8e22c97 at the time of writing;git diffshows no output;- I'm starting from the assumption that step 2 and 3 below pass;
- run
ghcup set cabal 3.18.2.0or do the equivalent via GHCup; - run
haskell-language-server-9.14.1~2.15.0.0 --debug test/functional/Format.hs, which succeeds; - run
ghcup set cabal 3.18.1.0or do the equivalent via GHCup; - repeat step 3, which now fails;
Hidden: no Range: 1:1-2:1 Source: cradle Severity: DiagnosticSeverity_Error Code: <none> Message: Failed to run cabal '--builddir=/home/enrico/.cache/hie-bios/dist-haskell-language-server-16967e34052bfb51b0fe980f04bae501' v2-repl --with-repl /home/enrico/.cache/hie-bios/repl-wrapper-fae20739a232ed1b9dcdf40eca9cf71e --enable-multi-repl --keep-temp-files /home/enrico/haskell-language-server/test/functional/Format.hs in directory "/home/enrico/haskell-language-server". Consult the logs for full command and error. Failed command: cabal '--builddir=/home/enrico/.cache/hie-bios/dist-haskell-language-server-16967e34052bfb51b0fe980f04bae501' v2-repl --with-repl /home/enrico/.cache/hie-bios/repl-wrapper-fae20739a232ed1b9dcdf40eca9cf71e --enable-multi-repl --keep-temp-files /home/enrico/haskell-language-server/test/functional/Format.hs Build profile: -w ghc-9.14.1 -O1 In order, the following will be built (use -v for more details): - haskell-language-server-2.15.0.0 (interactive) (test:func-test) (first run) [1 of 2] Compiling Main ( /home/enrico/.cache/hie-bios/dist-haskell-language-server-16967e34052bfb51b0fe980f04bae501/build/x86_64-linux/ghc-9.14.1/haskell-language-server-2.15.0.0/t/func-test/setup/setup.hs, /home/enrico/.cache/hie-bios/dist-haskell-language-server-16967e34052bfb51b0fe980f04bae501/build/x86_64-linux/ghc-9.14.1/haskell-language-server-2.15.0.0/t/func-test/setup/Main.o ) /home/enrico/.cache/hie-bios/dist-haskell-language-server-16967e34052bfb51b0fe980f04bae501/build/x86_64-linux/ghc-9.14.1/haskell-language-server-2.15.0.0/t/func-test/setup/setup.hs:2:1: error: [GHC-87110] Could not load module ‘Distribution.Simple’. It is a member of the hidden package ‘Cabal-3.19.0.0’. Perhaps you need to add ‘Cabal’ to the build-depends in your .cabal file. It is a member of the hidden package ‘Cabal-3.19.0.0’. Perhaps you need to add ‘Cabal’ to the build-depends in your .cabal file. It is a member of the hidden package ‘Cabal-3.16.1.0’. Perhaps you need to add ‘Cabal’ to the build-depends in your .cabal file. It is a member of the hidden package ‘Cabal-3.16.1.0’. Perhaps you need to add ‘Cabal’ to the build-depends in your .cabal file. It is a member of the hidden package ‘Cabal-3.16.0.0’. Perhaps you need to add ‘Cabal’ to the build-depends in your .cabal file. It is a member of the hidden package ‘Cabal-3.12.1.0’. Perhaps you need to add ‘Cabal’ to the build-depends in your .cabal file. | 2 | import Distribution.Simple; main = defaultMain | ^^^^^^^^^^^^^^^^^^^^^^^^^^ Error: [Cabal-7125] repl failed for test:func-test from haskell-language-server-2.15.0.0. - run
ghcup run --cabal 3.18.1.0 -- copy command from step 3, verbatim, which succeeds;- some building happened;
- repeat step 3, which succeeds;
- the output looks a lot like step 6's, i.e. some building happened;
- repeat step 3 once more, which obviously succeeds;
- the output is much shorter, i.e. no further building happened;
- run
ghcup set cabal 3.18.2.0or do the equivalent via GHCup; - repeat step 3, which now fails;
- run
ghcup run --cabal 3.18.2.0 -- copy command from step 3, verbatim, which succeeds;- some building happened;
- repeat step 3, which succeeds;
- the output looks a lot like step 6's, i.e. some building happened;
- repeat step 3 once more, which obviously succeeds;
- the output is much shorter, i.e. no further building happened;
Notice that:
- steps from 4 to 13 are a round trip;
- steps from 4 to 8 are identical to those from 9 to 13, except that
3.18.1.0and3.18.2.0are swapped around.
At https://paste.c-net.org/RiggsHijacked is the whole content of my terminal window after I've gone through all the steps described above. Indeed, you'll see 12 occurrences of my shell's prompt (it contains a snail emoji: 🐌), which are corresponding precisely to the steps from 2 to 13.
Expected behavior
Whatever Cabal version I select via GHCup, the following time I exercise the code via step 3 above should compile (and afterwards run) successfully.
System information
- up-to-date ArchLinux,
- HLS version (2.15.0.0) and the GHC version (9.14.1) it works with are locked by calling the specific executable, as shown in the reproduction steps.
Additional context
I initially reported the issue at https://github.com/haskell/haskell-language-server/issues/5155, but when I realized the GHCup dance necessary to demonstrate the whole weird behavior, I opened an issue on https://codeberg.org/haskell/ghcup-hs/issues/1410. In both those threads you might find relevant comments from respective maintainers.
- Dominant language
- Haskell
- Stars
- 1.8k
- Forks
- 766
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 27
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from haskell/cabal
-
needs triage type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
-
needs triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
haskell/cabal#12568 · 1 comment ·
Maintainers usually reply within 3 days
-
needs triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
haskell/cabal#12525 · 3 comments · 1 reaction ·
Maintainers usually reply within 3 days
-
Required version of `cabal-install` to build CabalPossibly taken @philderbeast claimed this 24 days ago. Opendocumentation type: discussion
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
haskell/cabal#12477 · 2 comments · 1 assignee ·
Maintainers usually reply within 3 days
-
Document which are our LTS releasesPossibly taken @KeuqS claimed this 41 days ago. Opendocumentation type: discussion
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
haskell/cabal#12373 · 2 comments ·
Maintainers usually reply within 3 days
Similar issues
-
bug desktop
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
simplex-chat/simplex-chat#8291 ·
Maintainers usually reply within 1 day
-
[BUG]: C# programs with top-level statements fail to compilePossibly taken @AsyncNigam claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
compiler-explorer/compiler-explorer#9625 · 1 comment ·
Maintainers usually reply within 1 day
-
reflex-0.10Open
Difficulty 1/5 Under an hour Newbie friendliness 62/100
commercialhaskell/stackage#8180 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenZeppelin/canton-contracts#140 ·
Maintainers usually reply within 1 day
-
takeInterval yields nothing, dropInterval drops nothingPossibly taken @GuillaumedeVolpiano claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
composewell/streamly#3271 ·