network icon indicating copy to clipboard operation
network copied to clipboard

Releasing v3.2

Open kazu-yamamoto opened this issue 5 years ago • 3 comments

Breaking changes may include:

  • [ ] Using StrictData and removing bangs as many as possible (#454)
  • [ ] Introducing Strict only if we reach consensus (#412)
  • [ ] #426

kazu-yamamoto avatar May 19 '20 02:05 kazu-yamamoto

SinceStrict changes behavior, we need the following to pass tests:

diff --git a/Network/Socket/Types.hsc b/Network/Socket/Types.hsc
index 8cbe9fc..853ad0c 100644
--- a/Network/Socket/Types.hsc
+++ b/Network/Socket/Types.hsc
@@ -935,6 +935,7 @@ class SocketAddress sa where
 sockaddrStorageLen :: Int
 sockaddrStorageLen = 128
 
+{-# NOINLINE withSocketAddress #-}
 withSocketAddress :: SocketAddress sa => sa -> (Ptr sa -> Int -> IO a) -> IO a
 withSocketAddress addr f = do
     let sz = sizeOfSocketAddress addr
@@ -1050,6 +1051,9 @@ sizeOfSockAddr SockAddrUnix{}  = error "sizeOfSockAddr: not supported"
 sizeOfSockAddr SockAddrInet{}  = #const sizeof(struct sockaddr_in)
 sizeOfSockAddr SockAddrInet6{} = #const sizeof(struct sockaddr_in6)
 
+-- The combination of "-XString" and inlining results in a bug where
+-- "sz" is always 0.
+{-# NOINLINE withSockAddr #-}
 -- | Use a 'SockAddr' with a function requiring a pointer to a
 -- 'SockAddr' and the length of that 'SockAddr'.
 withSockAddr :: SockAddr -> (Ptr SockAddr -> Int -> IO a) -> IO a

kazu-yamamoto avatar May 19 '20 02:05 kazu-yamamoto

For Strict, Storable instances should be defined with lazy bindings.

kazu-yamamoto avatar May 19 '20 02:05 kazu-yamamoto

I created a project for tracking progress on 3.2.0.0.

https://github.com/haskell/network/projects/5

eborden avatar May 20 '20 22:05 eborden