0

I am having issues with installing QuickCheck for Haskell using GHC 9.4.4 and GHC 8.8.4, and I get the same output. Any assistance would be greatly appreciated!

Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] next goal: ghc (user goal)
[__0] rejecting: ghc-9.4.4, ghc-9.4.3, ghc-9.4.2, ghc-9.4.1, ghc-9.2.6,
ghc-9.2.5, ghc-9.2.4, ghc-9.2.3, ghc-9.2.2, ghc-9.2.1, ghc-9.0.2, ghc-8.10.7,
ghc-8.10.2, ghc-8.10.1 (constraint from user target requires ==8.8.4)
[__0] trying: ghc-8.8.4/installed-8.8...
[__1] next goal: process (user goal)
[__1] rejecting: process-1.6.17.0 (constraint from user target requires
==1.6.16.0)
[__1] rejecting: process-1.6.16.0 (conflict: ghc =>
process==1.6.9.0/installed-1.6...)
[__1] rejecting: process-1.6.15.0, process-1.6.14.0, process-1.6.13.2,
process-1.6.13.1, process-1.6.12.0, process-1.6.11.0, process-1.6.10.0,
process-1.6.9.0/installed-1.6..., process-1.6.9.0, process-1.6.8.2,
process-1.6.8.1, process-1.6.8.0, process-1.6.7.0, process-1.6.6.0,
process-1.6.5.1, process-1.6.5.0, process-1.6.4.0, process-1.6.3.0,
process-1.6.2.0, process-1.6.1.0, process-1.6.0.0, process-1.5.0.0,
process-1.4.3.0, process-1.4.2.0, process-1.4.1.0, process-1.4.0.0,
process-1.3.0.0, process-1.2.3.0, process-1.2.2.0, process-1.2.1.0,
process-1.2.0.0, process-1.1.0.2, process-1.1.0.1, process-1.1.0.0,
process-1.0.1.5, process-1.0.1.4, process-1.0.1.3, process-1.0.1.2,
process-1.0.1.1, process-1.0.0.0, process-1.6.13.0 (constraint from user
target requires ==1.6.16.0)
[__1] fail (backjumping, conflict set: ghc, process)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: process, ghc

I tried to installing it with both GHC 9.4.4 and GHC 8.8.4. Also tried updating GHC and cabal

EDIT: Okay, here's the original problem; I'm trying to write some Haskell code in VS Code, but I'm getting an error highlight in every .hs file in the first line, and the rest of the code is not checked. When I hover on the error underline, it says that ghcide compiled by GHC 8.8 failed to load packages, which includes QuickCheck and random1.1. I tried to reinstall QuickCheck, and the above error is what I got. My conclusion is that I have an older compiler at work. Then I check cabal version (3.0.0.0) and GHC version (8.4.4), which are both old and I want to update, but I can't seem to do so. I did ghcup install cabal 3.8.1.0 and I get a message that is shadowed by another PATH. I tried to change PATH, but that did not help.

  • 1
    What command(s) did you use? What `.cabal` file(s) do you have? – leftaroundabout Feb 21 '23 at 10:34
  • @leftaroundabout I just used `cabal install QuickCheck`. And I don't know what you mean by "what `.cabal` files do I have", as I am not (aware of) using any cabal files, unless you mean the directory, which has Bins, Logs, Packages and Store folders and a Config file. – OwlZeroOne Feb 21 '23 at 11:12
  • The error mentions a conflict on process, but QuickCheck does not depend on process, so without any more context your error does not make sense. It's likely that there is a cabal file (a file with the `.cabal` extension, or `cabal.project`) in the current directory where you typed `cabal install QuickCheck`, or in some parent directory, which is imposing that restriction, and if so you should fix it or remove it. – Li-yao Xia Feb 21 '23 at 12:04
  • 1
    @OwlZeroOne it doesn't really make sense to `cabal install PackageName` anyway, this does not give you much control of what combination of packages is installed, and even if the packages are exactly right it doesn't produce an installation result that is practically and reliably usable. Instead, you _should_ have a `.cabal` file that specifies all the dependencies (even if that is only `base` and `QuickCheck`), and then there's no need to worry about installing packages, just use `cabal test` and it automatically installs dependencies, builds all your modules, and runs the tests. – leftaroundabout Feb 21 '23 at 12:42
  • This problem seems to be more about your particular setup with incompatible versions of GHC and the IDE, than about Cabal / package installs. You'll need to give some more information, like operating system, contents of `$PATH`, `ghc --version`, `which cabal`, etc. etc.. – leftaroundabout Feb 21 '23 at 14:38
  • OS: Ubuntu 22.04; GHC: 8.8.4; Cabal: 3.0.0.0 (cabal-install); Which cabal: /usr/bin/cabal; $PATH: /home/matty/anaconda3/condabin: /home/matty/.local/bin: /usr/local/sbin: /usr/local/bin: /usr/sbin: /usr/bin:/sbin: /bin: /usr/games: /usr/local/games: /snap/bin: /snap/bin: /home/matty/.local/share/coursier/bin: /home/matty/.ghcup/bin: /home/matty/.local/share/coursier/bin – OwlZeroOne Feb 21 '23 at 15:53
  • Aha, looks like `/usr/bin` has precedence before `~/.ghcup/bin`. Move the latter to the front of `$PATH`. – leftaroundabout Feb 21 '23 at 20:37
  • You say you tried to change `PATH`. What, exactly, did you do during that attempt? – Daniel Wagner Feb 23 '23 at 18:13
  • PATH issue has been solved. `~/,ghcup/bin` has precedence over other paths. This now brings me to VS Code not willing to compile Haskell code. I'm getting this message when I hover over the error on line 1: `ghcide compiled against GHC 9.2.5 but currently using 8.8.4 This is unsupported, ghcide must be compiled with the same GHC version as the project.cradle`. I've tried to indicate the path for `ghcup` and `hls`, but it's not doing anything... – OwlZeroOne Feb 24 '23 at 11:24

0 Answers0