cabal icon indicating copy to clipboard operation
cabal copied to clipboard

`cabal repl` (more or less) silently fails since 3.16.0.0

Open geekosaur opened this issue 4 months ago • 9 comments

Describe the bug If I run cabal repl either inside or outside a project, I get

hilfy «cabal+validate-actions$» Z$ cabal-3.16.0.0 repl
Resolving dependencies...
hilfy «cabal+validate-actions$» Z$ _

If I run it outside a project with a -b option (in a temporary directory with no cabal.project in a parent):

hilfy Z$ cabal-3.16.0.0 repl -b vector
Resolving dependencies...
panic: targets should be non-empty
CallStack (from HasCallStack):
  error, called at src/Distribution/Client/CmdRepl.hs:366:38 in cabal-install-3.16.0.0-inplace:Distribution.Client.CmdRepl

To Reproduce Reproducers shown above (the first one, if it wasn't obvious, is within the cabal project itself).

Expected behavior A ghci should open, with appropriate things in scope.

System information

  • Linux Ubuntu 24.10
  • cabal 3.16.0.0, ghc 9.10.2

geekosaur avatar Jul 26 '25 03:07 geekosaur

Confirmed (e.g. for ansi-terminal).

ansi-terminal $ cabal-3.16.0.0 repl                                                           
Resolving dependencies...

Previously there was an internal error:

ansi-terminal $  cabal-3.14.2.0 repl                                                       
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Error: [Cabal-7076]
Internal error when trying to open a repl for the package fake-package-0. The package is not in the set of available targets for the project plan, which would suggest an inconsistency between readTargetSelectors and resolveTargets.

See:

  • #10527

andreasabel avatar Jul 29 '25 07:07 andreasabel

#10684 is supposed to fix it?

ulysses4ever avatar Jul 29 '25 13:07 ulysses4ever

Does it also fix the no-project case, which fails the same way? #10684 looks like it's about using it inside a project.

geekosaur avatar Jul 29 '25 18:07 geekosaur

Just hit the same issue: cabal-3.16.0.0 repl (outside of a project) does not work. This used to be a very convenient way to emulate a sandbox, this is a very severe regression. Is anyone looking into it?

Bodigrim avatar Aug 20 '25 20:08 Bodigrim

Can someone bisect it? @ffaf1 you're our bisect master, I think?..

I'm particularly worried about the out-of-project scenario.

ulysses4ever avatar Sep 29 '25 19:09 ulysses4ever

0f1f67cb97dca952123f262e7670a200a783acf4 #10878 @mpickering

ffaf1 avatar Sep 29 '25 20:09 ffaf1

I'll take a look into this tomorrow.

mpickering avatar Sep 29 '25 21:09 mpickering

I can reproduce, and added a test which shows the problem. I'm going to build on Phil's patch to fix these problems.

mpickering avatar Sep 30 '25 13:09 mpickering

I got a bit sucked into modifying how -b worked but undid all of that to build on @philderbeast's original work in fixing this issue. I'll open a new PR which fixes all the problems described in this thread.

mpickering avatar Oct 03 '25 12:10 mpickering