Stop! Tickets are now managed at GitHub.

Please enter new tickets, and find and edit existing tickets there:

Ticket #124 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

Windows installer messes up directory structure

Reported by: Toxaris Owned by: refold
Priority: major Milestone: 2010.2.0.0
Component: Windows installer Keywords:
Cc: rendel@…


The Windows installer for the Platform 2010.1.0.0 messes up the directory structure so that *.h files installed with the extralibs are not found when installing packages with cabal-install.

The files are searched in $platform\extralibs, but they are installed in $platform\lib\extralibs.

Error Message

> cabal install digest
Resolving dependencies...
Configuring digest-
cabal: Missing dependency on a foreign library:
* Missing header file: zlib.h
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
cabal: Error: some packages failed to install:
digest- failed during the configure step. The exception was:
ExitFailure 1

More Information

Note that on Windows, digest depends on zlib, which contains a source distribution of zlib. So the missing zlib.h has been installed with the Haskell Platform.

> where /R c:\Haskell\Platform\2010.1.0.0 zlib.h

However, cabal install passes ...\2010.1.0.0\extralibs\... to gcc.

> cabal install digest -v3
C:\Haskell\Platform\2010.1.0.0\mingw\bin\gcc.exe returned ExitFailure 1 with
error message:
C:\Users\rendel\AppData\Local\Temp\1040.c:1:18: zlib.h: No such file or

As a quick hack, I copied the extra libs to the position where cabal install wants them, which allows me to install digest (and, in turn, pandoc).

> cp -R Haskell\Platform\2010.1.0.0\lib\extralibs\ Haskell\Platform\2010.1.0.0\extralibs\

Change History

Changed 7 years ago by refold

  • status changed from new to assigned

Changed 7 years ago by duncan

I don't think there is anything wrong here. The digest package does not depend on the zlib package so it does not get access to the header files of the zlib package. The digest package is assume the system already has zlib installed which is not the case on windows. The digest package should be fixed to use the existing Haskell binding (the zlib package) and not to use the C lib directly, then everything would work fine.

Changed 7 years ago by duncan

Toxaris is right, I missed the bit about digest actually depending on the zlib package. It looks like the include-dirs registered with ghc-pkg is not matching up with where the files really are.

Changed 7 years ago by Toxaris

From what I can tell, the zlib packages may actually be registered correctly.

>ghc-pkg describe zlib
import-dirs: $topdir\extralibs\zlib-\ghc-6.12.1
library-dirs: $topdir\extralibs\zlib-\ghc-6.12.1
include-dirs: $topdir\extralibs\zlib-\ghc-6.12.1\include
includes: zlib.h

So with an appropriate $topdir, this should work.

And ghc-pkg field zlib include-dirs returns the correct path to the zlib.h:

>ghc-pkg field zlib include-dirs
include-dirs: C:/Haskell/Platform/2010.1.0.0\lib\extralibs\zlib-\ghc-6.12

This is the correct path, but this path is not passed to gcc when using cabal install. Instead, ...\2010.1.0.0\extralibs\... is passed.

So maybe $topdir is sometimes expanded correctly to c:/Haskell/Platform/2010.1.0.0/lib, and sometimes incorrectly to c:/Haskell/Platform/2010.1.0.0.

Changed 7 years ago by refold

  • priority changed from major to blocker

Changed 7 years ago by refold

  • milestone set to 2010.2.0.0

Changed 7 years ago by refold

  • priority changed from blocker to major

I thought I had a typo in one of my scripts, but this looks like a GHC bug after all.

Changed 7 years ago by refold

  • status changed from assigned to closed
  • resolution set to fixed

...and it looks like this bug was fixed in 6.12.3. At least I was able to to execute cabal install digest.

Note: See TracTickets for help on using tickets.