[Haskell-cafe] Re: Compiling regex-posix-0.93.2 on windows

Paulo Tanimoto tanimoto at arizona.edu
Thu Jan 15 18:14:31 EST 2009


Hi Chris,

Good call, I'm following your advice.  ghci fails to load with the
package that it seemed to compile just fine.  Here are some details
(also see file attached).

Thank you!

Paulo

$ wget http://hackage.haskell.org/packages/archive/regex-posix/0.93.2/regex-posix-0.93.2.tar.gz

$ vim regex-posix.cabal
  -----------------------------------------------------------------
  CC-Options: -DHAVE_REGEX_H
  -- Includes:
  Include-Dirs: f:\cygwin\usr\include
  -- Extra-Libraries:
  -- Extra-Lib-Dirs:
  -----------------------------------------------------------------

$ ghci -package regex-posix
WARNING: GHCi invoked via 'ghci.exe' in *nix-like shells (cygwin-bash,
in particular)
         doesn't handle Ctrl-C well; use the 'ghcii.sh' shell wrapper instead
GHCi, version 6.10.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
Loading package syb ... linking ... done.
Loading package array-0.2.0.0 ... linking ... done.
Loading package base-3.0.3.0 ... linking ... done.
Loading package bytestring-0.9.1.4 ... linking ... done.
Loading package containers-0.2.0.0 ... linking ... done.
Loading package mtl-1.1.0.2 ... linking ... done.
Loading package regex-base-0.93.1 ... linking ... done.
Loading package regex-posix-0.93.2 ... linking ... : unable to load
package `regex-posix-0.93.2'
:
C:\Program Files\Haskell\regex-posix-0.93.2\ghc-6.10.1\HSregex-posix-0.93.2.o:
unknown symbol `_regerror'



On Thu, Jan 15, 2009 at 4:00 PM, ChrisK <haskell at list.mightyreason.com> wrote:
> Paulo: I suggest doing this more carefully.
>
> Get the source from hackage.
>
> Edit the regex-posix.cabal file to add the include and lib directories you
> need on Cygwin.
>
> cabal "configure" it.
>
> cabal "build" it.
>
> cabal "install" it.
>
> Then in an unrelated directory try and run "ghci -package regex-posix".
>  This should load regex-posix-VERSION.  If this fails then I think that the
> cabal file needs fixing.
>
> If that works then please test it with these commands:
>>
>> Prelude> :m + Text.Regex.Posix
>> Prelude Text.Regex.Posix> (Text.Regex.Posix.=~) "ab" "(()|[ab])(b)" ::
>> (String,String,String,[String])
>
> The right answer by the way is:
>> ("","ab","",["a","","b"])
>
> But on FreeBSD/NetBSD/OS X there is a bug that I have found and it prints:
>> ("a","b","",["","","b"])
>
> Which just goes to show that a mountain of QuickCheck is what is sometimes
> needed to catch really hard to trigger bugs.
>
> This is the other bug I reported:
>>
>> Prelude Text.Regex.Posix> (Text.Regex.Posix.=~) "XababaY"
>> "(X)(aba|ab|b)*(Y)" :: (String,String,String,[String])
>> ("","XababaY","",["X","b","Y"])
>
> The above answer is impossible (what matched "a" next to "b"?), but I now
> think I know WTF the library code is doing wrong (I think it is matching
> "ababa" in two passes and the second pass is greedy which is a broken
> strategy).  The right answer is:
>
>> ("","XababaY","",["X","aba","Y"])
>
> Cheers,
>  Chris
>
> PS: Yes, I have reported these bug to Apple, FreeBSD, and NetBSD this month.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: regex-posix.log
Type: application/octet-stream
Size: 5328 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20090115/a7042735/regex-posix.obj


More information about the Haskell-Cafe mailing list