Re: [Haskell-cafe] network-2.3.0.10 compiled for ghc 7.4.1 windows

I just use the version of MSys that is included with Git [1]. This puts a
"Git bash" icon on your desktop which you can then use to build the network
library.
[1] http://code.google.com/p/msysgit/
2012/2/7 Alberto G. Corona
Nothing bur a long history of failures. The problem is the configuration and versioning of MinGW and MSys. This is a nighmare.
Oh you are using Cygwin. I'm using MSys so this is why I cannot reproduce your problem. Is there anything preventing you from using MSys?
2012/2/7 Alberto G. Corona
The "problem" this time is in "Configure" :
case "$host" in *-mingw32) EXTRA_SRCS="cbits/initWinSock.c, cbits/winSockErr.c, cbits/asyncAccept.c" EXTRA_LIBS=ws2_32 CALLCONV=stdcall ;; *-solaris2*) EXTRA_SRCS="cbits/ancilData.c" EXTRA_LIBS="nsl, socket" CALLCONV=ccall ;; *) EXTRA_SRCS="cbits/ancilData.c" EXTRA_LIBS= CALLCONV=ccall ;; esac
Since I´m cross-compiling with cygwin, the variable Host does not contain ¨*-muingw32" but "i686-pc-cygwin"
changing the case , the library incorporates the lost C coded files.
Now the library links fine win imported, but there is a runtime error:
NetworkSocket.hsc:(948,3)-(1007,23): Non-exhaustive patterns in case
maybe it is due to some other preprocessor directive mismatch
2012/2/7 Holger Reinhardt
: Did you also change the files in the /cbits/ folder? Because they also check for HAVE_WINSOCK_H.
2012/2/7 Alberto G. Corona
The code is evolving and none of the versions match exactily with the patch, but substituting HAVE_WINSOCK by HAVE WINSOCK2 in these files solves the compilation problem at least in the network 2.3.0.10 version from hackage.
However it produces the same undefined references when this library
is
imported in my application. It seems that some object code is not included in the final library. I verified that at least some of
undefined references correspond with C code in the source, but somehow this is not included in the object library....
2012/2/7 Johan Tibell
: Note that there are two branches on github, master and stable. You want the latter.
On Feb 7, 2012 8:23 AM, "Alberto G. Corona"
wrote: > > This is quite different. > I don´t know how but I was looking at some other older patch around > the same issue and I supposed that it was the one refered by Yohan > Tibell. > > I´ll try your patch. > > Thanks!. > > 2012/2/7 Holger Reinhardt : > > Hi, > > > > (I submitted the patch that Johan linked to) > > Network/Socket/Internal.hsc has the following code: > > > > #if defined(WITH_WINSOCK) || defined(cygwin32_HOST_OS) > > type CSaFamily = (#type unsigned short) > > #elif defined(darwin_HOST_OS) > > type CSaFamily = (#type u_char) > > #else > > type CSaFamily = (#type sa_family_t) > > #endif > > > > You have patched this part to always use 'unsigned short'. But 2012/2/7 Holger Reinhardt
: these the > > real > > issue is that WITH_WINSOCK is not defined, even though it should > > be. The > > reason for this lies in include/HsNet.h: > > > > #if defined(HAVE_WINSOCK_H) && !defined(cygwin32_HOST_OS) > > # define WITH_WINSOCK 1 > > #endif > > > > The problem here is that it checks for HAVE_WINSOCK_H, but the > > configure > > script never defines this variable. Instead it > > defines HAVE_WINSOCK2_H. > > It > > seems that the network library used Winsock1 in the past and in > > the > > transition to Winsock2 someone forgot to change a few of the > > #ifdefs. > > > > My patch just changes all occurences of HAVE_WINSOCK_H > > to HAVE_WINSOCK2_H. > > You might want to try that and report back if it works for you. > > > > 2012/2/7 Alberto G. Corona
> >> > >> Hi Johan, > >> The patch is not for the current version of network and the code > >> is > >> quite different. Basically it is necesary to define this > >> variable > >> as > >> "unsigned short" that is the thing intended in the patch. however > >> I > >> put it by brute force, without regard of the prerpocessor > >> directives. > >> With this change the code compiles well with: > >> > >> > >> > >> > >> > >> http://neilmitchell.blogspot.com/2010/12/installing-haskell-network-library-... > >> > >> However my compiled library lack the methods defined as foreign. > >> I´ll > >> keep trying. > >> > >> 2012/2/6 Johan Tibell : > >> > Hi, > >> > > >> > Someone recently contributed a fix that should make network > >> > build > >> > with > >> > 7.4: https://github.com/haskell/network/pull/25 > >> > > >> > Can you see if that works for you? I haven't yet had time to > >> > merge > >> > and > >> > release that fix (I'm on vacation.) > >> > > >> > -- Johan > >> > > >> > >> _______________________________________________ > >> Haskell-Cafe mailing list > >> Haskell-Cafe@haskell.org > >> http://www.haskell.org/mailman/listinfo/haskell-cafe > > > >

I switched to Git bash and the runtime error produced by the library
is the same.
This error may be produced because the configuration it does not
detect the netwiorkin related includes such is socket.h. This does not
exist neither in the ghc installation neither in GIT/Mingw
2012/2/7 Holger Reinhardt
I just use the version of MSys that is included with Git [1]. This puts a "Git bash" icon on your desktop which you can then use to build the network library.
[1] http://code.google.com/p/msysgit/
2012/2/7 Alberto G. Corona
Nothing bur a long history of failures. The problem is the configuration and versioning of MinGW and MSys. This is a nighmare.
2012/2/7 Holger Reinhardt
: Oh you are using Cygwin. I'm using MSys so this is why I cannot reproduce your problem. Is there anything preventing you from using MSys?
2012/2/7 Alberto G. Corona
The "problem" this time is in "Configure" :
case "$host" in *-mingw32) EXTRA_SRCS="cbits/initWinSock.c, cbits/winSockErr.c, cbits/asyncAccept.c" EXTRA_LIBS=ws2_32 CALLCONV=stdcall ;; *-solaris2*) EXTRA_SRCS="cbits/ancilData.c" EXTRA_LIBS="nsl, socket" CALLCONV=ccall ;; *) EXTRA_SRCS="cbits/ancilData.c" EXTRA_LIBS= CALLCONV=ccall ;; esac
Since I´m cross-compiling with cygwin, the variable Host does not contain ¨*-muingw32" but "i686-pc-cygwin"
changing the case , the library incorporates the lost C coded files.
Now the library links fine win imported, but there is a runtime error:
NetworkSocket.hsc:(948,3)-(1007,23): Non-exhaustive patterns in case
maybe it is due to some other preprocessor directive mismatch
2012/2/7 Holger Reinhardt
: Did you also change the files in the /cbits/ folder? Because they also check for HAVE_WINSOCK_H.
2012/2/7 Alberto G. Corona
The code is evolving and none of the versions match exactily with the patch, but substituting HAVE_WINSOCK by HAVE WINSOCK2 in these files solves the compilation problem at least in the network 2.3.0.10 version from hackage.
However it produces the same undefined references when this library is imported in my application. It seems that some object code is not included in the final library. I verified that at least some of these undefined references correspond with C code in the source, but somehow this is not included in the object library....
2012/2/7 Johan Tibell
: > Note that there are two branches on github, master and stable. You > want > the > latter. > > On Feb 7, 2012 8:23 AM, "Alberto G. Corona" > wrote: >> >> This is quite different. >> I don´t know how but I was looking at some other older patch >> around >> the same issue and I supposed that it was the one refered by >> Yohan >> Tibell. >> >> I´ll try your patch. >> >> Thanks!. >> >> 2012/2/7 Holger Reinhardt : >> > Hi, >> > >> > (I submitted the patch that Johan linked to) >> > Network/Socket/Internal.hsc has the following code: >> > >> > #if defined(WITH_WINSOCK) || defined(cygwin32_HOST_OS) >> > type CSaFamily = (#type unsigned short) >> > #elif defined(darwin_HOST_OS) >> > type CSaFamily = (#type u_char) >> > #else >> > type CSaFamily = (#type sa_family_t) >> > #endif >> > >> > You have patched this part to always use 'unsigned short'. But >> > the >> > real >> > issue is that WITH_WINSOCK is not defined, even though it >> > should >> > be. The >> > reason for this lies in include/HsNet.h: >> > >> > #if defined(HAVE_WINSOCK_H) && !defined(cygwin32_HOST_OS) >> > # define WITH_WINSOCK 1 >> > #endif >> > >> > The problem here is that it checks for HAVE_WINSOCK_H, but the >> > configure >> > script never defines this variable. Instead it >> > defines HAVE_WINSOCK2_H. >> > It >> > seems that the network library used Winsock1 in the past and in >> > the >> > transition to Winsock2 someone forgot to change a few of the >> > #ifdefs. >> > >> > My patch just changes all occurences of HAVE_WINSOCK_H >> > to HAVE_WINSOCK2_H. >> > You might want to try that and report back if it works for you. >> > >> > 2012/2/7 Alberto G. Corona >> >> >> >> Hi Johan, >> >> The patch is not for the current version of network and the >> >> code >> >> is >> >> quite different. Basically it is necesary to define this >> >> variable >> >> as >> >> "unsigned short" that is the thing intended in the patch. >> >> however >> >> I >> >> put it by brute force, without regard of the prerpocessor >> >> directives. >> >> With this change the code compiles well with: >> >> >> >> >> >> >> >> >> >> >> >> >> >> http://neilmitchell.blogspot.com/2010/12/installing-haskell-network-library-... >> >> >> >> However my compiled library lack the methods defined as >> >> foreign. >> >> I´ll >> >> keep trying. >> >> >> >> 2012/2/6 Johan Tibell : >> >> > Hi, >> >> > >> >> > Someone recently contributed a fix that should make network >> >> > build >> >> > with >> >> > 7.4: https://github.com/haskell/network/pull/25 >> >> > >> >> > Can you see if that works for you? I haven't yet had time to >> >> > merge >> >> > and >> >> > release that fix (I'm on vacation.) >> >> > >> >> > -- Johan >> >> > >> >> >> >> _______________________________________________ >> >> Haskell-Cafe mailing list >> >> Haskell-Cafe@haskell.org >> >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > >> >

Did you run "cabal clean" before rebuilding with Git Bash? And can you post
the exact runtime error you get?
2012/2/8 Alberto G. Corona
I switched to Git bash and the runtime error produced by the library is the same. This error may be produced because the configuration it does not detect the netwiorkin related includes such is socket.h. This does not exist neither in the ghc installation neither in GIT/Mingw
I just use the version of MSys that is included with Git [1]. This puts a "Git bash" icon on your desktop which you can then use to build the network library.
[1] http://code.google.com/p/msysgit/
2012/2/7 Alberto G. Corona
Nothing bur a long history of failures. The problem is the configuration and versioning of MinGW and MSys. This is a nighmare.
2012/2/7 Holger Reinhardt
: Oh you are using Cygwin. I'm using MSys so this is why I cannot reproduce your problem. Is there anything preventing you from using MSys?
2012/2/7 Alberto G. Corona
The "problem" this time is in "Configure" :
case "$host" in *-mingw32) EXTRA_SRCS="cbits/initWinSock.c, cbits/winSockErr.c, cbits/asyncAccept.c" EXTRA_LIBS=ws2_32 CALLCONV=stdcall ;; *-solaris2*) EXTRA_SRCS="cbits/ancilData.c" EXTRA_LIBS="nsl, socket" CALLCONV=ccall ;; *) EXTRA_SRCS="cbits/ancilData.c" EXTRA_LIBS= CALLCONV=ccall ;; esac
Since I´m cross-compiling with cygwin, the variable Host does not contain ¨*-muingw32" but "i686-pc-cygwin"
changing the case , the library incorporates the lost C coded files.
Now the library links fine win imported, but there is a runtime
error:
NetworkSocket.hsc:(948,3)-(1007,23): Non-exhaustive patterns in case
maybe it is due to some other preprocessor directive mismatch
2012/2/7 Holger Reinhardt
: Did you also change the files in the /cbits/ folder? Because they also check for HAVE_WINSOCK_H.
2012/2/7 Alberto G. Corona
> > The code is evolving and none of the versions match exactily with > the > patch, but substituting HAVE_WINSOCK by HAVE WINSOCK2 in these files
> solves the compilation problem at least in the network 2.3.0.10 > version from hackage. > > However it produces the same undefined references when this
> is > imported in my application. It seems that some object code is not > included in the final library. I verified that at least some of > these > undefined references correspond with C code in the source, but > somehow this is not included in the object library.... > > 2012/2/7 Johan Tibell
: > > Note that there are two branches on github, master and stable. You > > want > > the > > latter. > > > > On Feb 7, 2012 8:23 AM, "Alberto G. Corona" < agocorona@gmail.com> > > wrote: > >> > >> This is quite different. > >> I don´t know how but I was looking at some other older patch > >> around > >> the same issue and I supposed that it was the one refered by > >> Yohan > >> Tibell. > >> > >> I´ll try your patch. > >> > >> Thanks!. > >> > >> 2012/2/7 Holger Reinhardt : > >> > Hi, > >> > > >> > (I submitted the patch that Johan linked to) > >> > Network/Socket/Internal.hsc has the following code: > >> > > >> > #if defined(WITH_WINSOCK) || defined(cygwin32_HOST_OS) > >> > type CSaFamily = (#type unsigned short) > >> > #elif defined(darwin_HOST_OS) > >> > type CSaFamily = (#type u_char) > >> > #else > >> > type CSaFamily = (#type sa_family_t) > >> > #endif > >> > > >> > You have patched this part to always use 'unsigned short'. But > >> > the > >> > real > >> > issue is that WITH_WINSOCK is not defined, even though it > >> > should > >> > be. The > >> > reason for this lies in include/HsNet.h: > >> > > >> > #if defined(HAVE_WINSOCK_H) && !defined(cygwin32_HOST_OS) > >> > # define WITH_WINSOCK 1 > >> > #endif > >> > > >> > The problem here is that it checks for HAVE_WINSOCK_H, but 2012/2/7 Holger Reinhardt
: library the > >> > configure > >> > script never defines this variable. Instead it > >> > defines HAVE_WINSOCK2_H. > >> > It > >> > seems that the network library used Winsock1 in the past and in > >> > the > >> > transition to Winsock2 someone forgot to change a few of the > >> > #ifdefs. > >> > > >> > My patch just changes all occurences of HAVE_WINSOCK_H > >> > to HAVE_WINSOCK2_H. > >> > You might want to try that and report back if it works for you. > >> > > >> > 2012/2/7 Alberto G. Corona
> >> >> > >> >> Hi Johan, > >> >> The patch is not for the current version of network and the > >> >> code > >> >> is > >> >> quite different. Basically it is necesary to define this > >> >> variable > >> >> as > >> >> "unsigned short" that is the thing intended in the patch. > >> >> however > >> >> I > >> >> put it by brute force, without regard of the prerpocessor > >> >> directives. > >> >> With this change the code compiles well with: > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> http://neilmitchell.blogspot.com/2010/12/installing-haskell-network-library-... > >> >> > >> >> However my compiled library lack the methods defined as > >> >> foreign. > >> >> I´ll > >> >> keep trying. > >> >> > >> >> 2012/2/6 Johan Tibell : > >> >> > Hi, > >> >> > > >> >> > Someone recently contributed a fix that should make network > >> >> > build > >> >> > with > >> >> > 7.4: https://github.com/haskell/network/pull/25 > >> >> > > >> >> > Can you see if that works for you? I haven't yet had time to > >> >> > merge > >> >> > and > >> >> > release that fix (I'm on vacation.) > >> >> > > >> >> > -- Johan > >> >> > > >> >> > >> >> _______________________________________________ > >> >> Haskell-Cafe mailing list > >> >> Haskell-Cafe@haskell.org > >> >> http://www.haskell.org/mailman/listinfo/haskell-cafe > >> > > >> >

yes i did it,.
the error is as follows:
shop.exe: NetworkSocket.hsc:(948,3)-(1007,23): Non-exhaustive patterns in case
I will download network form hackage and will do it form the beginning. .
2012/2/8 Holger Reinhardt
Did you run "cabal clean" before rebuilding with Git Bash? And can you post the exact runtime error you get?
2012/2/8 Alberto G. Corona
I switched to Git bash and the runtime error produced by the library is the same. This error may be produced because the configuration it does not detect the netwiorkin related includes such is socket.h. This does not exist neither in the ghc installation neither in GIT/Mingw
2012/2/7 Holger Reinhardt
: I just use the version of MSys that is included with Git [1]. This puts a "Git bash" icon on your desktop which you can then use to build the network library.
[1] http://code.google.com/p/msysgit/
2012/2/7 Alberto G. Corona
Nothing bur a long history of failures. The problem is the configuration and versioning of MinGW and MSys. This is a nighmare.
2012/2/7 Holger Reinhardt
: Oh you are using Cygwin. I'm using MSys so this is why I cannot reproduce your problem. Is there anything preventing you from using MSys?
2012/2/7 Alberto G. Corona
The "problem" this time is in "Configure" :
case "$host" in *-mingw32) EXTRA_SRCS="cbits/initWinSock.c, cbits/winSockErr.c, cbits/asyncAccept.c" EXTRA_LIBS=ws2_32 CALLCONV=stdcall ;; *-solaris2*) EXTRA_SRCS="cbits/ancilData.c" EXTRA_LIBS="nsl, socket" CALLCONV=ccall ;; *) EXTRA_SRCS="cbits/ancilData.c" EXTRA_LIBS= CALLCONV=ccall ;; esac
Since I´m cross-compiling with cygwin, the variable Host does not contain ¨*-muingw32" but "i686-pc-cygwin"
changing the case , the library incorporates the lost C coded files.
Now the library links fine win imported, but there is a runtime error:
NetworkSocket.hsc:(948,3)-(1007,23): Non-exhaustive patterns in case
maybe it is due to some other preprocessor directive mismatch
2012/2/7 Holger Reinhardt
: > Did you also change the files in the /cbits/ folder? Because they > also > check > for HAVE_WINSOCK_H. > > > 2012/2/7 Alberto G. Corona >> >> The code is evolving and none of the versions match exactily with >> the >> patch, but substituting HAVE_WINSOCK by HAVE WINSOCK2 in these >> files >> solves the compilation problem at least in the network 2.3.0.10 >> version from hackage. >> >> However it produces the same undefined references when this >> library >> is >> imported in my application. It seems that some object code is not >> included in the final library. I verified that at least some of >> these >> undefined references correspond with C code in the source, but >> somehow this is not included in the object library.... >> >> 2012/2/7 Johan Tibell : >> > Note that there are two branches on github, master and stable. >> > You >> > want >> > the >> > latter. >> > >> > On Feb 7, 2012 8:23 AM, "Alberto G. Corona" >> > >> > wrote: >> >> >> >> This is quite different. >> >> I don´t know how but I was looking at some other older patch >> >> around >> >> the same issue and I supposed that it was the one refered by >> >> Yohan >> >> Tibell. >> >> >> >> I´ll try your patch. >> >> >> >> Thanks!. >> >> >> >> 2012/2/7 Holger Reinhardt : >> >> > Hi, >> >> > >> >> > (I submitted the patch that Johan linked to) >> >> > Network/Socket/Internal.hsc has the following code: >> >> > >> >> > #if defined(WITH_WINSOCK) || defined(cygwin32_HOST_OS) >> >> > type CSaFamily = (#type unsigned short) >> >> > #elif defined(darwin_HOST_OS) >> >> > type CSaFamily = (#type u_char) >> >> > #else >> >> > type CSaFamily = (#type sa_family_t) >> >> > #endif >> >> > >> >> > You have patched this part to always use 'unsigned short'. >> >> > But >> >> > the >> >> > real >> >> > issue is that WITH_WINSOCK is not defined, even though it >> >> > should >> >> > be. The >> >> > reason for this lies in include/HsNet.h: >> >> > >> >> > #if defined(HAVE_WINSOCK_H) && !defined(cygwin32_HOST_OS) >> >> > # define WITH_WINSOCK 1 >> >> > #endif >> >> > >> >> > The problem here is that it checks for HAVE_WINSOCK_H, but >> >> > the >> >> > configure >> >> > script never defines this variable. Instead it >> >> > defines HAVE_WINSOCK2_H. >> >> > It >> >> > seems that the network library used Winsock1 in the past and >> >> > in >> >> > the >> >> > transition to Winsock2 someone forgot to change a few of the >> >> > #ifdefs. >> >> > >> >> > My patch just changes all occurences of HAVE_WINSOCK_H >> >> > to HAVE_WINSOCK2_H. >> >> > You might want to try that and report back if it works for >> >> > you. >> >> > >> >> > 2012/2/7 Alberto G. Corona >> >> >> >> >> >> Hi Johan, >> >> >> The patch is not for the current version of network and the >> >> >> code >> >> >> is >> >> >> quite different. Basically it is necesary to define this >> >> >> variable >> >> >> as >> >> >> "unsigned short" that is the thing intended in the patch. >> >> >> however >> >> >> I >> >> >> put it by brute force, without regard of the prerpocessor >> >> >> directives. >> >> >> With this change the code compiles well with: >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> http://neilmitchell.blogspot.com/2010/12/installing-haskell-network-library-... >> >> >> >> >> >> However my compiled library lack the methods defined as >> >> >> foreign. >> >> >> I´ll >> >> >> keep trying. >> >> >> >> >> >> 2012/2/6 Johan Tibell : >> >> >> > Hi, >> >> >> > >> >> >> > Someone recently contributed a fix that should make >> >> >> > network >> >> >> > build >> >> >> > with >> >> >> > 7.4: https://github.com/haskell/network/pull/25 >> >> >> > >> >> >> > Can you see if that works for you? I haven't yet had time >> >> >> > to >> >> >> > merge >> >> >> > and >> >> >> > release that fix (I'm on vacation.) >> >> >> > >> >> >> > -- Johan >> >> >> > >> >> >> >> >> >> _______________________________________________ >> >> >> Haskell-Cafe mailing list >> >> >> Haskell-Cafe@haskell.org >> >> >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > >> >> > > >

Having discussed the issue privately with Alberto, I've found another bug
and updated my pull request [1]. Using that code it should be possible to
build the network library on Windows using MSys on GHC 7.4.1.
[1] https://github.com/haskell/network/pull/25
2012/2/8 Alberto G. Corona
yes i did it,.
the error is as follows:
shop.exe: NetworkSocket.hsc:(948,3)-(1007,23): Non-exhaustive patterns in case
I will download network form hackage and will do it form the beginning. .
Did you run "cabal clean" before rebuilding with Git Bash? And can you
the exact runtime error you get?
2012/2/8 Alberto G. Corona
I switched to Git bash and the runtime error produced by the library is the same. This error may be produced because the configuration it does not detect the netwiorkin related includes such is socket.h. This does not exist neither in the ghc installation neither in GIT/Mingw
2012/2/7 Holger Reinhardt
: I just use the version of MSys that is included with Git [1]. This
a "Git bash" icon on your desktop which you can then use to build the network library.
[1] http://code.google.com/p/msysgit/
2012/2/7 Alberto G. Corona
Nothing bur a long history of failures. The problem is the configuration and versioning of MinGW and MSys. This is a nighmare.
2012/2/7 Holger Reinhardt
: Oh you are using Cygwin. I'm using MSys so this is why I cannot reproduce your problem. Is there anything preventing you from using MSys?
2012/2/7 Alberto G. Corona
> > The "problem" this time is in "Configure" : > > case "$host" in > *-mingw32) > EXTRA_SRCS="cbits/initWinSock.c, cbits/winSockErr.c, > cbits/asyncAccept.c" > EXTRA_LIBS=ws2_32 > CALLCONV=stdcall ;; > *-solaris2*) > EXTRA_SRCS="cbits/ancilData.c" > EXTRA_LIBS="nsl, socket" > CALLCONV=ccall ;; > *) > EXTRA_SRCS="cbits/ancilData.c" > EXTRA_LIBS= > CALLCONV=ccall ;; > esac > > > > Since I´m cross-compiling with cygwin, the variable Host does not > contain ¨*-muingw32" but "i686-pc-cygwin" > > changing the case , the library incorporates the lost C coded files.
> > Now the library links fine win imported, but there is a runtime > error: > > NetworkSocket.hsc:(948,3)-(1007,23): Non-exhaustive patterns in case > > maybe it is due to some other preprocessor directive mismatch > > > 2012/2/7 Holger Reinhardt
: > > Did you also change the files in the /cbits/ folder? Because > > also > > check > > for HAVE_WINSOCK_H. > > > > > > 2012/2/7 Alberto G. Corona
> >> > >> The code is evolving and none of the versions match exactily with > >> the > >> patch, but substituting HAVE_WINSOCK by HAVE WINSOCK2 in these > >> files > >> solves the compilation problem at least in the network 2.3.0.10 > >> version from hackage. > >> > >> However it produces the same undefined references when this > >> library > >> is > >> imported in my application. It seems that some object code is not > >> included in the final library. I verified that at least some of > >> these > >> undefined references correspond with C code in the source, but > >> somehow this is not included in the object library.... > >> > >> 2012/2/7 Johan Tibell : > >> > Note that there are two branches on github, master and stable. > >> > You > >> > want > >> > the > >> > latter. > >> > > >> > On Feb 7, 2012 8:23 AM, "Alberto G. Corona" > >> > > >> > wrote: > >> >> > >> >> This is quite different. > >> >> I don´t know how but I was looking at some other older patch > >> >> around > >> >> the same issue and I supposed that it was the one refered by > >> >> Yohan > >> >> Tibell. > >> >> > >> >> I´ll try your patch. > >> >> > >> >> Thanks!. > >> >> > >> >> 2012/2/7 Holger Reinhardt : > >> >> > Hi, > >> >> > > >> >> > (I submitted the patch that Johan linked to) > >> >> > Network/Socket/Internal.hsc has the following code: > >> >> > > >> >> > #if defined(WITH_WINSOCK) || defined(cygwin32_HOST_OS) > >> >> > type CSaFamily = (#type unsigned short) > >> >> > #elif defined(darwin_HOST_OS) > >> >> > type CSaFamily = (#type u_char) > >> >> > #else > >> >> > type CSaFamily = (#type sa_family_t) > >> >> > #endif > >> >> > > >> >> > You have patched this part to always use 'unsigned short'. > >> >> > But > >> >> > the > >> >> > real > >> >> > issue is that WITH_WINSOCK is not defined, even though it > >> >> > should > >> >> > be. The > >> >> > reason for this lies in include/HsNet.h: > >> >> > > >> >> > #if defined(HAVE_WINSOCK_H) && !defined(cygwin32_HOST_OS) > >> >> > # define WITH_WINSOCK 1 > >> >> > #endif > >> >> > > >> >> > The problem here is that it checks for HAVE_WINSOCK_H, but > >> >> > the > >> >> > configure > >> >> > script never defines this variable. Instead it > >> >> > defines HAVE_WINSOCK2_H. > >> >> > It > >> >> > seems that the network library used Winsock1 in the past and > >> >> > in > >> >> > the > >> >> > transition to Winsock2 someone forgot to change a few of > >> >> > #ifdefs. > >> >> > > >> >> > My patch just changes all occurences of HAVE_WINSOCK_H > >> >> > to HAVE_WINSOCK2_H. > >> >> > You might want to try that and report back if it works for > >> >> > you. > >> >> > > >> >> > 2012/2/7 Alberto G. Corona
> >> >> >> > >> >> >> Hi Johan, > >> >> >> The patch is not for the current version of network and 2012/2/8 Holger Reinhardt
: post puts they the the > >> >> >> code > >> >> >> is > >> >> >> quite different. Basically it is necesary to define this > >> >> >> variable > >> >> >> as > >> >> >> "unsigned short" that is the thing intended in the patch. > >> >> >> however > >> >> >> I > >> >> >> put it by brute force, without regard of the prerpocessor > >> >> >> directives. > >> >> >> With this change the code compiles well with: > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> http://neilmitchell.blogspot.com/2010/12/installing-haskell-network-library-... > >> >> >> > >> >> >> However my compiled library lack the methods defined as > >> >> >> foreign. > >> >> >> I´ll > >> >> >> keep trying. > >> >> >> > >> >> >> 2012/2/6 Johan Tibell
: > >> >> >> > Hi, > >> >> >> > > >> >> >> > Someone recently contributed a fix that should make > >> >> >> > network > >> >> >> > build > >> >> >> > with > >> >> >> > 7.4: https://github.com/haskell/network/pull/25 > >> >> >> > > >> >> >> > Can you see if that works for you? I haven't yet had time > >> >> >> > to > >> >> >> > merge > >> >> >> > and > >> >> >> > release that fix (I'm on vacation.) > >> >> >> > > >> >> >> > -- Johan > >> >> >> > > >> >> >> > >> >> >> _______________________________________________ > >> >> >> Haskell-Cafe mailing list > >> >> >> Haskell-Cafe@haskell.org > >> >> >> http://www.haskell.org/mailman/listinfo/haskell-cafe > >> >> > > >> >> > > > > >

I will merge this as soon as I get back from vacation.
On Feb 8, 2012 8:54 AM, "Holger Reinhardt"
Having discussed the issue privately with Alberto, I've found another bug and updated my pull request [1]. Using that code it should be possible to build the network library on Windows using MSys on GHC 7.4.1.
[1] https://github.com/haskell/network/pull/25
2012/2/8 Alberto G. Corona
yes i did it,.
the error is as follows:
shop.exe: NetworkSocket.hsc:(948,3)-(1007,23): Non-exhaustive patterns in case
I will download network form hackage and will do it form the beginning. .
Did you run "cabal clean" before rebuilding with Git Bash? And can you
the exact runtime error you get?
2012/2/8 Alberto G. Corona
I switched to Git bash and the runtime error produced by the library is the same. This error may be produced because the configuration it does not detect the netwiorkin related includes such is socket.h. This does not exist neither in the ghc installation neither in GIT/Mingw
2012/2/7 Holger Reinhardt
: I just use the version of MSys that is included with Git [1]. This
a "Git bash" icon on your desktop which you can then use to build the network library.
[1] http://code.google.com/p/msysgit/
2012/2/7 Alberto G. Corona
Nothing bur a long history of failures. The problem is the configuration and versioning of MinGW and MSys. This is a nighmare.
2012/2/7 Holger Reinhardt
: > Oh you are using Cygwin. I'm using MSys so this is why I cannot > reproduce > your problem. Is there anything preventing you from using MSys? > > > 2012/2/7 Alberto G. Corona >> >> The "problem" this time is in "Configure" : >> >> case "$host" in >> *-mingw32) >> EXTRA_SRCS="cbits/initWinSock.c, cbits/winSockErr.c, >> cbits/asyncAccept.c" >> EXTRA_LIBS=ws2_32 >> CALLCONV=stdcall ;; >> *-solaris2*) >> EXTRA_SRCS="cbits/ancilData.c" >> EXTRA_LIBS="nsl, socket" >> CALLCONV=ccall ;; >> *) >> EXTRA_SRCS="cbits/ancilData.c" >> EXTRA_LIBS= >> CALLCONV=ccall ;; >> esac >> >> >> >> Since I´m cross-compiling with cygwin, the variable Host does not >> contain ¨*-muingw32" but "i686-pc-cygwin" >> >> changing the case , the library incorporates the lost C coded files.
>> >> Now the library links fine win imported, but there is a runtime >> error: >> >> NetworkSocket.hsc:(948,3)-(1007,23): Non-exhaustive patterns in case >> >> maybe it is due to some other preprocessor directive mismatch >> >> >> 2012/2/7 Holger Reinhardt
: >> > Did you also change the files in the /cbits/ folder? Because >> > also >> > check >> > for HAVE_WINSOCK_H. >> > >> > >> > 2012/2/7 Alberto G. Corona
>> >> >> >> The code is evolving and none of the versions match exactily with >> >> the >> >> patch, but substituting HAVE_WINSOCK by HAVE WINSOCK2 in these >> >> files >> >> solves the compilation problem at least in the network 2.3.0.10 >> >> version from hackage. >> >> >> >> However it produces the same undefined references when this >> >> library >> >> is >> >> imported in my application. It seems that some object code is not >> >> included in the final library. I verified that at least some of >> >> these >> >> undefined references correspond with C code in the source, but >> >> somehow this is not included in the object library.... >> >> >> >> 2012/2/7 Johan Tibell : >> >> > Note that there are two branches on github, master and stable. >> >> > You >> >> > want >> >> > the >> >> > latter. >> >> > >> >> > On Feb 7, 2012 8:23 AM, "Alberto G. Corona" >> >> > >> >> > wrote: >> >> >> >> >> >> This is quite different. >> >> >> I don´t know how but I was looking at some other older >> >> >> around >> >> >> the same issue and I supposed that it was the one refered by >> >> >> Yohan >> >> >> Tibell. >> >> >> >> >> >> I´ll try your patch. >> >> >> >> >> >> Thanks!. >> >> >> >> >> >> 2012/2/7 Holger Reinhardt
: >> >> >> > Hi, >> >> >> > >> >> >> > (I submitted the patch that Johan linked to) >> >> >> > Network/Socket/Internal.hsc has the following code: >> >> >> > >> >> >> > #if defined(WITH_WINSOCK) || defined(cygwin32_HOST_OS) >> >> >> > type CSaFamily = (#type unsigned short) >> >> >> > #elif defined(darwin_HOST_OS) >> >> >> > type CSaFamily = (#type u_char) >> >> >> > #else >> >> >> > type CSaFamily = (#type sa_family_t) >> >> >> > #endif >> >> >> > >> >> >> > You have patched this part to always use 'unsigned short'. >> >> >> > But >> >> >> > the >> >> >> > real >> >> >> > issue is that WITH_WINSOCK is not defined, even though it >> >> >> > should >> >> >> > be. The >> >> >> > reason for this lies in include/HsNet.h: >> >> >> > >> >> >> > #if defined(HAVE_WINSOCK_H) && !defined(cygwin32_HOST_OS) >> >> >> > # define WITH_WINSOCK 1 >> >> >> > #endif >> >> >> > >> >> >> > The problem here is that it checks for HAVE_WINSOCK_H, but >> >> >> > the >> >> >> > configure >> >> >> > script never defines this variable. Instead it >> >> >> > defines HAVE_WINSOCK2_H. >> >> >> > It >> >> >> > seems that the network library used Winsock1 in the past and >> >> >> > in >> >> >> > the >> >> >> > transition to Winsock2 someone forgot to change a few of >> >> >> > #ifdefs. >> >> >> > >> >> >> > My patch just changes all occurences of HAVE_WINSOCK_H >> >> >> > to HAVE_WINSOCK2_H. >> >> >> > You might want to try that and report back if it works for >> >> >> > you. >> >> >> > >> >> >> > 2012/2/7 Alberto G. Corona
>> >> >> >> >> >> >> >> Hi Johan, >> >> >> >> The patch is not for the current version of network and >> >> >> >> code >> >> >> >> is >> >> >> >> quite different. Basically it is necesary to define
>> >> >> >> variable >> >> >> >> as >> >> >> >> "unsigned short" that is the thing intended in the
>> >> >> >> however >> >> >> >> I >> >> >> >> put it by brute force, without regard of the
2012/2/8 Holger Reinhardt
: post puts they patch the the this patch. prerpocessor >> >> >> >> directives. >> >> >> >> With this change the code compiles well with: >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> http://neilmitchell.blogspot.com/2010/12/installing-haskell-network-library-... >> >> >> >> >> >> >> >> However my compiled library lack the methods defined as >> >> >> >> foreign. >> >> >> >> I´ll >> >> >> >> keep trying. >> >> >> >> >> >> >> >> 2012/2/6 Johan Tibell
: >> >> >> >> > Hi, >> >> >> >> > >> >> >> >> > Someone recently contributed a fix that should make >> >> >> >> > network >> >> >> >> > build >> >> >> >> > with >> >> >> >> > 7.4: https://github.com/haskell/network/pull/25 >> >> >> >> > >> >> >> >> > Can you see if that works for you? I haven't yet had time >> >> >> >> > to >> >> >> >> > merge >> >> >> >> > and >> >> >> >> > release that fix (I'm on vacation.) >> >> >> >> > >> >> >> >> > -- Johan >> >> >> >> > >> >> >> >> >> >> >> >> _______________________________________________ >> >> >> >> Haskell-Cafe mailing list >> >> >> >> Haskell-Cafe@haskell.org >> >> >> >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> >> > >> >> >> > >> > >> > > > _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

I've merged and pushed the changes to the "stable" branch on GitHub. If
someone could verify that it works fine on Windows, I'll make another
release.
In addition to running whatever program you're interested in, also run:
cabal clean
autoreconf
cabal configure --enable-tests
cabal build
cabal test
All tests should pass.
-- Johan
On Wed, Feb 8, 2012 at 11:04 AM, Johan Tibell
I will merge this as soon as I get back from vacation. On Feb 8, 2012 8:54 AM, "Holger Reinhardt"
wrote: Having discussed the issue privately with Alberto, I've found another bug and updated my pull request [1]. Using that code it should be possible to build the network library on Windows using MSys on GHC 7.4.1.
[1] https://github.com/haskell/network/pull/25
2012/2/8 Alberto G. Corona
yes i did it,.
the error is as follows:
shop.exe: NetworkSocket.hsc:(948,3)-(1007,23): Non-exhaustive patterns in case
I will download network form hackage and will do it form the beginning. .
Did you run "cabal clean" before rebuilding with Git Bash? And can you
the exact runtime error you get?
2012/2/8 Alberto G. Corona
I switched to Git bash and the runtime error produced by the library is the same. This error may be produced because the configuration it does not detect the netwiorkin related includes such is socket.h. This does not exist neither in the ghc installation neither in GIT/Mingw
2012/2/7 Holger Reinhardt
: I just use the version of MSys that is included with Git [1]. This
a "Git bash" icon on your desktop which you can then use to build the network library.
[1] http://code.google.com/p/msysgit/
2012/2/7 Alberto G. Corona
> > Nothing bur a long history of failures. The problem is the > configuration and versioning of MinGW and MSys. This is a nighmare. > > 2012/2/7 Holger Reinhardt : > > Oh you are using Cygwin. I'm using MSys so this is why I cannot > > reproduce > > your problem. Is there anything preventing you from using MSys? > > > > > > 2012/2/7 Alberto G. Corona > >> > >> The "problem" this time is in "Configure" : > >> > >> case "$host" in > >> *-mingw32) > >> EXTRA_SRCS="cbits/initWinSock.c, cbits/winSockErr.c, > >> cbits/asyncAccept.c" > >> EXTRA_LIBS=ws2_32 > >> CALLCONV=stdcall ;; > >> *-solaris2*) > >> EXTRA_SRCS="cbits/ancilData.c" > >> EXTRA_LIBS="nsl, socket" > >> CALLCONV=ccall ;; > >> *) > >> EXTRA_SRCS="cbits/ancilData.c" > >> EXTRA_LIBS= > >> CALLCONV=ccall ;; > >> esac > >> > >> > >> > >> Since I´m cross-compiling with cygwin, the variable Host does not > >> contain ¨*-muingw32" but "i686-pc-cygwin" > >> > >> changing the case , the library incorporates the lost C coded files. > >> > >> Now the library links fine win imported, but there is a runtime > >> error: > >> > >> NetworkSocket.hsc:(948,3)-(1007,23): Non-exhaustive patterns in case > >> > >> maybe it is due to some other preprocessor directive mismatch > >> > >> > >> 2012/2/7 Holger Reinhardt : > >> > Did you also change the files in the /cbits/ folder? Because > >> > also > >> > check > >> > for HAVE_WINSOCK_H. > >> > > >> > > >> > 2012/2/7 Alberto G. Corona
> >> >> > >> >> The code is evolving and none of the versions match exactily with > >> >> the > >> >> patch, but substituting HAVE_WINSOCK by HAVE WINSOCK2 in > >> >> files > >> >> solves the compilation problem at least in the network 2.3.0.10 > >> >> version from hackage. > >> >> > >> >> However it produces the same undefined references when this > >> >> library > >> >> is > >> >> imported in my application. It seems that some object code is not > >> >> included in the final library. I verified that at least some of > >> >> these > >> >> undefined references correspond with C code in the source, but > >> >> somehow this is not included in the object library.... > >> >> > >> >> 2012/2/7 Johan Tibell
: > >> >> > Note that there are two branches on github, master and stable. > >> >> > You > >> >> > want > >> >> > the > >> >> > latter. > >> >> > > >> >> > On Feb 7, 2012 8:23 AM, "Alberto G. Corona" > >> >> > > >> >> > wrote: > >> >> >> > >> >> >> This is quite different. > >> >> >> I don´t know how but I was looking at some other older > >> >> >> around > >> >> >> the same issue and I supposed that it was the one refered by > >> >> >> Yohan > >> >> >> Tibell. > >> >> >> > >> >> >> I´ll try your patch. > >> >> >> > >> >> >> Thanks!. > >> >> >> > >> >> >> 2012/2/7 Holger Reinhardt
: > >> >> >> > Hi, > >> >> >> > > >> >> >> > (I submitted the patch that Johan linked to) > >> >> >> > Network/Socket/Internal.hsc has the following code: > >> >> >> > > >> >> >> > #if defined(WITH_WINSOCK) || defined(cygwin32_HOST_OS) > >> >> >> > type CSaFamily = (#type unsigned short) > >> >> >> > #elif defined(darwin_HOST_OS) > >> >> >> > type CSaFamily = (#type u_char) > >> >> >> > #else > >> >> >> > type CSaFamily = (#type sa_family_t) > >> >> >> > #endif > >> >> >> > > >> >> >> > You have patched this part to always use 'unsigned short'. > >> >> >> > But > >> >> >> > the > >> >> >> > real > >> >> >> > issue is that WITH_WINSOCK is not defined, even though it > >> >> >> > should > >> >> >> > be. The > >> >> >> > reason for this lies in include/HsNet.h: > >> >> >> > > >> >> >> > #if defined(HAVE_WINSOCK_H) && !defined(cygwin32_HOST_OS) > >> >> >> > # define WITH_WINSOCK 1 > >> >> >> > #endif > >> >> >> > > >> >> >> > The problem here is that it checks for HAVE_WINSOCK_H, but > >> >> >> > the > >> >> >> > configure > >> >> >> > script never defines this variable. Instead it > >> >> >> > defines HAVE_WINSOCK2_H. > >> >> >> > It > >> >> >> > seems that the network library used Winsock1 in the > >> >> >> > in > >> >> >> > the > >> >> >> > transition to Winsock2 someone forgot to change a few of the > >> >> >> > #ifdefs. > >> >> >> > > >> >> >> > My patch just changes all occurences of HAVE_WINSOCK_H > >> >> >> > to HAVE_WINSOCK2_H. > >> >> >> > You might want to try that and report back if it works for > >> >> >> > you. > >> >> >> > > >> >> >> > 2012/2/7 Alberto G. Corona
> >> >> >> >> > >> >> >> >> Hi Johan, > >> >> >> >> The patch is not for the current version of network and the > >> >> >> >> code > >> >> >> >> is > >> >> >> >> quite different. Basically it is necesary to define > >> >> >> >> variable > >> >> >> >> as > >> >> >> >> "unsigned short" that is the thing intended in the
> >> >> >> >> however > >> >> >> >> I > >> >> >> >> put it by brute force, without regard of the
2012/2/8 Holger Reinhardt
: post puts they these patch past and this patch. prerpocessor > >> >> >> >> directives. > >> >> >> >> With this change the code compiles well with: > >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> http://neilmitchell.blogspot.com/2010/12/installing-haskell-network-library-... > >> >> >> >> > >> >> >> >> However my compiled library lack the methods defined as > >> >> >> >> foreign. > >> >> >> >> I´ll > >> >> >> >> keep trying. > >> >> >> >> > >> >> >> >> 2012/2/6 Johan Tibell
: > >> >> >> >> > Hi, > >> >> >> >> > > >> >> >> >> > Someone recently contributed a fix that should make > >> >> >> >> > network > >> >> >> >> > build > >> >> >> >> > with > >> >> >> >> > 7.4: https://github.com/haskell/network/pull/25 > >> >> >> >> > > >> >> >> >> > Can you see if that works for you? I haven't yet had time > >> >> >> >> > to > >> >> >> >> > merge > >> >> >> >> > and > >> >> >> >> > release that fix (I'm on vacation.) > >> >> >> >> > > >> >> >> >> > -- Johan > >> >> >> >> > > >> >> >> >> > >> >> >> >> _______________________________________________ > >> >> >> >> Haskell-Cafe mailing list > >> >> >> >> Haskell-Cafe@haskell.org > >> >> >> >> http://www.haskell.org/mailman/listinfo/haskell-cafe > >> >> >> > > >> >> >> > > >> > > >> > > > > > _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Did as requested and everything seems to work fine. Test suite also passes:
Test Cases Total
Passed 10 10
Failed 0 0
Total 10 10
Test suite simple: PASS
2012/2/13 Johan Tibell
I've merged and pushed the changes to the "stable" branch on GitHub. If someone could verify that it works fine on Windows, I'll make another release.
In addition to running whatever program you're interested in, also run:
cabal clean autoreconf cabal configure --enable-tests cabal build cabal test
All tests should pass.
-- Johan
On Wed, Feb 8, 2012 at 11:04 AM, Johan Tibell
wrote: I will merge this as soon as I get back from vacation. On Feb 8, 2012 8:54 AM, "Holger Reinhardt"
wrote: Having discussed the issue privately with Alberto, I've found another bug and updated my pull request [1]. Using that code it should be possible to build the network library on Windows using MSys on GHC 7.4.1.
[1] https://github.com/haskell/network/pull/25
2012/2/8 Alberto G. Corona
yes i did it,.
the error is as follows:
shop.exe: NetworkSocket.hsc:(948,3)-(1007,23): Non-exhaustive patterns in case
I will download network form hackage and will do it form the beginning. .
Did you run "cabal clean" before rebuilding with Git Bash? And can you post the exact runtime error you get?
2012/2/8 Alberto G. Corona
I switched to Git bash and the runtime error produced by the library is the same. This error may be produced because the configuration it does not detect the netwiorkin related includes such is socket.h. This does not exist neither in the ghc installation neither in GIT/Mingw
2012/2/7 Holger Reinhardt
: > I just use the version of MSys that is included with Git [1]. This > a > "Git bash" icon on your desktop which you can then use to build the > network > library. > > [1] http://code.google.com/p/msysgit/ > > > 2012/2/7 Alberto G. Corona
>> >> Nothing bur a long history of failures. The problem is the >> configuration and versioning of MinGW and MSys. This is a nighmare. >> >> 2012/2/7 Holger Reinhardt : >> > Oh you are using Cygwin. I'm using MSys so this is why I cannot >> > reproduce >> > your problem. Is there anything preventing you from using MSys? >> > >> > >> > 2012/2/7 Alberto G. Corona >> >> >> >> The "problem" this time is in "Configure" : >> >> >> >> case "$host" in >> >> *-mingw32) >> >> EXTRA_SRCS="cbits/initWinSock.c, cbits/winSockErr.c, >> >> cbits/asyncAccept.c" >> >> EXTRA_LIBS=ws2_32 >> >> CALLCONV=stdcall ;; >> >> *-solaris2*) >> >> EXTRA_SRCS="cbits/ancilData.c" >> >> EXTRA_LIBS="nsl, socket" >> >> CALLCONV=ccall ;; >> >> *) >> >> EXTRA_SRCS="cbits/ancilData.c" >> >> EXTRA_LIBS= >> >> CALLCONV=ccall ;; >> >> esac >> >> >> >> >> >> >> >> Since I´m cross-compiling with cygwin, the variable Host does not >> >> contain ¨*-muingw32" but "i686-pc-cygwin" >> >> >> >> changing the case , the library incorporates the lost C coded files. >> >> >> >> Now the library links fine win imported, but there is a runtime >> >> error: >> >> >> >> NetworkSocket.hsc:(948,3)-(1007,23): Non-exhaustive patterns in case >> >> >> >> maybe it is due to some other preprocessor directive mismatch >> >> >> >> >> >> 2012/2/7 Holger Reinhardt : >> >> > Did you also change the files in the /cbits/ folder? Because >> >> > also >> >> > check >> >> > for HAVE_WINSOCK_H. >> >> > >> >> > >> >> > 2012/2/7 Alberto G. Corona
>> >> >> >> >> >> The code is evolving and none of the versions match exactily with >> >> >> the >> >> >> patch, but substituting HAVE_WINSOCK by HAVE WINSOCK2 in >> >> >> files >> >> >> solves the compilation problem at least in the network 2.3.0.10 >> >> >> version from hackage. >> >> >> >> >> >> However it produces the same undefined references when this >> >> >> library >> >> >> is >> >> >> imported in my application. It seems that some object code is not >> >> >> included in the final library. I verified that at least some of >> >> >> these >> >> >> undefined references correspond with C code in the source, but >> >> >> somehow this is not included in the object library.... >> >> >> >> >> >> 2012/2/7 Johan Tibell
: >> >> >> > Note that there are two branches on github, master and stable. >> >> >> > You >> >> >> > want >> >> >> > the >> >> >> > latter. >> >> >> > >> >> >> > On Feb 7, 2012 8:23 AM, "Alberto G. Corona" >> >> >> > >> >> >> > wrote: >> >> >> >> >> >> >> >> This is quite different. >> >> >> >> I don´t know how but I was looking at some other older >> >> >> >> around >> >> >> >> the same issue and I supposed that it was the one refered by >> >> >> >> Yohan >> >> >> >> Tibell. >> >> >> >> >> >> >> >> I´ll try your patch. >> >> >> >> >> >> >> >> Thanks!. >> >> >> >> >> >> >> >> 2012/2/7 Holger Reinhardt
: >> >> >> >> > Hi, >> >> >> >> > >> >> >> >> > (I submitted the patch that Johan linked to) >> >> >> >> > Network/Socket/Internal.hsc has the following code: >> >> >> >> > >> >> >> >> > #if defined(WITH_WINSOCK) || defined(cygwin32_HOST_OS) >> >> >> >> > type CSaFamily = (#type unsigned short) >> >> >> >> > #elif defined(darwin_HOST_OS) >> >> >> >> > type CSaFamily = (#type u_char) >> >> >> >> > #else >> >> >> >> > type CSaFamily = (#type sa_family_t) >> >> >> >> > #endif >> >> >> >> > >> >> >> >> > You have patched this part to always use 'unsigned short'. >> >> >> >> > But >> >> >> >> > the >> >> >> >> > real >> >> >> >> > issue is that WITH_WINSOCK is not defined, even though it >> >> >> >> > should >> >> >> >> > be. The >> >> >> >> > reason for this lies in include/HsNet.h: >> >> >> >> > >> >> >> >> > #if defined(HAVE_WINSOCK_H) && !defined(cygwin32_HOST_OS) >> >> >> >> > # define WITH_WINSOCK 1 >> >> >> >> > #endif >> >> >> >> > >> >> >> >> > The problem here is that it checks for HAVE_WINSOCK_H, but >> >> >> >> > the >> >> >> >> > configure >> >> >> >> > script never defines this variable. Instead it >> >> >> >> > defines HAVE_WINSOCK2_H. >> >> >> >> > It >> >> >> >> > seems that the network library used Winsock1 in the >> >> >> >> > in >> >> >> >> > the >> >> >> >> > transition to Winsock2 someone forgot to change a few of the >> >> >> >> > #ifdefs. >> >> >> >> > >> >> >> >> > My patch just changes all occurences of HAVE_WINSOCK_H >> >> >> >> > to HAVE_WINSOCK2_H. >> >> >> >> > You might want to try that and report back if it works for >> >> >> >> > you. >> >> >> >> > >> >> >> >> > 2012/2/7 Alberto G. Corona
>> >> >> >> >> >> >> >> >> >> Hi Johan, >> >> >> >> >> The patch is not for the current version of network and the >> >> >> >> >> code >> >> >> >> >> is >> >> >> >> >> quite different. Basically it is necesary to define >> >> >> >> >> variable >> >> >> >> >> as >> >> >> >> >> "unsigned short" that is the thing intended in the
>> >> >> >> >> however >> >> >> >> >> I >> >> >> >> >> put it by brute force, without regard of the
2012/2/8 Holger Reinhardt
: puts they these patch past and this patch. prerpocessor >> >> >> >> >> directives. >> >> >> >> >> With this change the code compiles well with: >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> http://neilmitchell.blogspot.com/2010/12/installing-haskell-network-library-... >> >> >> >> >> >> >> >> >> >> However my compiled library lack the methods defined as >> >> >> >> >> foreign. >> >> >> >> >> I´ll >> >> >> >> >> keep trying. >> >> >> >> >> >> >> >> >> >> 2012/2/6 Johan Tibell
: >> >> >> >> >> > Hi, >> >> >> >> >> > >> >> >> >> >> > Someone recently contributed a fix that should make >> >> >> >> >> > network >> >> >> >> >> > build >> >> >> >> >> > with >> >> >> >> >> > 7.4: https://github.com/haskell/network/pull/25 >> >> >> >> >> > >> >> >> >> >> > Can you see if that works for you? I haven't yet had time >> >> >> >> >> > to >> >> >> >> >> > merge >> >> >> >> >> > and >> >> >> >> >> > release that fix (I'm on vacation.) >> >> >> >> >> > >> >> >> >> >> > -- Johan >> >> >> >> >> > >> >> >> >> >> >> >> >> >> >> _______________________________________________ >> >> >> >> >> Haskell-Cafe mailing list >> >> >> >> >> Haskell-Cafe@haskell.org >> >> >> >> >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> >> >> > >> >> >> >> > >> >> > >> >> > >> > >> > > > _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Version 2.3.0.11 released.
On Mon, Feb 13, 2012 at 9:58 AM, Holger Reinhardt
Did as requested and everything seems to work fine. Test suite also passes:
Test Cases Total Passed 10 10 Failed 0 0 Total 10 10 Test suite simple: PASS
2012/2/13 Johan Tibell
I've merged and pushed the changes to the "stable" branch on GitHub. If someone could verify that it works fine on Windows, I'll make another release.
In addition to running whatever program you're interested in, also run:
cabal clean autoreconf cabal configure --enable-tests cabal build cabal test
All tests should pass.
-- Johan
On Wed, Feb 8, 2012 at 11:04 AM, Johan Tibell
wrote: I will merge this as soon as I get back from vacation. On Feb 8, 2012 8:54 AM, "Holger Reinhardt"
wrote: Having discussed the issue privately with Alberto, I've found another bug and updated my pull request [1]. Using that code it should be possible to build the network library on Windows using MSys on GHC 7.4.1.
[1] https://github.com/haskell/network/pull/25
2012/2/8 Alberto G. Corona
yes i did it,.
the error is as follows:
shop.exe: NetworkSocket.hsc:(948,3)-(1007,23): Non-exhaustive patterns in case
I will download network form hackage and will do it form the beginning. .
Did you run "cabal clean" before rebuilding with Git Bash? And can you post the exact runtime error you get?
2012/2/8 Alberto G. Corona
> I switched to Git bash and the runtime error produced by the library > is the same. > This error may be produced because the configuration it does not > detect the netwiorkin related includes such is socket.h. This does not > exist neither in the ghc installation neither in GIT/Mingw > > > 2012/2/7 Holger Reinhardt
: > > I just use the version of MSys that is included with Git [1]. This puts > > a > > "Git bash" icon on your desktop which you can then use to build > > network > > library. > > > > [1] http://code.google.com/p/msysgit/ > > > > > > 2012/2/7 Alberto G. Corona
> >> > >> Nothing bur a long history of failures. The problem is the > >> configuration and versioning of MinGW and MSys. This is a nighmare. > >> > >> 2012/2/7 Holger Reinhardt : > >> > Oh you are using Cygwin. I'm using MSys so this is why I cannot > >> > reproduce > >> > your problem. Is there anything preventing you from using MSys? > >> > > >> > > >> > 2012/2/7 Alberto G. Corona > >> >> > >> >> The "problem" this time is in "Configure" : > >> >> > >> >> case "$host" in > >> >> *-mingw32) > >> >> EXTRA_SRCS="cbits/initWinSock.c, cbits/winSockErr.c, > >> >> cbits/asyncAccept.c" > >> >> EXTRA_LIBS=ws2_32 > >> >> CALLCONV=stdcall ;; > >> >> *-solaris2*) > >> >> EXTRA_SRCS="cbits/ancilData.c" > >> >> EXTRA_LIBS="nsl, socket" > >> >> CALLCONV=ccall ;; > >> >> *) > >> >> EXTRA_SRCS="cbits/ancilData.c" > >> >> EXTRA_LIBS= > >> >> CALLCONV=ccall ;; > >> >> esac > >> >> > >> >> > >> >> > >> >> Since I´m cross-compiling with cygwin, the variable Host does not > >> >> contain ¨*-muingw32" but "i686-pc-cygwin" > >> >> > >> >> changing the case , the library incorporates the lost C coded files. > >> >> > >> >> Now the library links fine win imported, but there is a runtime > >> >> error: > >> >> > >> >> NetworkSocket.hsc:(948,3)-(1007,23): Non-exhaustive patterns in case > >> >> > >> >> maybe it is due to some other preprocessor directive mismatch > >> >> > >> >> > >> >> 2012/2/7 Holger Reinhardt : > >> >> > Did you also change the files in the /cbits/ folder? Because they > >> >> > also > >> >> > check > >> >> > for HAVE_WINSOCK_H. > >> >> > > >> >> > > >> >> > 2012/2/7 Alberto G. Corona > >> >> >> > >> >> >> The code is evolving and none of the versions match exactily with > >> >> >> the > >> >> >> patch, but substituting HAVE_WINSOCK by HAVE WINSOCK2 in > >> >> >> files > >> >> >> solves the compilation problem at least in the network 2.3.0.10 > >> >> >> version from hackage. > >> >> >> > >> >> >> However it produces the same undefined references when this > >> >> >> library > >> >> >> is > >> >> >> imported in my application. It seems that some object code is not > >> >> >> included in the final library. I verified that at least some of > >> >> >> these > >> >> >> undefined references correspond with C code in the
> >> >> >> somehow this is not included in the object library.... > >> >> >> > >> >> >> 2012/2/7 Johan Tibell
: > >> >> >> > Note that there are two branches on github, master and stable. > >> >> >> > You > >> >> >> > want > >> >> >> > the > >> >> >> > latter. > >> >> >> > > >> >> >> > On Feb 7, 2012 8:23 AM, "Alberto G. Corona" > >> >> >> > > >> >> >> > wrote: > >> >> >> >> > >> >> >> >> This is quite different. > >> >> >> >> I don´t know how but I was looking at some other older > >> >> >> >> around > >> >> >> >> the same issue and I supposed that it was the one refered by > >> >> >> >> Yohan > >> >> >> >> Tibell. > >> >> >> >> > >> >> >> >> I´ll try your patch. > >> >> >> >> > >> >> >> >> Thanks!. > >> >> >> >> > >> >> >> >> 2012/2/7 Holger Reinhardt
: > >> >> >> >> > Hi, > >> >> >> >> > > >> >> >> >> > (I submitted the patch that Johan linked to) > >> >> >> >> > Network/Socket/Internal.hsc has the following code: > >> >> >> >> > > >> >> >> >> > #if defined(WITH_WINSOCK) || defined(cygwin32_HOST_OS) > >> >> >> >> > type CSaFamily = (#type unsigned short) > >> >> >> >> > #elif defined(darwin_HOST_OS) > >> >> >> >> > type CSaFamily = (#type u_char) > >> >> >> >> > #else > >> >> >> >> > type CSaFamily = (#type sa_family_t) > >> >> >> >> > #endif > >> >> >> >> > > >> >> >> >> > You have patched this part to always use 'unsigned short'. > >> >> >> >> > But > >> >> >> >> > the > >> >> >> >> > real > >> >> >> >> > issue is that WITH_WINSOCK is not defined, even > >> >> >> >> > should > >> >> >> >> > be. The > >> >> >> >> > reason for this lies in include/HsNet.h: > >> >> >> >> > > >> >> >> >> > #if defined(HAVE_WINSOCK_H) && !defined(cygwin32_HOST_OS) > >> >> >> >> > # define WITH_WINSOCK 1 > >> >> >> >> > #endif > >> >> >> >> > > >> >> >> >> > The problem here is that it checks for HAVE_WINSOCK_H, but > >> >> >> >> > the > >> >> >> >> > configure > >> >> >> >> > script never defines this variable. Instead it > >> >> >> >> > defines HAVE_WINSOCK2_H. > >> >> >> >> > It > >> >> >> >> > seems that the network library used Winsock1 in the
> >> >> >> >> > in > >> >> >> >> > the > >> >> >> >> > transition to Winsock2 someone forgot to change a few of the > >> >> >> >> > #ifdefs. > >> >> >> >> > > >> >> >> >> > My patch just changes all occurences of HAVE_WINSOCK_H > >> >> >> >> > to HAVE_WINSOCK2_H. > >> >> >> >> > You might want to try that and report back if it works for > >> >> >> >> > you. > >> >> >> >> > > >> >> >> >> > 2012/2/7 Alberto G. Corona
> >> >> >> >> >> > >> >> >> >> >> Hi Johan, > >> >> >> >> >> The patch is not for the current version of network and the > >> >> >> >> >> code > >> >> >> >> >> is > >> >> >> >> >> quite different. Basically it is necesary to define > >> >> >> >> >> variable > >> >> >> >> >> as > >> >> >> >> >> "unsigned short" that is the thing intended in the
> >> >> >> >> >> however > >> >> >> >> >> I > >> >> >> >> >> put it by brute force, without regard of the
2012/2/8 Holger Reinhardt
: the these source, but patch though it past and this patch. prerpocessor > >> >> >> >> >> directives. > >> >> >> >> >> With this change the code compiles well with: > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> http://neilmitchell.blogspot.com/2010/12/installing-haskell-network-library-... > >> >> >> >> >> > >> >> >> >> >> However my compiled library lack the methods defined as > >> >> >> >> >> foreign. > >> >> >> >> >> I´ll > >> >> >> >> >> keep trying. > >> >> >> >> >> > >> >> >> >> >> 2012/2/6 Johan Tibell
: > >> >> >> >> >> > Hi, > >> >> >> >> >> > > >> >> >> >> >> > Someone recently contributed a fix that should make > >> >> >> >> >> > network > >> >> >> >> >> > build > >> >> >> >> >> > with > >> >> >> >> >> > 7.4: https://github.com/haskell/network/pull/25 > >> >> >> >> >> > > >> >> >> >> >> > Can you see if that works for you? I haven't yet had time > >> >> >> >> >> > to > >> >> >> >> >> > merge > >> >> >> >> >> > and > >> >> >> >> >> > release that fix (I'm on vacation.) > >> >> >> >> >> > > >> >> >> >> >> > -- Johan > >> >> >> >> >> > > >> >> >> >> >> > >> >> >> >> >> _______________________________________________ > >> >> >> >> >> Haskell-Cafe mailing list > >> >> >> >> >> Haskell-Cafe@haskell.org > >> >> >> >> >> http://www.haskell.org/mailman/listinfo/haskell-cafe > >> >> >> >> > > >> >> >> >> > > >> >> > > >> >> > > >> > > >> > > > > > _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

I put Network Version 2.3.0.10 compiled for ghc.7.4.1 Windows (this
time without runtime errors) in the address refereed above. Just in
case someone want to avoid cabal configure-build and just want to
cabal install.
2012/2/13 Johan Tibell
Resending as the last message got held for moderation:
On Mon, Feb 13, 2012 at 10:18 AM, Johan Tibell
wrote: Version 2.3.0.11 released.

Hi Alberto. Do we need cygwin to install your compiled package? I thought not (I'm not very versed on this) but when I tried "cabal install network" after extracting it I got: Configuring network-2.3.0.11... cabal: The package has a './configure' script. This requires a Unix compatibility toolchain such as MinGW+MSYS or Cygwin. cabal: Error: some packages failed to install: network-2.3.0.11 failed during the configure step. The exception was: ExitFailure 1 Best regards, and thanks for any help! - Matias

Hello Matias
On Wed, Feb 22, 2012 at 4:02 PM, Matias Hernandez
Hi Alberto.
Do we need cygwin to install your compiled package?
I don't believe you do. If memory doesn't fail me, the Haskell Platform includes a compiler (MinGW), but not a shell (MSYS). This page explains all: http://trac.haskell.org/haskell-platform/ticket/165 Chris
I thought not (I'm not very versed on this) but when I tried "cabal install network" after extracting it I got:
Configuring network-2.3.0.11... cabal: The package has a './configure' script. This requires a Unix compatibility toolchain such as MinGW+MSYS or Cygwin. cabal: Error: some packages failed to install: network-2.3.0.11 failed during the configure step. The exception was: ExitFailure 1
Best regards, and thanks for any help! - Matias
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hi,
you do need msys or cygwin for "cabal install"ing network
msys at
http://sourceforge.net/projects/mingw/files/MSYS/Base/msys-core/msys-1.0.11/...
You will then have to follow the instructions at
http://www.mingw.org/wiki/MSYS. Please make sure that it uses ghc's mingw
thanks
Hemanth K
On Wed, Feb 22, 2012 at 8:32 AM, Matias Hernandez
Hi Alberto.
Do we need cygwin to install your compiled package? I thought not (I'm not very versed on this) but when I tried "cabal install network" after extracting it I got:
Configuring network-2.3.0.11... cabal: The package has a './configure' script. This requires a Unix compatibility toolchain such as MinGW+MSYS or Cygwin. cabal: Error: some packages failed to install: network-2.3.0.11 failed during the configure step. The exception was: ExitFailure 1
Best regards, and thanks for any help! - Matias
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- I drink I am thunk.

Theoretically you only have to exec cabal install at the directory where setup.hs is located. It is not necessary neither cygwin neither mingw I guess

I though it might work without it, but I get the error I mentioned: cabal: Error: some packages failed to install: network-2.3.0.10 failed during the configure step. The exception was: ExitFailure 1 Well, I'll try with msys. Thanks for your time!
participants (6)
-
Alberto G. Corona
-
Chris Wong
-
Holger Reinhardt
-
Johan Tibell
-
Matias Hernandez
-
Sai Hemanth K