`cabal repl` (more or less) silently fails since 3.16.0.0
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
cabal3.16.0.0,ghc9.10.2
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
#10684 is supposed to fix it?
Does it also fix the no-project case, which fails the same way? #10684 looks like it's about using it inside a project.
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?
Can someone bisect it? @ffaf1 you're our bisect master, I think?..
I'm particularly worried about the out-of-project scenario.
0f1f67cb97dca952123f262e7670a200a783acf4 #10878 @mpickering
I'll take a look into this tomorrow.
I can reproduce, and added a test which shows the problem. I'm going to build on Phil's patch to fix these problems.
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.