dylex / postgresql-typed

Haskell PostgreSQL library with compile-time type inference
http://hackage.haskell.org/package/postgresql-typed
Other
83 stars 12 forks source link

build fails with ghc-9.6 #33

Closed juhp closed 1 year ago

juhp commented 1 year ago
       Building library for postgresql-typed-0.6.2.2..                                                                  [671/167012]
       [ 7 of 17] Compiling Database.PostgreSQL.Typed.Protocol                                                                      

       /var/stackage/work/unpack-dir/unpacked/postgresql-typed-0.6.2.2-e843ed03bbf10cfc8fa0126cb28d470f0fced94beabf7fb0339023f0ec142
075/Database/PostgreSQL/Typed/Protocol.hs:774:55: error: [GHC-83865]
           • Couldn't match expected type ‘crypton-x509-store-1.6.9:Data.X509.CertificateStore.CertificateStore’
                         with actual type ‘Data.X509.CertificateStore.CertificateStore’
             NB: ‘crypton-x509-store-1.6.9:Data.X509.CertificateStore.CertificateStore’
                   is defined in ‘Data.X509.CertificateStore’
                       in package ‘crypton-x509-store-1.6.9’
                 ‘Data.X509.CertificateStore.CertificateStore’
                   is defined in ‘Data.X509.CertificateStore’
                       in package ‘x509-store-1.6.9’
           • In the expression: makeCertificateStore [sc]
             In a record update at field ‘TLS.sharedCAStore’,
             with type constructor ‘TLS.Shared’
             and data constructor ‘TLS.Shared’.
             In the expression:
               def {TLS.sharedCAStore = makeCertificateStore [sc]} 
           |
       774 |         TlsValidate _ sc -> def { TLS.sharedCAStore = makeCertificateStore [sc] }
           |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^

       /var/stackage/work/unpack-dir/unpacked/postgresql-typed-0.6.2.2-e843ed03bbf10cfc8fa0126cb28d470f0fced94beabf7fb0339023f0ec142
075/Database/PostgreSQL/Typed/Protocol.hs:777:72: error: [GHC-83865]
           • Couldn't match type ‘Data.X509.CertificateStore.CertificateStore’
                            with ‘crypton-x509-store-1.6.9:Data.X509.CertificateStore.CertificateStore’
             Expected: TLS.OnServerCertificate
               Actual: Data.X509.CertificateStore.CertificateStore 
                       -> Data.X509.Validation.ValidationCache
                       -> Data.X509.Validation.ServiceID
                       -> x509-1.7.7:Data.X509.CertificateChain.CertificateChain
                       -> IO [Data.X509.Validation.FailedReason]
             NB: ‘crypton-x509-store-1.6.9:Data.X509.CertificateStore.CertificateStore’
                   is defined in ‘Data.X509.CertificateStore’
                       in package ‘crypton-x509-store-1.6.9’
                 ‘Data.X509.CertificateStore.CertificateStore’
                   is defined in ‘Data.X509.CertificateStore’
                       in package ‘x509-store-1.6.9’
           • In the expression: validateNoCheckFQHN
             In a record update at field ‘TLS.onServerCertificate’,
             with type constructor ‘TLS.ClientHooks’

Though I see crypton support has been added behind a flag? I guess it is not released yet.

dylex commented 1 year ago

I just didn't have a good way to test it, but it's now enabled by default and released in 0.6.2.3.

alaendle commented 1 year ago

@dylex - just a sidenote - now even compilation of the test cases seem to require a running server

[2 of 2] Compiling Main

/var/stackage/work/unpack-dir/unpacked/postgresql-typed-0.6.2.3-01c51e02e8e860790fc6b9672951f285f58dff7ac906629ee12cef2904f0f386/test/Main.hs:1:1: error: [GHC-87897]
    Exception when trying to run compile-time code:
      Network.Socket.connect: <socket: 11>: does not exist (No such file or directory)
    Code: template-haskell-2.20.0.0:Language.Haskell.TH.Quote.quoteDec
            pgSQL "!CREATE TYPE myenum AS enum ('abc', 'DEF', 'XX_ye')"
  |
1 | {-# LANGUAGE OverloadedStrings, FlexibleInstances, MultiParamTypeClasses, DataKinds, DeriveDataTypeable, TypeFamilies, PatternGuards, StandaloneDeriving #-}
  | ^
dylex commented 1 year ago

That has always been the case. It's fine to leave the tests disabled on stackage.