audreyt / network-multicast

[Haskell] The "Network.Multicast" module is for sending UDP datagrams over multicast (class D) addresses.
http://github.com/audreyt/network-multicast
Other
23 stars 12 forks source link

network-multicast-0.0.8 failed during the building phase #7

Closed obscaenvs closed 11 years ago

obscaenvs commented 11 years ago

It would seem that this is an issue worthy of reporting, but excuse me any faux pas I might have committed in doing so.

I am on a freshly installed Haskell Platform 2013.2.0.0 64bit with (of course)

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3

I needed network-multicast-0.0.8as a dependency to build Simon Marlow's code for "Parallel and Concurrent Haskell", found at http://hackage.haskell.org/package/parconc-examples. I followed the innocuous instructions in the book (p.4, can be supplied if need be). But alas, compiler errors ensue:

$ cabal install --only-dependencies
Resolving dependencies...
Configuring network-multicast-0.0.8...
Building network-multicast-0.0.8...
Preprocessing library network-multicast-0.0.8...
[1 of 1] Compiling Network.Multicast ( dist/build/Network/Multicast.hs, dist/build/Network/Multicast.o )

src/Network/Multicast.hsc:76:50:
    Couldn't match type `Socket' with `()'
    Expected type: () -> IO ()
      Actual type: Socket -> IO ()                                                          v35 2013-08-31 10:26 CEST
    In the second argument of `bracketOnError', namely `close'
    In the expression: bracketOnError get close setup
    In an equation for `multicastReceiver':
        multicastReceiver host port
          = bracketOnError get close setup
          where
              get
                = do { proto <- getProtocolNumber "udp";
                       .... }
              setup sock
                = do { (addrInfo : _) <- getAddrInfo
                                           Nothing (Just host) (Just $ show port);
                       .... }

src/Network/Multicast.hsc:76:56:
    Couldn't match type `Socket' with `()'
    Expected type: () -> IO Socket
      Actual type: Socket -> IO Socket
    In the third argument of `bracketOnError', namely `setup'
    In the expression: bracketOnError get close setup
    In an equation for `multicastReceiver':
        multicastReceiver host port
          = bracketOnError get close setup
          where
              get
                = do { proto <- getProtocolNumber "udp";
                       .... }
              setup sock
                = do { (addrInfo : _) <- getAddrInfo
                                           Nothing (Just host) (Just $ show port);
                       .... }
Failed to install network-multicast-0.0.8
cabal: Error: some packages failed to install:
distributed-process-simplelocalnet-0.2.0.9 depends on network-multicast-0.0.8
which failed to install.
network-multicast-0.0.8 failed during the building phase. The exception was:
ExitFailure 1
adinapoli commented 11 years ago

I was going to report the very same issue, I'm using, exactly as @obscaenvs GHC 7.6.3. I'm on Mac OS X 10.8.4. I think also there is a bit of misalignment between the upload version on Hackage (0.0.8) and the one on github, where the cabal manifest says "0.0.7", but I think they are indeed the same.

adinapoli commented 11 years ago

The fix was trivial, submitting a patch now.

audreyt commented 11 years ago

Thanks for the pull request! It was indeed a regression in 0.0.8's SO_REUSEPORT fix.

Released to Hackage as 0.0.9.

obscaenvs commented 11 years ago

Splendid!

adinapoli commented 11 years ago

Talking about fast turnaround: From the issue to the new hackage version in less than three hours: well done :)

obscaenvs commented 11 years ago

Yes, by my standards a mere reply in 24h would have been quick, considering time zones and all :+1:

adinapoli commented 11 years ago

Yep it was funny indeed; I'm Italian but based in Manchester, and @audreyt is in Taiwan (according to the Gihub profile). And you are in Sweden, lol!