Open noughtmare opened 6 days ago
Thanks for the report! Is there a reproducer without HLS and VS Code? If not, HLS repo may be a better place to start.
I can reproduce it with just cabal:
$ cabal repl --enable-multi-repl lib:agda test:agda-tests
Warning: The package list for 'hackage.haskell.org' is 39 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
Build profile: -w ghc-9.6.6 -O1
In order, the following will be built (use -v for more details):
- Agda-2.8.0 (interactive) (configuration changed)
[1 of 2] Compiling Main ( /home/user/haskell/agda/dist-newstyle/build/x86_64-linux/ghc-9.6.6/Agda-2.8.0/setup/setup.hs, /home/user/haskell/agda/dist-newstyle/build/x86_64-linux/ghc-9.6.6/Agda-2.8.0/setup/Main.o ) [Distribution.Simple.BuildPaths package changed]
[2 of 2] Linking /home/user/haskell/agda/dist-newstyle/build/x86_64-linux/ghc-9.6.6/Agda-2.8.0/setup/setup [Objects changed]
Configuring Agda-2.8.0...
Error: [Cabal-6091]
The 'repl' command does not support multiple targets at once.
Error: [Cabal-7125]
repl failed for Agda-2.8.0.
It seems that this is specific to Agda. Running this command on a fresh cabal project with a library and test suite does not produce an error.
Oh, Agda is a wonderful source of Cabal bugs! Unfortunately, some of them has to do with the Custom build type, which is on life support these days... I wonder if there's a simpler reproducer with Custom...
Maybe @mpickering has ideas about this issue?
You are right. I created a package with two components and a trivial custom-setup and it gives me the same error. I guess custom-setup is just not supported. Perhaps the best immediate course of action is to point that out in the error message.
Yes, a better error message would be a good improvement!
You need to build the Setup
with a version of the cabal library which supports the multi-repl. I am not sure why this is allowed as there should be a constraint which forces a new enough version of Cabal
to be used.
Is that something I could do myself? I tried adding this constraint in the custom-setup
section:
custom-setup
setup-depends:
base, Cabal >=3.12
But that doesn't help.
Describe the bug
If I understand this blog post correctly, cabal 3.12.1.0 is supposed to have multi-component support. Unfortunately, trying to load multiple components with HLS still produces an error which contains this line:
To Reproduce Steps to reproduce the behavior:
src/full/Agda/Benchmarking.hs
(in VSCode)test/Bugs/Tests.hs
Expected behavior
No error.
System information
cabal
,ghc
versions: