mtth / tracing

Distributed tracing
https://hackage.haskell.org/package/tracing
BSD 3-Clause "New" or "Revised" License
24 stars 11 forks source link

Fails to build with `base16-bytestring-1.0.0.0` #4

Closed typed-hole closed 3 years ago

typed-hole commented 4 years ago

Hi!

I tried downloading and building this library, but ran into a compile error! I noticed that the cabal file specifies a dependency on base16-bytestring >= 0.1, but in 1.0.0.0, there was a breaking API change. In particular, I ran into this error:

src/Control/Monad/Trace/Internal.hs:135:3: error:
    • Couldn't match expected type ‘Either String ByteString’
                  with actual type ‘(ByteString, ByteString)’
    • In the pattern: (bs, trail)
      In a case alternative: (bs, trail) | BS.Char8.null trail -> Just bs
      In the expression:
        case Base16.decode $ BS.Char8.pack $ T.unpack t of
          (bs, trail) | BS.Char8.null trail -> Just bs
          _ -> Nothing
    |
135 |   (bs, trail) | BS.null trail -> Just bs
    |   ^^^^^^^^^^^

I would love to help out making a patch to fix this, but I'm not sure what the preferred solution is. Would it be better to make a patch that restricts the version bounds to >= 0.1 && < 1.0.0.0, or would it be better to make a patch that lets the project compile against base16-bytestring 1.0.0.0?

mtth commented 3 years ago

Hi @typed-hole, thanks for reporting. I'd recommend restricting the version until 1.0.0.0 makes it into Stackage's LTS.

mtth commented 3 years ago

It turns out this issue was failing Travis builds, so I added the bound in https://github.com/mtth/tracing/commit/47a15f08c0d4b82cfb665cdbda4866e1341eea0f.