[Haskell-cafe] Re: Installing Haskell on Windows 7

Lee Houghton gmane at asztal.net
Sun Dec 27 15:41:51 EST 2009

On 27/12/2009 19:26, Thomas Hühn wrote:
> Hi
> Duncan Coutts<duncan.coutts at googlemail.com>  writes:
>> Except for haddock, none of these packages come with the Haskell
>> Platform. These are packages that you must have installed previously. So
>> ghc-pkg check is quite right to report them.
> Okay, right.
>>> Okay, reinstalling them all (with --user --reinstall").
>>> Except haddock:
>>> C:\Users\Thomas>cabal install haddock --user --reinstall
>>> Resolving dependencies...
>>> cabal: cannot configure haddock-2.6.0. It requires ghc>=6.12&&  <6.14
>>> There is no available version of ghc that satisfies>=6.12&&  <6.14
>> Right, try installing the same version as you've got currently rather
>> than the latest version.
>> In an ideal world the cabal-install package dependency resolver would
>> work out that the latest version cannot be installed (since it needs a
>> later ghc) and fall back to the next version that can work. However at
>> the moment it is not quite that smart. Use:
>> cabal install haddock-2.4.2
> "cabal install haddock-2.4.2 --user --reinstall" ends with:
> Linking dist\build\haddock\haddock.exe ...
> cabal: Error: some packages failed to install:
> haddock-2.4.2 failed during the final install step. The exception was:
> CreateDirectory: permission denied (Zugriff verweigert)
>> You can edit this config file. I suggest you change it to use per-user
>> installs by default. Set "user-install: True" (and make sure you
>> uncomment the line, the "--" prefix).
> That doesn't work at all. As soon as I uncomment that line and set it
> to True, I get:
> cabal: C:\Users\Thomas\AppData\Roaming\cabal\packages
> user-install: True\hackage.haskell.org\00-index.tar: openBinaryFile: invalid arg
> ument (Invalid argument)

The most likely cause is that your "user-install: True" line is indented. Indentation is significant in the config file because it indicates layout for nested sections: remove any leading spaces on that line and that should do the trick.

>>> But then again I shouldn't have to meddle with some installed
>>> configuration file,
>> These defaults worked ok for Windows XP but they're clearly no good for
>> Vista and Win7. Just change the default to per-user installs.
>>> especially since there has been no warning that I had to do that and
>>> very especially since I entered my destination folder upon
>>> installation. Maybe it's okay, but it kind of makes me nervous. And
>>> God knows what else I haven't stumbled upon yet.
>> Where you install the Haskell Platform is independent of these settings.
>> You would not want to install other packages into the same location as
>> the platform and there's no particular reason to suppose that you would
>> have the file permissions to do so.
> Not in the Platform directory itself, but I'd like to group bigger
> chunks like "everything Haskell" in a common directory (with
> subdirectories "Platform", "Local-Cabal", "whatever"), just as I put
> TeX Live into its own directory, right under the root directory. Makes
> PATHs shorter, as well.
>> No, it's reasonable to expect the defaults to work. Sadly they do not at
>> the moment for Windows 7. Change it to use per-user installs by default
>> and let us know how that goes.
> No luck with haddoch, so far, and hakyll (which sounded cool and I
> wanted to try out) doesn't work, either:
> Linking dist\build\markdown2pdf\markdown2pdf.exe ...
> Created man\man1\pandoc.1
> Created man\man1\hsmarkdown.1
> Created man\man1\html2markdown.1
> Created man\man1\markdown2pdf.1
> setup.exe: CreateDirectory: permission denied (Zugriff verweigert)
> cabal: Error: some packages failed to install:
> hakyll-0.2 depends on pandoc-1.3 which failed to install.
> pandoc-1.3 failed during the final install step. The exception was:
> exit: ExitFailure 1

I suspect this might be caused by http://hackage.haskell.org/trac/hackage/ticket/466. Here's what I have in my cabal config instead of the default:

install-dirs user
   -- prefix: C:\Users\Asztal\AppData\Roaming\cabal
   -- bindir: $prefix\bin
   -- libdir: $prefix
   -- libsubdir: $pkgid\$compiler
   -- libexecdir: $prefix\$pkgid
   -- datadir: "C:\\Program Files (x86)\\Haskell"
   datadir: $prefix\data
   -- datasubdir: $pkgid
   -- docdir: $prefix\doc\$pkgid
   -- htmldir: $docdir\html
   -- haddockdir: $htmldir

Using these settings haddock-2.4.2 and hakyll install fine for me. If I revert $datadir to the default, I get the same as you.

> As I said before, I don't have a clue, where cabal wants to install
> what. Some error messages beyond "failed" would have been nice. Like
> "creating directory XYZ failed".
> BTW, I just retried installing everything manually (GHC 6.12.1) and I
> almost got there, but the network package doesn't install. Probably
> because I don't have a full mingw installation, only what came with
> GHC. Lots of headers missing and other compilation
> problems. configure.sh probably didn't run, as well.
> Is there no way to get binary objects from hackage, for the C parts at
> least, so that GHC can just link the Haskell parts against it?

Alas, that would be nice :(

It's probably best to wait for the next Haskell Platform instead of installing GHC 6.12 itself.

More information about the Haskell-Cafe mailing list