0

Fresh install of Haskell on Windows, I just accepted the defaults in the installer, didn't touch anything, then tried to use cabal:

C:\t>cabal install hfmt
Warning: The package list for 'hackage.haskell.org' does not exist. Run 'cabal
update' to download it.
cabal: There is no package named 'hfmt'.
You may need to run 'cabal update' to get the latest list of available
packages.

C:\t>cabal update
Downloading the latest package list from hackage.haskell.org

C:\t>cabal install hfmt
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: hfmt-0.0.2.3 (user goal)
trying: process-1.4.3.0/installed-1.4... (dependency of
optparse-applicative-0.13.1.0)
trying: Win32-2.3.1.1/installed-2.3... (dependency of
process-1.4.3.0/installed-1.4...)
next goal: stylish-haskell (dependency of hfmt-0.0.2.3)
rejecting: stylish-haskell-0.7.1.0, stylish-haskell-0.7.0.0,
stylish-haskell-0.6.5.0, stylish-haskell-0.6.4.0, stylish-haskell-0.6.3.0,
stylish-haskell-0.6.2.0, stylish-haskell-0.6.1.0, stylish-haskell-0.6.0.0
(conflict: hfmt => stylish-haskell<0.6)
rejecting: stylish-haskell-0.5.17.0, stylish-haskell-0.5.16.0,
stylish-haskell-0.5.15.2, stylish-haskell-0.5.15.1, stylish-haskell-0.5.15.0,
stylish-haskell-0.5.14.4, stylish-haskell-0.5.14.3, stylish-haskell-0.5.14.2,
stylish-haskell-0.5.14.1, stylish-haskell-0.5.14.0, stylish-haskell-0.5.13.0,
stylish-haskell-0.5.12.0, stylish-haskell-0.5.11.2, stylish-haskell-0.5.11.1,
stylish-haskell-0.5.11.0, stylish-haskell-0.5.10.2, stylish-haskell-0.5.10.1,
stylish-haskell-0.5.10.0, stylish-haskell-0.5.9.1, stylish-haskell-0.5.9.0,
stylish-haskell-0.5.8.0, stylish-haskell-0.5.7.0, stylish-haskell-0.5.6.1,
stylish-haskell-0.5.6.0, stylish-haskell-0.5.5.2, stylish-haskell-0.5.5.1,
stylish-haskell-0.5.5.0, stylish-haskell-0.5.4.0, stylish-haskell-0.5.3.0,
stylish-haskell-0.5.2.0, stylish-haskell-0.5.1.0 (conflict: process =>
directory==1.3.0.0/installed-1.3..., stylish-haskell => directory>=1.1 &&
<1.3)
rejecting: stylish-haskell-0.5.0.2, stylish-haskell-0.5.0.1,
stylish-haskell-0.5.0.0 (conflict: Win32 =>
bytestring==0.10.8.1/installed-0.1..., stylish-haskell => bytestring>=0.9 &&
<0.10)
rejecting: stylish-haskell-0.4.0.0, stylish-haskell-0.3.2.0,
stylish-haskell-0.3.1.0, stylish-haskell-0.3.0.0, stylish-haskell-0.2.0.2,
stylish-haskell-0.2.0.1, stylish-haskell-0.2.0.0, stylish-haskell-0.1.1.0,
stylish-haskell-0.1.0.0 (conflict: hfmt => stylish-haskell>=0.5)
Backjump limit reached (currently 2000, change with --max-backjumps or try to
run with --reorder-goals).

Tried rerunning that last command with --max-backjumps=20000 and --reorder-goals, same result in both cases.

Is there something I'm missing?

rwallace
  • 31,405
  • 40
  • 123
  • 242
  • 1
    Just looking through the output here it looks like the problem is between `hfmt` requiring `stylish-haskell ==0.5.*`, and the `stylish-haskell 0.5.*` requiring `directory <1.3` but `directory 1.3.0.0` is installed. Possibly a similar issue with `bytestring <0.10`. Could you try perhaps a `cabal sandbox init` and then retry? Maybe that would allow the `directory` and `bytestring` versions to be resolved. I'm no expert with Cabal though and have never encountered this issue before. – ryachza Mar 02 '17 at 19:51
  • @ryachza Tried that, same result. – rwallace Mar 02 '17 at 20:03
  • 1
    Interesting. I was just able to install to a sandbox it seems to have worked with `hfmt-0.0.2.3` and `stylish-haskell-0.5.16`. Had you received a notice that Cabal was installing to a sandbox? What version of GHC/Cabal are you using? I currently have GHC 7.10.2 and Cabal 1.24.0.0. – ryachza Mar 02 '17 at 20:30
  • @ryachza I did receive the notice that it was installing to a sandbox, along with the same error message as before. I'm using the latest version of Haskell downloaded this afternoon, which seems to be 8.0.2. – rwallace Mar 02 '17 at 20:34
  • 1
    Sorry I couldn't help. Travis CI shows the build passing on 8.0.2 but that's on Linux. Had you used the Haskell Platform to install? I'm thinking that's where the new versions of `bytestring` and `directory` might be coming from. Perhaps you could try just installing GHC and Cabal, or perhaps unregister some of the packages that are causing issues? I wouldn't unregister packages lightly, but you could take a look with `ghc-pkg list` at least. – ryachza Mar 02 '17 at 20:42
  • @ryachza I used the Haskell platform, yes. What you say sounds right; Haskell is probably just one of these tools that's for Unix, not Windows. Thank you for trying anyway. – rwallace Mar 02 '17 at 20:46
  • Actually I think it's very specifically the `directory` version, which is preventing `stylish-haskell 0.5.16` from being considered, and that version accepts `bytestring` up to 0.11. – ryachza Mar 02 '17 at 20:47
  • @ryachza *directory* and *bytestring* are bundled with GHC, so even in a sandbox cabal-install will still pick the globally installed versions. Option #4 in [this answer](http://stackoverflow.com/a/27850571/2751851) *might* work -- do note, though, that options #1 and #2 do not apply here (you really don't want to unregister *bytestring* and *directory from the global database), and that you should **never** use `--force-reinstalls` outside of a sandbox. – duplode Mar 02 '17 at 20:47
  • @rwallace I certainly understand your frustration, though I would disagree with Haskell/GHC being a Linux only tool. I have been using GHC professionally for years exclusively on Windows. I have definitely encountered some pain points (mostly with shared libraries and linking) but Cabal version resolution has never been one of them. – ryachza Mar 02 '17 at 20:49
  • @duplode Ah thank you I thought that a sandbox would allow everything outside `base` to be local. – ryachza Mar 02 '17 at 20:52
  • 1
    @rwallace As ryachza points out, the issue in this specific question isn't a general problem with cabal-install, or with Haskell in Windows; it's just that the *hfmt* version in Hackage is too old relatively to your GHC version. Beyond getting it to build in a sandbox, as we are trying to do in this discussion, alternatives include using Stack (once you get it to work) to set up an isolated installation of an older GHC and getting the *hfmt* sources and attempting to update the required versions of its dependencies. – duplode Mar 02 '17 at 20:52

0 Answers0