0

How do you update a pre-installed Haskell package (for example, the System.Directory package) on Windows? I've tried simply telling cabal to install it but it encountered an error while doing so.

The package has a '.configure' script. This requires a Unix compatibility toolchain such 
as MinGW+MSYS or Cygwin.
cabal: Error: some packages failed to install:
directory-1.2.6.3 failed during the configure step. The exception was:
ExitFailure 1

I presume there is an easy way of doing this within cabal. Failing this, where do the various files in the .tar.gz available off Hackage for a pre-installed package go? Thanks in advance.

sclv
  • 38,665
  • 7
  • 99
  • 204
ENPM
  • 167
  • 2
  • 9
  • 2
    no there is no easy way using cabal - basically you do what you are told and get a Msys2 ... or you grab `stack` (which will get it for you) – Random Dev May 10 '16 at 19:18
  • I think they're only untared temporarily. You can use `cabal unpack` to get a local unpacked copy in your current directory. Note that updating the global Cabal package database is usually a bad idea. – Zeta May 10 '16 at 19:19
  • So to put it more generally: what is the _recommended_ way of updating a given package? – ENPM May 10 '16 at 19:43
  • 1
    @ENPM don't - use sandboxes or better stack to handle this for you (it will not update the package as in removing the old one) - but on windows the *sane* option right now is really stack - if you don't run into stupid restrictions with the length of paths it can handle almost anything you throw at it – Random Dev May 10 '16 at 20:00
  • 1
    @Carsten Alright so. Installing stack now. Thanks for the help. – ENPM May 10 '16 at 20:05

1 Answers1

0

Current versions of ghc and the haskell platform ship with an msys distro. Adding a few lines (in the instructions) to the cabal config file allows cabal to take advantage of this, in after which you can build packages with custom configure scrips (such as network or old-time) just fine.

sclv
  • 38,665
  • 7
  • 99
  • 204