Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data-default-class -> data-default #546

Merged
merged 1 commit into from
Oct 27, 2024

Conversation

9999years
Copy link
Contributor

data-default 0.8 deprecates data-default-class by moving the Default class from Data.Default.Class to Data.Default.

See: kazu-yamamoto/crypton-certificate#11
See: haskell-tls/hs-tls#486
See: commercialhaskell/stackage#7545

data-default 0.8 deprecates data-default-class by moving the `Default`
class from `Data.Default.Class` to `Data.Default`.

See: kazu-yamamoto/crypton-certificate#11
See: haskell-tls/hs-tls#486
See: commercialhaskell/stackage#7545
Copy link
Owner

@snoyberg snoyberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@snoyberg snoyberg merged commit 5c6da80 into snoyberg:master Oct 27, 2024
snoyberg added a commit that referenced this pull request Oct 27, 2024
@Bodigrim
Copy link
Contributor

Something is off, but I cannot figure out whose fault it is (crypton-connection?):

http-client-tls-0.3.6.4$ cabal build -c 'data-default>=0.8'
Resolving dependencies...
Build profile: -w ghc-9.6.6 -O1
In order, the following will be built (use -v for more details):
 - http-client-tls-0.3.6.4 (lib) (configuration changed)
Configuring library for http-client-tls-0.3.6.4...
Preprocessing library for http-client-tls-0.3.6.4...
Building library for http-client-tls-0.3.6.4...
[1 of 1] Compiling Network.HTTP.Client.TLS [Data.Default package changed]

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-7125]
Failed to build http-client-tls-0.3.6.4.

@juhp
Copy link
Contributor

juhp commented Oct 28, 2024

Yes, also reported in #547

@juhp
Copy link
Contributor

juhp commented Oct 28, 2024

Also note that data-default-class 0.2.0 was since released for compatibility.
Not sure if it helps though - I think it just re-exports from data-default iiuc.

@juhp
Copy link
Contributor

juhp commented Oct 28, 2024

Dunno if it is possible to do a revision for this?

@snoyberg
Copy link
Owner

I won't be spending more time on this issue. it's not an ecosystem issue I'm willing to spend my time debugging.

@9999years
Copy link
Contributor Author

@Bodigrim Unfortunately these PRs are all pretty interdependent -- e.g. kazu-yamamoto/crypton-certificate#11 and kazu-yamamoto/crypton-connection#6 are also needed to get the data-default changes fixed for this group of packages.

@9999years 9999years deleted the fix-for-data-default branch October 28, 2024 17:33
@Bodigrim
Copy link
Contributor

I think the solution is to revise the latest release of http-client-tls with data-default < 0.8 (I can do it myself as a Hackage trustee). When related PRs are merged, we can revise it once again with data-default >= 0.8, crypton-certificate >= X.Y.Z, crypton-connection >= U.V.W.

@hamishmack
Copy link
Contributor

@Bodigrim it looks like the issue we have been seeing is that hoogle has a constraint in hackage that prevents it from using the new crypton-connection package.

See ndmitchell/hoogle#435

@Bodigrim
Copy link
Contributor

Bodigrim commented Nov 4, 2024

@hamishmack you can build hoogle with cabal build -c 'data-default-class>=0.2'. Cabal does not know that it has to avoid build plans using both data-default-class < 0.2 and data-default >= 0.8.

It's tempting to revise crypton-x509-validation (which is at the root of all these build plans) with data-default-class >= 0.2. This will be an annoyance for Stackage though, because it would not be able to pull this revision without updating LTS...

@Bodigrim
Copy link
Contributor

Bodigrim commented Nov 7, 2024

As of now cabal install hoogle just works, so hopefully the migration to the new data-default is complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants