snoyberg / http-client

An HTTP client engine, intended as a base layer for more user-friendly packages.
280 stars 193 forks source link

http-client-tls-0.3.6.4 is missing lowerbound on tls (>= 2.1.2) #548

Open bfrk opened 3 weeks ago

bfrk commented 3 weeks ago

I am now getting this error

Building library for http-client-tls-0.3.6.4..
[1 of 1] Compiling Network.HTTP.Client.TLS ( Network/HTTP/Client/TLS.hs, dist/build/Network/HTTP/Client/TLS.o, dist/build/Network/HTTP/Client/TLS.dyn_o )

Network/HTTP/Client/TLS.hs:118:40: error: [GHC-39999]
    • No instance for ‘Default NC.TLSSettings’
        arising from a use of ‘def’
    • In the first argument of ‘mkManagerSettings’, namely ‘def’
      In the expression: mkManagerSettings def Nothing
      In an equation for ‘tlsManagerSettings’:
          tlsManagerSettings = mkManagerSettings def Nothing
    |
118 | tlsManagerSettings = mkManagerSettings def Nothing
    |                                        ^^^

Network/HTTP/Client/TLS.hs:192:100: error: [GHC-39999]
    • Could not deduce ‘Default NC.TLSSettings’
        arising from a use of ‘def’
      from the context: MonadIO m
        bound by the type signature for:
                   newTlsManager :: forall (m :: * -> *). MonadIO m => m Manager
        at Network/HTTP/Client/TLS.hs:186:1-39
    • In the third argument of ‘mkManagerSettingsContext'’, namely
        ‘def’
      In the expression:
        mkManagerSettingsContext'
          defaultManagerSettings (Just globalConnectionContext) def
          msocksHTTP msocksHTTPS
      In an equation for ‘settings’:
          settings
            = mkManagerSettingsContext'
                defaultManagerSettings (Just globalConnectionContext) def
                msocksHTTP msocksHTTPS
    |
192 |         settings = mkManagerSettingsContext' defaultManagerSettings (Just globalConnectionContext) def msocksHTTP msocksHTTPS
    |                                                                                                    ^^^

Network/HTTP/Client/TLS.hs:208:81: error: [GHC-39999]
    • Could not deduce ‘Default NC.TLSSettings’
        arising from a use of ‘def’
      from the context: MonadIO m
        bound by the type signature for:
                   newTlsManagerWith :: forall (m :: * -> *).
                                        MonadIO m =>
                                        ManagerSettings -> m Manager
        at Network/HTTP/Client/TLS.hs:202:1-62
    • In the third argument of ‘mkManagerSettingsContext'’, namely
        ‘def’
      In the expression:
        mkManagerSettingsContext'
          set (Just globalConnectionContext) def msocksHTTP msocksHTTPS
      In an equation for ‘settings’:
          settings
            = mkManagerSettingsContext'
                set (Just globalConnectionContext) def msocksHTTP msocksHTTPS
    |
208 |         settings = mkManagerSettingsContext' set (Just globalConnectionContext) def msocksHTTP msocksHTTPS
    |                                                                                 ^^^
Error: cabal: Failed to build http-client-tls-0.3.6.4 (which is required by
darcs-2.19.1). See the build log above for details.

Specifying http-client-tls < 0.3.6.4 (instead of < 0.4 which we had before) fixes our build, but this is not a good solution in the long run, since it cuts us off from bug fixes etc.

bfrk commented 2 weeks ago

The better solution for us was to raise upper bounds on tls and switch from data-default-class to data-default:

    hunk ./darcs.cabal 468
    -                      data-default-class >= 0.1.2.0 && < 0.1.3,
    +                      data-default      >= 0.7.1.3 && < 0.9,
    hunk ./darcs.cabal 470
    -                      tls               >= 2.0.6 && < 2.1
    +                      tls               >= 2.0.6 && < 2.2
    hunk ./src/Darcs/Util/HTTP.hs 49
    -import Data.Default.Class ( def )
    +import Data.Default ( def )

This would not have broken our build if http-client-tls-0.3.6.4 had the appropriate lower bound on tls, namely tls >= 2.1.2.