tathougies / beam-mysql

Beam MySQL compatibility layer
https://tathougies.github.io/beam
MIT License
10 stars 31 forks source link

Build failing (possibly, incompatibility with beam-core or mysql) #12

Open graninas opened 5 years ago

graninas commented 5 years ago

Hi, I'm getting the following build errors (stack, lts-14.4):

    /private/var/folders/3c/ng1xzgl50hs15g4r4c2v0wqh0000gn/T/stack37614/beam-mysql-0.2.0.0/Database/Beam/MySQL/Connection.hs:241:59: error:
        Data constructor not in scope: UseRemoteConnection :: Option
        |
    241 |                      ( "useRemoteConnection", _ ) -> pure UseRemoteConnection
        |                                                           ^^^^^^^^^^^^^^^^^^^

    /private/var/folders/3c/ng1xzgl50hs15g4r4c2v0wqh0000gn/T/stack37614/beam-mysql-0.2.0.0/Database/Beam/MySQL/Connection.hs:242:61: error:
        Data constructor not in scope: UseEmbeddedConnection :: Option
        |
    242 |                      ( "useEmbeddedConnection", _ ) -> pure UseEmbeddedConnection
        |                                                             ^^^^^^^^^^^^^^^^^^^^^

    /private/var/folders/3c/ng1xzgl50hs15g4r4c2v0wqh0000gn/T/stack37614/beam-mysql-0.2.0.0/Database/Beam/MySQL/Connection.hs:243:55: error:
        Data constructor not in scope: GuessConnection :: Option
        |
    243 |                      ( "guessConnection", _ ) -> pure GuessConnection
        |                                                       ^^^^^^^^^^^^^^^

    /private/var/folders/3c/ng1xzgl50hs15g4r4c2v0wqh0000gn/T/stack37614/beam-mysql-0.2.0.0/Database/Beam/MySQL/Connection.hs:245:32: error:
        Data constructor not in scope: ClientIP :: BS.ByteString -> Option
        |
    245 |                          pure (ClientIP (BS.pack fp))
        |                                ^^^^^^^^

    /private/var/folders/3c/ng1xzgl50hs15g4r4c2v0wqh0000gn/T/stack37614/beam-mysql-0.2.0.0/Database/Beam/MySQL/Connection.hs:253:26: error:
        Data constructor not in scope:
          SSLVerifyServerCert :: Bool -> Option
        |
    253 |                          SSLVerifyServerCert <$> parseBool b

Is there any solution to this?

graninas commented 5 years ago

Seems duplication of https://github.com/tathougies/beam-mysql/issues/11.

UPD: sorry, wrong text was inserted. Not a duplication.

graninas commented 5 years ago

It seems these options have been made conditionally compillable in the mysql library:

#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 80000
#else
      UseRemoteConnection ->
        go (#const MYSQL_OPT_USE_REMOTE_CONNECTION) nullPtr
      UseEmbeddedConnection ->
        go (#const MYSQL_OPT_USE_EMBEDDED_CONNECTION) nullPtr
      GuessConnection ->
        go (#const MYSQL_OPT_GUESS_CONNECTION) nullPtr
      ClientIP ip ->
        useAsCString ip $ go (#const MYSQL_SET_CLIENT_IP)
      SecureAuth b ->
        withBool b $ go (#const MYSQL_SECURE_AUTH)
#endif

I've commented them out in the beam-mysql, and also I've merged the travis/better-parsing branch into master in my fork: https://github.com/graninas/beam-mysql

Not sure if it works though, and what features are now broken. Hopefully we'll not be needing in them.