[C2hs] c2hs on CygWin

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Tue May 2 03:04:52 EDT 2006


On Mon, 2006-05-01 at 20:10 -0400, Manuel M T Chakravarty wrote:
> Rich Fought:
> > Attached are two bz2 files, the first one (GnuTLS.i.bz2) captures the
> > __attribute__ error.
> > The second (GnuTLS2.i.bz2) captures the signal.h error that follows after
> > getting around the attribute error as described previously in this thread.
> > If there is anything else I can provide please let me know.
> 
> Thanks for those.
> 
> > Also, c2hs generally does not play nice in Cygwin.  The post-install script
> > does not
> > run correctly, and must be run by hand.  Even then, there are problems with
> > paths (/ vs \) so the script must be edited by hand for it to run correctly.
> 
> To be honest, I am not sure how to write shell scripts with portable
> file name conventions.  Do you know what the Right Thing is?  Or Duncan?

I don't like the script either. For the gentoo ebuild we had to remove
the script and do the things it did in the ebuild. This is because it
was trying to write into the live file system rather than into the
installation directory.

> Incidentally, the latest version of Cabal, shipped with GHC 6.4.2 seems
> to no longer require the post-install script (ie, it should now be
> possible to add the functionality to Setup.hs) - script was always a
> kludge to get around a shortcoming in Cabal's API.  Maybe the easiest
> thing to do is to just to get rid of that script now (but that will mean
> you need at least GHC 6.4.2).

If the script can be eliminated then that's even better.

> > When installing other packages (such as hsgnutls) using Cabal, Cabal looks
> > for c2hs.exe installed on the system, not the script in /usr/local/bin.  So
> > you have to add c2hs.exe to the path to get configured, but then the build
> > fails because it is missing the flags in the script.  So you have to call
> > c2hs by hand.  I only had 3 files to process, but for many files this could
> > quicky become a pain.
> 
> This would be a bug in Cabal, wouldn't it?  If so, I 'd be happy to
> contact Issac about fixing this - just want to make sure I am on the
> right track.

I'm not sure it is a bug. Cabal is not a cygwin program so knows nothing
about "/usr/local/bin". But perhaps Cabal should make a more educated
guess for where c2hs might live on a windows install (eg where Cabal
would install it!).

> Sorry for being so tentative.  I am keen to get c2hs work smoothly for
> windows users, but I lack the expertise to do so without some
> assistance.

I know a bit about windows deployment. I do the win32 builds & installer
for gtk2hs.

Duncan



More information about the C2hs mailing list