Stop! Tickets are now managed at GitHub.

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


Ticket #124 (closed defect: fixed)

Opened 4 years ago

Last modified 4 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@…

Description

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-0.0.0.8...
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-0.0.0.8 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
c:\Haskell\Platform\2010.1.0.0\lib\extralibs\zlib-0.5.2.0\ghc-6.12.1\include\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",["C:\\Users\\rendel\\A
ppData\\Local\\Temp\\1040.c","-o","C:\\Users\\rendel\\AppData\\Local\\Temp\\1040
","-D__GLASGOW_HASKELL__=612","-I.","-IC:\\Haskell\\Platform\\2010.1.0.0\\extral
ibs\\zlib-0.5.2.0\\ghc-6.12.1\\include","-IC:\\Haskell\\Platform\\2010.1.0.0\\by
testring-0.9.1.5\\include","-IC:\\Haskell\\Platform\\2010.1.0.0\\base-4.2.0.0\\i
nclude","-IC:\\Haskell\\Platform\\2010.1.0.0/include","-IC:\\Haskell\\Platform\\
2010.1.0.0/include","-LC:\\Haskell\\Platform\\2010.1.0.0\\extralibs\\zlib-0.5.2.
0\\ghc-6.12.1","-LC:\\Haskell\\Platform\\2010.1.0.0\\bytestring-0.9.1.5","-LC:\\
Haskell\\Platform\\2010.1.0.0\\base-4.2.0.0","-LC:\\Haskell\\Platform\\2010.1.0.
0\\integer-gmp-0.2.0.0","-LC:\\Haskell\\Platform\\2010.1.0.0\\ghc-prim-0.2.0.0",
"-LC:\\Haskell\\Platform\\2010.1.0.0","-LC:\\Haskell\\Platform\\2010.1.0.0/gcc-l
ib","-LC:\\Haskell\\Platform\\2010.1.0.0"])
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
directory
...

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 4 years ago by refold

  • status changed from new to assigned

Changed 4 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 4 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 4 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-0.5.2.0\ghc-6.12.1
library-dirs: $topdir\extralibs\zlib-0.5.2.0\ghc-6.12.1
include-dirs: $topdir\extralibs\zlib-0.5.2.0\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-0.5.2.0\ghc-6.12
.1\include

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 4 years ago by refold

  • priority changed from major to blocker

Changed 4 years ago by refold

  • milestone set to 2010.2.0.0

Changed 4 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 4 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.