Hello,

On Tuesday 06 May 2008 16:19, zooko wrote:
> ...
> Here is the config.log, which shows how the buildbot wasn't able to  
> link to libz:
> 
> http://allmydata.org/buildbot-darcs/builders/thorkil%20linux% 
> 20Linux-2.6.13-15%20SUSE-%3F%20i686/builds/23/steps/configure/logs/ 
> config.log

Here we find the failing program to be:

> configure: failed program was:
> -- #line 6512 "configure"
> {-# OPTIONS -fffi -Werror #-}
> module Main where
> 
> foreign import ccall unsafe "zlib.h deflate" fun :: Int -> Int -> Int
> 
> main = fun `seq` putStrLn "hello world"
> 
> end of failed program.

And this fails twice, once without and once with "-lz".

But notice the error message: In both cases, it is:

> conftest.hs:5:8: parse error on input `import'

This means that the FFI declaration is not being recognized. So the problem is 
not related to whether zlib can be accessed or not.

Now, I am no expert in the use of the FFI, but I do know that FFI declarations 
are not recognized, unless some language extension is being activated, in 
this case, it is supposedly done by the "-fffi" option that follows OPTIONS 
in the initial comment.

So what is wrong here?

I believe that the problem is that GHC-6.4.1 (which is used here) only 
recognizes OPTIONS in the very first comment (or in the first line or 
something like that) of a program. In this case, there is a comment or a line 
before the one with the OPTIONS, i.e. the one that mentions the configure 
line number. If that line is left out of the program, everything works fine.

I have attached an illustrative patch, not to be taken seriously as a 
solution, but pointing out the problem, that corrects the problem on this 
builder. Hopefully, someone will be able to find a more suitable correction 
to this problem.

> 
> If you could try to figure out why the one works and the other fails,  
> that would be nice.  Please post to [email protected], with  
> either answers about this or at least questions.  :-)
> 
> Thanks!
> 
> Regards,
> 
> Zooko
> 
> 

Best regards
Thorkil

Attachment: Leave_out_initial_comment_of_Haskell_programs_to_activate_OPTIONS_that_may_follow_illustrative_only.dpatch.gz
Description: GNU Zip compressed data

_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to