HP/Cygwin and Curl

Hi, I am trying to install the curl 1.3.5 hackage on the latest Haskell Platform (2010.1.0.0) on Windows 7. I have installed lib-curl-devel (7.19.6-1) on CygWin but I can't use Cygwin as (apparently) every attempt to install a package ends like this: C:\Program Files\Haskell Platform\2010.1.0.0\lib\..\mingw\bin\windres: can't open temporary file `\/cca01252.irc': No such file or directory Using cabal-install with MSYS generally works. Can HP be used with Cygwin? I have yet to find a way of installing Curl so that the curl hackage will recognise it-does anybody know how to do this? (I couldn't find any explanation of how HP can be used with Cygwin or how to install Curl for use with the hackage. If anyone knows where I can get these that would be fine much appreciated; the Haskell.org outage is compounding this.) Thanks in advance! Vhris

Hi Chris HP can be used fine with Cygwin. Where a library in the HP is a binding to a C library, the HP supplies the relevant C library as an *.a file, e.g libglu32.a and libglut32.a for OpenGL. Pure Haskell libraries will install fine under Cygwin as well. Bindings to additional C libraries like Curl are problematic, for one thing Cygwin static libraries have a different object format to MinGW ones. With effort and knowledge, FFI libraries/bindings can be made to work with Cygwin but I don't think anyone is looking at this systematically (and documenting their methods). Practically speaking using MinGW / MSYS to build and install bindings is the solution. Best wishes Stephen

Thanks ever so much for your clear answer. I have no problem at all with using MSYS to build libraries that link to libraries built in Windows land--this seems entirely reasonable. Is this written down somewhere? I mean I really would like to RTFM! :-) Also, what's with C:\Program Files\Haskell Platform\2010.1.0.0\lib\..\mingw\bin\windres: can't open temporary file `\/cca01252.irc': No such file or directory Chris -----Original Message----- From: Stephen Tetley [mailto:stephen.tetley@gmail.com] Sent: 07 June 2010 20:19 To: Chris Dornan Cc: Haskell-Cafe@haskell.org Subject: Re: [Haskell-cafe] HP/Cygwin and Curl Hi Chris HP can be used fine with Cygwin. Where a library in the HP is a binding to a C library, the HP supplies the relevant C library as an *.a file, e.g libglu32.a and libglut32.a for OpenGL. Pure Haskell libraries will install fine under Cygwin as well. Bindings to additional C libraries like Curl are problematic, for one thing Cygwin static libraries have a different object format to MinGW ones. With effort and knowledge, FFI libraries/bindings can be made to work with Cygwin but I don't think anyone is looking at this systematically (and documenting their methods). Practically speaking using MinGW / MSYS to build and install bindings is the solution. Best wishes Stephen

On 7 June 2010 20:44, Chris Dornan
Also, what's with
C:\Program Files\Haskell Platform\2010.1.0.0\lib\..\mingw\bin\windres: can't open temporary file `\/cca01252.irc': No such file or directory
Hi Chris I don't know what's going on there, are you using the Windows CLI and then working with GHC's mingw? GHC (and thus the Haskell Platform) does ship with a minimal version of MinGW - includes files, static libraries, gcc, linker etc. - as GHC needs these pieces in its tool chain, and it means you can use GHC with the regular Windows CLI. For 'real work' though, you want to be using a full MSYS / MinGW installation and the MSYS Bash shell.

Thanks Stephen--that was related to my original question, about using HP
with Cygwin. The answer seems to be No!--you must use MSYS (for real work).
Or am I just being very slow? (I probably am--sorry!)
Chris
-----Original Message-----
From: Stephen Tetley [mailto:stephen.tetley@gmail.com]
Sent: 07 June 2010 21:09
To: Chris Dornan
Cc: Haskell-Cafe@haskell.org
Subject: Re: [Haskell-cafe] HP/Cygwin and Curl
On 7 June 2010 20:44, Chris Dornan
Also, what's with
C:\Program Files\Haskell Platform\2010.1.0.0\lib\..\mingw\bin\windres: can't open temporary file `\/cca01252.irc': No such file or directory
Hi Chris I don't know what's going on there, are you using the Windows CLI and then working with GHC's mingw? GHC (and thus the Haskell Platform) does ship with a minimal version of MinGW - includes files, static libraries, gcc, linker etc. - as GHC needs these pieces in its tool chain, and it means you can use GHC with the regular Windows CLI. For 'real work' though, you want to be using a full MSYS / MinGW installation and the MSYS Bash shell.

Thanks Stephen--that was related to my original question, about using HP with Cygwin. The answer seems to be No!--you must use MSYS (for real work).
The short version: - Cygwin provides commandline tools, compilers and libraries - MSYS provides commandline tools for the MinGW compilers and libraries You can use the commandline tools from either Cygwin or MSYS, but you need to compile and link with the compilers and libraries from MinGW. Cygwin's gcc produces binaries that live in a unix-emulation on top of windows, and depend on a cygwin dll to act as a translator. MinGW's gcc produces native windows binaries. Claus http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/ghci-cygwin.html

Thanks Claus, Your condensed summary was my understanding, but if I try to issue Cabal install --reinstall cmu It works every time from a MSYS shell, but with Cygwin I get Linking dist\build\cmu\cmu.exe ... C:\Program Files\Haskell Platform\2010.1.0.0\lib\..\mingw\bin\windres: can't open temporary file `\/cca04932.irc': No such file or directory cabal.exe: Error: some packages failed to install: cmu-1.2 failed during the building phase. The exception was: ExitFailure 1 ('cmu' is just an example; the same behaviour seems apparent whatever the package; I see something very similar when I ask GHC to compile hello.hs.) The general answer I seem to have been getting (and responses I have seen elsewhere top this problem) is 'don't expect the Haskell tools to work with Cygwin'. At any rate it seems that, for some people at least, the latest version of the Haskell tools won't work when launched from Cygwin Bash. Chris -----Original Message----- From: haskell-cafe-bounces@haskell.org [mailto:haskell-cafe-bounces@haskell.org] On Behalf Of Claus Reinke Sent: 08 June 2010 09:02 To: haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] HP/Cygwin and Curl
Thanks Stephen--that was related to my original question, about using HP with Cygwin. The answer seems to be No!--you must use MSYS (for real work).
The short version: - Cygwin provides commandline tools, compilers and libraries - MSYS provides commandline tools for the MinGW compilers and libraries You can use the commandline tools from either Cygwin or MSYS, but you need to compile and link with the compilers and libraries from MinGW. Cygwin's gcc produces binaries that live in a unix-emulation on top of windows, and depend on a cygwin dll to act as a translator. MinGW's gcc produces native windows binaries. Claus http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/ghci-cygwin.html _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Your condensed summary was my understanding, but if I try to issue
Cabal install --reinstall cmu
It works every time from a MSYS shell, but with Cygwin I get
If MSYS works for you, why not stick with it?-) Cygwin with MinGW tools should work, but it is very easy to mess up with this setup (configure scripts might not notice that they are on windows and use the wrong calling convention, Cygwin libraries and compiler tools might be called accidentally if they are installed, and so on). Of course, the more people give up and switch to MSYS, the smaller the chances that such bugs (things that accidentally work when using MSYS, or with a certain directory layout) get reported and fixed.
Linking dist\build\cmu\cmu.exe ... C:\Program Files\Haskell Platform\2010.1.0.0\lib\..\mingw\bin\windres: can't open temporary file `\/cca04932.irc': No such file or directory cabal.exe: Error: some packages failed to install: cmu-1.2 failed during the building phase. The exception was: ExitFailure 1
('cmu' is just an example; the same behaviour seems apparent whatever the package; I see something very similar when I ask GHC to compile hello.hs.)
You could try running 'ghc -v hello.hs' and check the windres command for oddities. I have no problems building a simple hello world from Cygwin: $ uname -a CYGWIN_NT-6.1-WOW64 VAIO 1.7.5(0.225/5/3) 2010-04-12 19:07 i686 Cygwin $ type ghc ghc is hashed (/cygdrive/c/haskell/ghc/ghc-6.12.2.20100522/bin/ghc) $ ghc tst.hs $ ./main.exe Hello, World!
The general answer I seem to have been getting (and responses I have seen elsewhere top this problem) is 'don't expect the Haskell tools to work with Cygwin'.
That tends to be a self-fulfilling prophesy, similar to 'don't expect the Haskell tools to work on Windows (because so many people rely on unixisms)'. But the result is that problems do surface more often in this configuration. If you want to investigate, you could file a report on the HP trac. Claus
At any rate it seems that, for some people at least, the latest version of the Haskell tools won't work when launched from Cygwin Bash.
Chris
-----Original Message----- From: haskell-cafe-bounces@haskell.org [mailto:haskell-cafe-bounces@haskell.org] On Behalf Of Claus Reinke Sent: 08 June 2010 09:02 To: haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] HP/Cygwin and Curl
Thanks Stephen--that was related to my original question, about using HP with Cygwin. The answer seems to be No!--you must use MSYS (for real work).
The short version:
- Cygwin provides commandline tools, compilers and libraries - MSYS provides commandline tools for the MinGW compilers and libraries
You can use the commandline tools from either Cygwin or MSYS, but you need to compile and link with the compilers and libraries from MinGW.
Cygwin's gcc produces binaries that live in a unix-emulation on top of windows, and depend on a cygwin dll to act as a translator. MinGW's gcc produces native windows binaries.
Claus
http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/ghci-cygwin.html
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

with Cygwin I get
Linking dist\build\cmu\cmu.exe ... C:\Program Files\Haskell Platform\2010.1.0.0\lib\..\mingw\bin \windres: can't open temporary file `\/cca04932.irc': No such file or directory
This sounds very much like a temporary-filename issue. The reported filename's lack of a valid directory specifier looks highly suspicious to me. Are your TEMP, TEMPDIR, TMP, and TMPDIR environment variables set? Are their values sensible? Do you have appropriate permissions on the directories they point to? These are the kinds of thing I usually need to check when setting up a new Cygwin build environment. Admittedly, we do not use cabal on Windows (firewall prevents it from working), but the other ghc tools generally seem to work without problems for us under Cygwin. Regards, Malcolm

Thanks very much Claus and Malcolm. You have clarified the situation nicely: I was beginning to suspect my Cygwin setup and I bet that is where the problem lies. I won't have time to straighten my Cygwin environment this week, but when I do I will come back here and explain what went wrong (I have seen evidence of others stumbling on this giving rise to speculative misinformation). Sorry for the confusion! Chris -----Original Message----- From: haskell-cafe-bounces@haskell.org [mailto:haskell-cafe-bounces@haskell.org] On Behalf Of Malcolm Wallace Sent: 08 June 2010 22:06 To: haskell-cafe Cafe Subject: Re: [Haskell-cafe] HP/Cygwin and Curl
with Cygwin I get
Linking dist\build\cmu\cmu.exe ... C:\Program Files\Haskell Platform\2010.1.0.0\lib\..\mingw\bin \windres: can't open temporary file `\/cca04932.irc': No such file or directory
This sounds very much like a temporary-filename issue. The reported filename's lack of a valid directory specifier looks highly suspicious to me. Are your TEMP, TEMPDIR, TMP, and TMPDIR environment variables set? Are their values sensible? Do you have appropriate permissions on the directories they point to? These are the kinds of thing I usually need to check when setting up a new Cygwin build environment. Admittedly, we do not use cabal on Windows (firewall prevents it from working), but the other ghc tools generally seem to work without problems for us under Cygwin. Regards, Malcolm _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Mon, 07 Jun 2010 21:44:13 +0200, Chris Dornan
Thanks ever so much for your clear answer. I have no problem at all with using MSYS to build libraries that link to libraries built in Windows land--this seems entirely reasonable.
Is this written down somewhere? I mean I really would like to RTFM! :-)
Some information can be found at: http://www.haskell.org/haskellwiki/Windows#Tools_for_compilation (improvements are welcome) Regards, Henk-Jan van Tuyl -- http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html --

Thanks very much: I didn't know about this resource.
I do appreciate all of the hard work everyone has put in and I want to
contribute myself, especially in 2011 (I am fully committed until then). For
the moment the best contribution I can make is to report the problems I am
having.
The above wiki page is (of course) too vague about how Cygwin and MSYS can
be used. Cygwin is a much better supported product and a much easier way of
getting hold of many Unixy things (like X11). AFAIK MSYS doesn't have a
proper installer at the moment.
It would be nice to know how Cygwin can be used with HP. If the answer is
not at all (for serious work) then can we say this very prominently on HP
Windows page. How about linking the HP-Windows page to the Wiki article on
Haskell for Windows?
A FAQ for HP would also surely be useful.
If others agree these would be useful and they haven't been when I will pick
them up, but first, are these a good idea?
My feeling is that the ramp onto Haskell is far steeper than it needs to be
considering the fundamental excellence of the parts.
Chris
-----Original Message-----
From: Henk-Jan van Tuyl [mailto:hjgtuyl@chello.nl]
Sent: 07 June 2010 22:28
To: Chris Dornan
Cc: Haskell-Cafe@haskell.org
Subject: Re: [Haskell-cafe] HP/Cygwin and Curl
On Mon, 07 Jun 2010 21:44:13 +0200, Chris Dornan
Thanks ever so much for your clear answer. I have no problem at all with using MSYS to build libraries that link to libraries built in Windows land--this seems entirely reasonable.
Is this written down somewhere? I mean I really would like to RTFM! :-)
Some information can be found at: http://www.haskell.org/haskellwiki/Windows#Tools_for_compilation (improvements are welcome) Regards, Henk-Jan van Tuyl -- http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html --
participants (5)
-
Chris Dornan
-
Claus Reinke
-
Henk-Jan van Tuyl
-
Malcolm Wallace
-
Stephen Tetley