haskell / network

Low-level networking interface
http://hackage.haskell.org/package/network
Other
322 stars 186 forks source link

Deprecation warnings with bytestring-0.11.5; allow bytestring-0.12 #563

Closed andreasabel closed 1 year ago

andreasabel commented 1 year ago

Would be good to allow bytestring-0.12. Also in the released version of network, if possible.

Deprecation warnings for memcpy:

[12 of 28] Compiling Network.Socket.Posix.CmsgHdr ( dist/build/Network/Socket/Posix/CmsgHdr.hs, dist/build/Network/Socket/Posix/CmsgHdr.o )

Network/Socket/Posix/CmsgHdr.hsc:72:9: warning: [-Wdeprecations]
    In the use of ‘memcpy’
    (imported from Data.ByteString.Internal, but defined in bytestring-0.11.5.0:Data.ByteString.Internal.Type):
    Deprecated: "Use Foreign.Marshal.Utils.copyBytes instead"
   |
72 |         memcpy dst src len
   |         ^^^^^^

Network/Socket/Posix/CmsgHdr.hsc:91:66: warning: [-Wdeprecations]
    In the use of ‘memcpy’
    (imported from Data.ByteString.Internal, but defined in bytestring-0.11.5.0:Data.ByteString.Internal.Type):
    Deprecated: "Use Foreign.Marshal.Utils.copyBytes instead"
   |
91 |     Cmsg (CmsgId lvl typ) <$> create (fromIntegral siz) (\dst -> memcpy dst src siz)
   |                                                                  ^^^^^^
kazu-yamamoto commented 1 year ago

Could you send a PR?

andreasabel commented 1 year ago

Done in #564.

I tested network-3.1.4.0 with bytestring-0.12 and everything works well:

cabal test --enable-tests --allow-newer=bytestring -c 'bytestring >= 0.12'

So a revision is possible at this point. It could look like this:

andreasabel commented 1 year ago

Ok, published the revision.