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

Build Failure: Compiling Aws.Core fails with "No instance for (Data.Default.Default HTTP.Request) arising from a use of `def'" #101

Closed
heath opened this issue May 11, 2014 · 6 comments

Comments

@heath
Copy link

heath commented May 11, 2014

Here's the output:

$ cabal install aws
...
...
...
Building aws-0.9...
Preprocessing library aws-0.9...
[ 1 of 64] Compiling Aws.Ec2.InstanceMetadata ( Aws/Ec2/InstanceMetadata.hs, dist/build/Aws/Ec2/InstanceMetadata.o )
[ 2 of 64] Compiling Aws.Core         ( Aws/Core.hs, dist/build/Aws/Core.o )

Aws/Core.hs:379:14:
    No instance for (Data.Default.Default HTTP.Request)
      arising from a use of `def'
    Possible fix:
      add an instance declaration for (Data.Default.Default HTTP.Request)
    In the expression: def
    In the second argument of `($)', namely
      `def
         {HTTP.method = httpMethod sqMethod,
          HTTP.secure = case sqProtocol of {
                          HTTP -> False
                          HTTPS -> True },
          HTTP.host = sqHost, HTTP.port = sqPort, HTTP.path = sqPath,
          HTTP.queryString = HTTP.renderQuery False sqQuery,
          HTTP.requestHeaders = catMaybes
                                  [checkDate (\ d -> ("Date", fmtRfc822Time d)) sqDate,
                                   fmap (\ c -> ("Content-Type", c)) contentType,
                                   fmap
                                     (\ md5 -> ("Content-MD5", Base64.encode $ toBytes md5))
                                     sqContentMd5,
                                   ....]
                                ++ sqAmzHeaders ++ sqOtherHeaders,
          HTTP.requestBody = case sqMethod of {
                               PostQuery
                                 -> HTTP.RequestBodyLBS . Blaze.toLazyByteString
                                    $ HTTP.renderQueryBuilder False sqQuery
                               _ -> case sqBody of {
                                      Nothing -> HTTP.RequestBodyBuilder 0 mempty
                                      Just x -> x } },
          HTTP.decompress = HTTP.alwaysDecompress,
          HTTP.checkStatus = \ _ _ _ -> Nothing}'
    In a stmt of a 'do' block:
      return
      $ def
          {HTTP.method = httpMethod sqMethod,
           HTTP.secure = case sqProtocol of {
                           HTTP -> False
                           HTTPS -> True },
           HTTP.host = sqHost, HTTP.port = sqPort, HTTP.path = sqPath,
           HTTP.queryString = HTTP.renderQuery False sqQuery,
           HTTP.requestHeaders = catMaybes
                                   [checkDate (\ d -> ("Date", fmtRfc822Time d)) sqDate,
                                    fmap (\ c -> ("Content-Type", c)) contentType,
                                    fmap
                                      (\ md5 -> ("Content-MD5", Base64.encode $ toBytes md5))
                                      sqContentMd5,
                                    ....]
                                 ++ sqAmzHeaders ++ sqOtherHeaders,
           HTTP.requestBody = case sqMethod of {
                                PostQuery
                                  -> HTTP.RequestBodyLBS . Blaze.toLazyByteString
                                     $ HTTP.renderQueryBuilder False sqQuery
                                _ -> case sqBody of {
                                       Nothing -> HTTP.RequestBodyBuilder 0 mempty
                                       Just x -> x } },
           HTTP.decompress = HTTP.alwaysDecompress,
           HTTP.checkStatus = \ _ _ _ -> Nothing}
Failed to install aws-0.9
cabal: Error: some packages failed to install:
aws-0.9 failed during the building phase. The exception was:
ExitFailure 1
@aristidb
Copy link
Owner

Can you show me the versions of http-conduit and default on your system?
Am 12.05.2014 00:05 schrieb "Heath Matlock" notifications@github.com:

Here's the output:

$ cabal install aws
...
...
...
Building aws-0.9...
Preprocessing library aws-0.9...
[ 1 of 64] Compiling Aws.Ec2.InstanceMetadata ( Aws/Ec2/InstanceMetadata.hs, dist/build/Aws/Ec2/InstanceMetadata.o )
[ 2 of 64] Compiling Aws.Core ( Aws/Core.hs, dist/build/Aws/Core.o )

Aws/Core.hs:379:14:
No instance for (Data.Default.Default HTTP.Request)
arising from a use of def' Possible fix: add an instance declaration for (Data.Default.Default HTTP.Request) In the expression: def In the second argument of($)', namely
`def
{HTTP.method = httpMethod sqMethod,
HTTP.secure = case sqProtocol of {
HTTP -> False
HTTPS -> True },
HTTP.host = sqHost, HTTP.port = sqPort, HTTP.path = sqPath,
HTTP.queryString = HTTP.renderQuery False sqQuery,
HTTP.requestHeaders = catMaybes
[checkDate (\ d -> ("Date", fmtRfc822Time d)) sqDate,
fmap (\ c -> ("Content-Type", c)) contentType,
fmap
(\ md5 -> ("Content-MD5", Base64.encode $ toBytes md5))
sqContentMd5,
....]
++ sqAmzHeaders ++ sqOtherHeaders,
HTTP.requestBody = case sqMethod of {
PostQuery
-> HTTP.RequestBodyLBS . Blaze.toLazyByteString
$ HTTP.renderQueryBuilder False sqQuery
_ -> case sqBody of {
Nothing -> HTTP.RequestBodyBuilder 0 mempty
Just x -> x } },
HTTP.decompress = HTTP.alwaysDecompress,
HTTP.checkStatus = \ _ _ _ -> Nothing}'
In a stmt of a 'do' block:
return
$ def
{HTTP.method = httpMethod sqMethod,
HTTP.secure = case sqProtocol of {
HTTP -> False
HTTPS -> True },
HTTP.host = sqHost, HTTP.port = sqPort, HTTP.path = sqPath,
HTTP.queryString = HTTP.renderQuery False sqQuery,
HTTP.requestHeaders = catMaybes
[checkDate (\ d -> ("Date", fmtRfc822Time d)) sqDate,
fmap (\ c -> ("Content-Type", c)) contentType,
fmap
(\ md5 -> ("Content-MD5", Base64.encode $ toBytes md5))
sqContentMd5,
....]
++ sqAmzHeaders ++ sqOtherHeaders,
HTTP.requestBody = case sqMethod of {
PostQuery
-> HTTP.RequestBodyLBS . Blaze.toLazyByteString
$ HTTP.renderQueryBuilder False sqQuery
_ -> case sqBody of {
Nothing -> HTTP.RequestBodyBuilder 0 mempty
Just x -> x } },
HTTP.decompress = HTTP.alwaysDecompress,
HTTP.checkStatus = \ _ _ _ -> Nothing}
Failed to install aws-0.9
cabal: Error: some packages failed to install:
aws-0.9 failed during the building phase. The exception was:
ExitFailure 1


Reply to this email directly or view it on GitHubhttps://github.com//issues/101
.

@heath
Copy link
Author

heath commented May 12, 2014

$ ls .hsenv/cabal/lib 
aeson-0.7.0.3              blaze-html-0.7.0.2    conduit-extra-1.1.0.3      crypto-pubkey-0.2.4          http-conduit-2.1.2     pem-0.2.2             streaming-commons-0.1.2.3  x509-system-1.4.5
asn1-encoding-0.8.1.3      blaze-markup-0.6.1.0  connection-0.2.1           crypto-pubkey-types-0.4.2.2  http-types-0.8.4       publicsuffixlist-0.1  system-filepath-0.4.10     x509-validation-1.5.0
asn1-parse-0.8.1           byteable-0.1.1        cookie-0.4.1.1             crypto-random-0.0.7          lifted-base-0.2.2.2    resourcet-1.1.2.2     tls-1.2.6                  xml-conduit-1.2.0.1
asn1-types-0.2.3           cereal-0.4.0.1        cprng-aes-0.5.2            data-default-class-0.0.1     mime-types-0.1.0.4     scientific-0.2.0.2    transformers-base-0.4.2    xml-types-0.3.4
base16-bytestring-0.1.1.6  cipher-aes-0.2.7      crypto-cipher-types-0.0.9  exceptions-0.6               mmorph-1.0.3           securemem-0.1.3       void-0.6.1
base64-bytestring-1.0.0.1  cipher-rc4-0.1.4      cryptohash-0.11.4          http-client-0.3.2.2          monad-control-0.3.3.0  semigroups-0.13.0.1   x509-1.4.11
blaze-builder-0.3.3.2      conduit-1.1.2.1       crypto-numbers-0.2.3       http-client-tls-0.2.1.1      nats-0.1.3             socks-0.5.4           x509-store-1.4.4

@aristidb
Copy link
Owner

OK, I checked http-client/http-conduit and don't see any changes from their
side that should break anything.

Can you please give me the output of the following commands:
ghc-pkg describe 'http_'
ghc-pkg describe 'data-default_'

2014-05-12 18:29 GMT+02:00 Heath Matlock notifications@github.com:

$ ls .hsenv/cabal/lib
aeson-0.7.0.3 blaze-html-0.7.0.2 conduit-extra-1.1.0.3 crypto-pubkey-0.2.4 http-conduit-2.1.2 pem-0.2.2 streaming-commons-0.1.2.3 x509-system-1.4.5
asn1-encoding-0.8.1.3 blaze-markup-0.6.1.0 connection-0.2.1 crypto-pubkey-types-0.4.2.2 http-types-0.8.4 publicsuffixlist-0.1 system-filepath-0.4.10 x509-validation-1.5.0
asn1-parse-0.8.1 byteable-0.1.1 cookie-0.4.1.1 crypto-random-0.0.7 lifted-base-0.2.2.2 resourcet-1.1.2.2 tls-1.2.6 xml-conduit-1.2.0.1
asn1-types-0.2.3 cereal-0.4.0.1 cprng-aes-0.5.2 data-default-class-0.0.1 mime-types-0.1.0.4 scientific-0.2.0.2 transformers-base-0.4.2 xml-types-0.3.4
base16-bytestring-0.1.1.6 cipher-aes-0.2.7 crypto-cipher-types-0.0.9 exceptions-0.6 mmorph-1.0.3 securemem-0.1.3 void-0.6.1
base64-bytestring-1.0.0.1 cipher-rc4-0.1.4 cryptohash-0.11.4 http-client-0.3.2.2 monad-control-0.3.3.0 semigroups-0.13.0.1 x509-1.4.11
blaze-builder-0.3.3.2 conduit-1.1.2.1 crypto-numbers-0.2.3 http-client-tls-0.2.1.1 nats-0.1.3 socks-0.5.4 x509-store-1.4.4


Reply to this email directly or view it on GitHubhttps://github.com//issues/101#issuecomment-42854736
.

@heath
Copy link
Author

heath commented May 14, 2014

[hsenv](d)
# heath at mbp112 in ~/sandbox/cdash-on-haskell on git:master x [14:51:10]
$ ghc-pkg describe "http*"
name: http-conduit
version: 2.1.2
id: http-conduit-2.1.2-4f9274818edfd51537b0183090c0bf50
license: BSD3
copyright:
maintainer: Michael Snoyman <michael@snoyman.com>
stability: Stable
homepage: http://www.yesodweb.com/book/http-conduit
package-url:
synopsis: HTTP client package with conduit interface and HTTPS support.
description: This package uses conduit for parsing the actual contents of the HTTP connection. It also provides higher-level functions which allow you to avoid directly dealing with streaming data. See <http://www.yesodweb.com/book/http-conduit> for more information.
             .
             The @Network.HTTP.Conduit.Browser@ module has been moved to <http://hackage.haskell.org/package/http-conduit-browser/>
category: Web, Conduit
author: Michael Snoyman <michael@snoyman.com>
exposed: True
exposed-modules: Network.HTTP.Conduit Network.HTTP.Client.Conduit
hidden-modules:
trusted: False
import-dirs: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/lib/http-conduit-2.1.2/ghc-7.6.3
library-dirs: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/lib/http-conduit-2.1.2/ghc-7.6.3
hs-libraries: HShttp-conduit-2.1.2
extra-libraries:
extra-ghci-libraries:
include-dirs:
includes:
depends: base-4.6.0.1-8aa5d403c45ea59dcd2c39f123e27d57
         bytestring-0.10.0.2-4f93248f75667c2c3321a7a6761b576f
         conduit-1.1.2.1-de6e16dc98895442c365e0f372534229
         http-client-0.3.2.2-3f03dad0b3546ca278d93c2e12b007f5
         http-client-tls-0.2.1.1-37c18d8565199e2c66ec919dde34ac1b
         http-types-0.8.4-8d8928038e44be2a2e44d2248392f194
         lifted-base-0.2.2.2-03d001a90f7c16220353d0122c49f5d9
         monad-control-0.3.3.0-1766ba8673a3d3b2419b09489a44808a
         mtl-2.1.2-94c72af955e94b8d7b2f359dadd0cb62
         resourcet-1.1.2.2-6205aaa1271e51812fe563e07cd9824a
         transformers-0.3.0.0-ff2bb6ac67241ebb987351a3db564af0
hugs-options:
cc-options:
ld-options:
framework-dirs:
frameworks:
haddock-interfaces: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/share/doc/http-conduit-2.1.2/html/http-conduit.haddock
haddock-html: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/share/doc/http-conduit-2.1.2/html
pkgroot: "/home/heath/sandbox/cdash-on-haskekl/.hsenv"
---
name: http-client-tls
version: 0.2.1.1
id: http-client-tls-0.2.1.1-37c18d8565199e2c66ec919dde34ac1b
license: MIT
copyright:
maintainer: michael@snoyman.com
stability:
homepage: https://github.com/snoyberg/http-client
package-url:
synopsis: http-client backend using the connection package and tls library
description: Intended for use by higher-level libraries, such as http-conduit.
category: Network
author: Michael Snoyman
exposed: True
exposed-modules: Network.HTTP.Client.TLS
hidden-modules:
trusted: False
import-dirs: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/lib/http-client-tls-0.2.1.1/ghc-7.6.3
library-dirs: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/lib/http-client-tls-0.2.1.1/ghc-7.6.3
hs-libraries: HShttp-client-tls-0.2.1.1
extra-libraries:
extra-ghci-libraries:
include-dirs:
includes:
depends: base-4.6.0.1-8aa5d403c45ea59dcd2c39f123e27d57
         bytestring-0.10.0.2-4f93248f75667c2c3321a7a6761b576f
         connection-0.2.1-3cc8bcef269d8621a10edfd19366e2a3
         data-default-class-0.0.1-28917cfaaa79950ce0c5af98dd8bce64
         http-client-0.3.2.2-3f03dad0b3546ca278d93c2e12b007f5
         network-2.4.1.2-040cee5ece44014a8574cb3f87b1eec4
         tls-1.2.6-8defeb6fbbedc55ff538c65cda2073d5
hugs-options:
cc-options:
ld-options:
framework-dirs:
frameworks:
haddock-interfaces: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/share/doc/http-client-tls-0.2.1.1/html/http-client-tls.haddock
haddock-html: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/share/doc/http-client-tls-0.2.1.1/html
pkgroot: "/home/heath/sandbox/cdash-on-haskekl/.hsenv"
---
name: http-client
version: 0.3.2.2
id: http-client-0.3.2.2-3f03dad0b3546ca278d93c2e12b007f5
license: MIT
copyright:
maintainer: michael@snoyman.com
stability:
homepage: https://github.com/snoyberg/http-client
package-url:
synopsis: An HTTP client engine, intended as a base layer for more user-friendly packages.
description: This codebase has been refactored from http-conduit.
category: Network
author: Michael Snoyman
exposed: True
exposed-modules: Network.HTTP.Client
                 Network.HTTP.Client.MultipartFormData Network.HTTP.Client.Internal
hidden-modules: Network.HTTP.Client.Body
                Network.HTTP.Client.Connection Network.HTTP.Client.Cookies
                Network.HTTP.Client.Core Network.HTTP.Client.Headers
                Network.HTTP.Client.Manager Network.HTTP.Client.Request
                Network.HTTP.Client.Response Network.HTTP.Client.Types
                Network.HTTP.Client.Util
trusted: False
import-dirs: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/lib/http-client-0.3.2.2/ghc-7.6.3
library-dirs: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/lib/http-client-0.3.2.2/ghc-7.6.3
hs-libraries: HShttp-client-0.3.2.2
extra-libraries:
extra-ghci-libraries:
include-dirs:
includes:
depends: array-0.4.0.1-3b78425c10ff2dad7acf7e8c8ae014c3
         base-4.6.0.1-8aa5d403c45ea59dcd2c39f123e27d57
         base64-bytestring-1.0.0.1-d8518e3d0a93ad469732bf212a97fcd8
         blaze-builder-0.3.3.2-218a42248e93dd9cae8208aaf882209a
         bytestring-0.10.0.2-4f93248f75667c2c3321a7a6761b576f
         case-insensitive-1.1.0.2-a9cc5f442974fbc90a16d92ae924d579
         containers-0.5.0.0-ab1dae9a94cd3cc84e7b2805636ebfa2
         cookie-0.4.1.1-4d13f4757a934897a817df3ed5b2924f
         data-default-class-0.0.1-28917cfaaa79950ce0c5af98dd8bce64
         deepseq-1.3.0.1-5cc4cd89bdc2e8f6db1833d95ec36926
         exceptions-0.6-ec669afaaaeb847b457fb96fb56bdb8b
         filepath-1.3.0.1-b12cbe18566fe1532a1fda4c85e31cbe
         http-types-0.8.4-8d8928038e44be2a2e44d2248392f194
         mime-types-0.1.0.4-f1be0ca62e0571b56239859506ee08d3
         network-2.4.1.2-040cee5ece44014a8574cb3f87b1eec4
         publicsuffixlist-0.1-b27f5dd856d7f4303d26fdc4a269c71c
         random-1.0.1.1-43fdc5da991685d8a0ec8cb553880cf8
         streaming-commons-0.1.2.3-d83dfabb6e022cd2c2d67d42aaa7e29c
         text-0.11.3.1-e38859e86485c167fa7c9441789e7607
         time-1.4.0.1-10dc4804a19dc0000fab79908f1a9f50
         transformers-0.3.0.0-ff2bb6ac67241ebb987351a3db564af0
hugs-options:
cc-options:
ld-options:
framework-dirs:
frameworks:
haddock-interfaces: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/share/doc/http-client-0.3.2.2/html/http-client.haddock
haddock-html: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/share/doc/http-client-0.3.2.2/html
pkgroot: "/home/heath/sandbox/cdash-on-haskekl/.hsenv"
---
name: http-types
version: 0.8.4
id: http-types-0.8.4-8d8928038e44be2a2e44d2248392f194
license: BSD3
copyright: (C) 2011 Aristid Breitkreuz
maintainer: aristidb@googlemail.com
stability:
homepage: https://github.com/aristidb/http-types
package-url:
synopsis: Generic HTTP types for Haskell (for both client and server code).
description: Generic HTTP types for Haskell (for both client and server code).
category: Network, Web
author: Aristid Breitkreuz, Michael Snoyman
exposed: True
exposed-modules: Network.HTTP.Types Network.HTTP.Types.Header
                 Network.HTTP.Types.Method Network.HTTP.Types.QueryLike
                 Network.HTTP.Types.Status Network.HTTP.Types.URI
                 Network.HTTP.Types.Version
hidden-modules:
trusted: False
import-dirs: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/lib/http-types-0.8.4/ghc-7.6.3
library-dirs: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/lib/http-types-0.8.4/ghc-7.6.3
hs-libraries: HShttp-types-0.8.4
extra-libraries:
extra-ghci-libraries:
include-dirs:
includes:
depends: array-0.4.0.1-3b78425c10ff2dad7acf7e8c8ae014c3
         base-4.6.0.1-8aa5d403c45ea59dcd2c39f123e27d57
         blaze-builder-0.3.3.2-218a42248e93dd9cae8208aaf882209a
         bytestring-0.10.0.2-4f93248f75667c2c3321a7a6761b576f
         case-insensitive-1.1.0.2-a9cc5f442974fbc90a16d92ae924d579
         text-0.11.3.1-e38859e86485c167fa7c9441789e7607
hugs-options:
cc-options:
ld-options:
framework-dirs:
frameworks:
haddock-interfaces: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/share/doc/http-types-0.8.4/html/http-types.haddock
haddock-html: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/share/doc/http-types-0.8.4/html
pkgroot: "/home/heath/sandbox/cdash-on-haskekl/.hsenv"

[hsenv](d)
# heath at mbp112 in ~/sandbox/cdash-on-haskell on git:master x [14:51:46]
$ ghc-pkg describe "data-default*"
name: data-default-class
version: 0.0.1
id: data-default-class-0.0.1-28917cfaaa79950ce0c5af98dd8bce64
license: BSD3
copyright:
maintainer: <l.mai@web.de>
stability:
homepage:
package-url:
synopsis: A class for types with a default value
description:
category: Data
author: Lukas Mai
exposed: True
exposed-modules: Data.Default.Class
hidden-modules:
trusted: False
import-dirs: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/lib/data-default-class-0.0.1/ghc-7.6.3
library-dirs: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/lib/data-default-class-0.0.1/ghc-7.6.3
hs-libraries: HSdata-default-class-0.0.1
extra-libraries:
extra-ghci-libraries:
include-dirs:
includes:
depends: base-4.6.0.1-8aa5d403c45ea59dcd2c39f123e27d57
hugs-options:
cc-options:
ld-options:
framework-dirs:
frameworks:
haddock-interfaces: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/share/doc/data-default-class-0.0.1/html/data-default-class.haddock
haddock-html: /home/heath/sandbox/cdash-on-haskekl/.hsenv/cabal/share/doc/data-default-class-0.0.1/html
pkgroot: "/home/heath/sandbox/cdash-on-haskekl/.hsenv"

[hsenv](d)
# heath at mbp112 in ~/sandbox/cdash-on-haskekl on git:master x [14:51:56]
$ 

@aristidb
Copy link
Owner

Thanks. I'm a little bit at a loss what might be wrong. The only thing I
can think of right now is ghc-pkg check. I'm pretty sure Request is
supposed to have an instance of Default...

Maybe it is more efficient to ask people on #haskell or so? It's a bit
inefficient to do this in a Github back-and-forth and I don't really have
much time to help you right now, I'm afraid...

@ghost
Copy link

ghost commented Sep 23, 2014

I had this problem too. Changing the Build-depends in aws.cabal from

data-default         == 0.5.*,

to

data-default         >= 0.5.3,

fixed it for me. (Thanks to Michael Snoyman on Stackoverflow.)

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

No branches or pull requests

2 participants