Hi Malcom,

On 23.04.2010, at 16:45, Wallace, Malcolm wrote:

>> Another problem is that the cabal-generated commandline for
>> gtk2hsC2hs uses Windows-style backslashes for relative
>> filepaths.  This seems like a very weird interaction with MinGW
>
> OK, scratch that.  I realised today that you cannot simply cut-n-paste
> the output of "cabal build -v" into an Msys shell and expect it to  
> work,
> because Cabal of course is not using a shell (with associated  
> quotation
> mechanisms), but rather System.Cmd.rawSystem.
>

Too bad! I already had a patch that would simply pass absolute  
filenames to c2hs.

> So, investigating in ghci, by converting the output of "cabal build - 
> v"
> manually into the equivalent call to rawSystem, and adjusting the  
> error
> printing mechanism of gtk2hsC2hs to, I see that the _real_ error is
> this:
>
>    gtk2hsC2hs.exe: does not exist
>    dist\build\System\Glib/System\Glib\GValue.hs:
>        openFile: does not exist (No such file or directory)
>        ExitFailure 1
>
> Somehow, the output location is not being formed correctly.  Is the
> following pair of arguments correct, in the generated call to
> gtk2hsC2hs?
>
>    --output-dir=dist\build\System\Glib
>    --output=System\Glib\GValue.hs
>
> because it seems to me that when you stick them together, you get the
> path reported by gtk2hsC2hs as not existing.
>

c2hs has some very weird path mangling in it since it was written  
before hierarchical module names were commonplace.

What I found was that it strips the path from the output file (thus,  
System\Glib\GValue.hs becomes GValue.hs) and then prepends the output  
dir. It could be that the function stripping this path only works on  
Unix file paths but not on Windows paths. Instead of fixing the wicked  
inner workings of c2hs, I adjusted the Setup.hs programs to just pass  
in the file name.

I pushed a patch. Can you pull it and try again?

Thanks for your excellent diagnosis,

Axel




> Regards,
>    Malcolm
> This email and any attachments are confidential and may also be  
> privileged.  If you are not the addressee, do not disclose, copy,  
> circulate or in any other way use or rely on the information  
> contained in this email or any attachments.  If received in error,  
> notify the sender immediately and delete this email and any  
> attachments from your system.  Emails cannot be guaranteed to be  
> secure or error free as the message and any attachments could be  
> intercepted, corrupted, lost, delayed, incomplete or amended.   
> Standard Chartered PLC and its subsidiaries do not accept liability  
> for damage caused by this email or any attachments and may monitor  
> email traffic.
>
>
>
> Standard Chartered PLC is incorporated in England with limited  
> liability under company number 966425 and has its registered office  
> at 1 Aldermanbury Square, London, EC2V 7SB.
>
>
>
> Standard Chartered Bank ("SCB") is incorporated in England with  
> limited liability by Royal Charter 1853, under reference ZC18.  The  
> Principal Office of SCB is situated in England at 1 Aldermanbury  
> Square, London EC2V 7SB. In the United Kingdom, SCB is authorised  
> and regulated by the Financial Services Authority under FSA register  
> number 114276.
>
>
>
> If you are receiving this email from SCB outside the UK, please  
> click http://www.standardchartered.com/global/email_disclaimer.html  
> to refer to the information on other jurisdictions.
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gtk2hs-devel mailing list
> Gtk2hs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel


------------------------------------------------------------------------------
_______________________________________________
Gtk2hs-devel mailing list
Gtk2hs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel

Reply via email to