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

Compilation failure on stackage for autodocodec-schema & autodocodec-openapi3 - caused by autodocodec-0.3.0.0 #49

Closed
alaendle opened this issue Jul 20, 2024 · 6 comments

Comments

@alaendle
Copy link

Unfortunately I couldn't explain what causes the issue ... I'll disable the packages on stackage as a temporary solution (to not block further nightly builds).

autodocodec-schema-0.1.0.4-351f2eba904cbec211fba1e444b111ecb19e7907dc1e2932b03ba314cb337a32/src/Autodocodec/Schema.hs:380:77: error: [GHC-10283]
           • Could not deduce ‘Coercible output0 input1’
               arising from a use of ‘OptionalKeyWithDefaultCodec’
             from the context: (Eq value, Coercible input1 value,
                                Coercible output1 value)
               bound by a pattern with constructor:
                          OptionalKeyWithOmittedDefaultCodec :: forall value input output.
                                                                (Eq value, Coercible input value,
                                                                 Coercible output value) =>
                                                                Text
                                                                -> ValueCodec value value
                                                                -> value
                                                                -> Maybe Text
                                                                -> Codec
                                                                     (Data.Aeson.KeyMap.KeyMap JSON.Value)
                                                                     input
                                                                     output,
                        in a \case alternative
               at src/Autodocodec/Schema.hs:380:7-62
             ‘input1’ is a rigid type variable bound by
               the type signature for:
                 goObject :: forall input1 output1.
                             ObjectCodec input1 output1 -> State (Set Text) ObjectSchema
               at src/Autodocodec/Schema.hs:369:5-73
           • In the first argument of ‘goObject’, namely
               ‘(OptionalKeyWithDefaultCodec k c defaultValue mDoc)’
             In the expression:
               goObject (OptionalKeyWithDefaultCodec k c defaultValue mDoc)
             In a \case alternative:
                 OptionalKeyWithOmittedDefaultCodec k c defaultValue mDoc
                   -> goObject (OptionalKeyWithDefaultCodec k c defaultValue mDoc)
           • Relevant bindings include
               goObject :: ObjectCodec input1 output1
                           -> State (Set Text) ObjectSchema
                 (bound at src/Autodocodec/Schema.hs:370:5)
           |
       380 |       OptionalKeyWithOmittedDefaultCodec k c defaultValue mDoc -> goObject (OptionalKeyWithDefaultCodec k c defaultValue mDoc)
           | 

and basically the same error in the other package

autodocodec-openapi3-0.2.1.1-edfda14b60bbc6f518fbecabca7fee31ec662623d0669d1f13ccbcf9d75536f4/src/Autodocodec/OpenAPI/Schema.hs:176:80: error: [GHC-10283]
           • Could not deduce ‘Coercible output0 input’                                                                                                                                                                         arising from a use of ‘OptionalKeyWithDefaultCodec’                                                                                                                                                            from the context: (Eq value1, Coercible input value1,
                                Coercible output value1)                                                                                                                                                                        bound by a pattern with constructor:                                                                                                                                                                                        OptionalKeyWithOmittedDefaultCodec :: forall value input output.
                                                                (Eq value, Coercible input value,                                                                                                                                                                                 Coercible output value) =>                                                                                                                                                                                      Text
                                                                -> ValueCodec value value                                                                                                                                                                                        -> value                                                                                                                                                                                                         -> Maybe Text
                                                                -> Codec                                                                                                                                                                                                              (Data.Aeson.KeyMap.KeyMap Aeson.Value)                                                                                                                                                                           input
                                                                     output,                                                                                                                                                             in a \case alternative                                                                                                                                                                                  at src/Autodocodec/OpenAPI/Schema.hs:176:7-65
             ‘input’ is a rigid type variable bound by                                                                                                                                                                          the type signature for:                                                                                                                                                                                            goObject :: forall input output.
                             ObjectCodec input output                                                                                                                                                                                         -> StateT                                                                                                                                                                                                             (HashMap Text Schema) (Declare (Definitions Schema)) [Schema]
               at src/Autodocodec/OpenAPI/Schema.hs:145:5-112                                                                                                                                                               • In the first argument of ‘goObject’, namely                                                                                                                                                                        ‘(OptionalKeyWithDefaultCodec key vs defaultValue mDoc)’
             In the expression:                                                                                                                                                                                                 goObject (OptionalKeyWithDefaultCodec key vs defaultValue mDoc)                                                                                                                                                In a \case alternative:
                 OptionalKeyWithOmittedDefaultCodec key vs defaultValue mDoc                                                                                                                                                        -> goObject (OptionalKeyWithDefaultCodec key vs defaultValue mDoc)                                                                                                                                       • Relevant bindings include
               goObject :: ObjectCodec input output                                                                                                                                                                                         -> StateT                                                                                                                                                                                                             (HashMap Text Schema) (Declare (Definitions Schema)) [Schema]
                 (bound at src/Autodocodec/OpenAPI/Schema.hs:146:5)
           |                                                                                                                                                                                                            176 |       OptionalKeyWithOmittedDefaultCodec key vs defaultValue mDoc -> goObject (OptionalKeyWithDefaultCodec key vs defaultValue mDoc)                                                                           |   
alaendle added a commit to commercialhaskell/stackage that referenced this issue Jul 20, 2024
@alaendle alaendle changed the title Rather strange compilation failure on stackage for autodocodec-schema & autodocodec-openapi3 Compilation failure on stackage for autodocodec-schema & autodocodec-openapi3 - caused by autodocodec-0.3.0.0 Jul 20, 2024
@alaendle
Copy link
Author

Not really strange - autodocodec-0.3.0.0 seems to cause this.

@NorfairKing
Copy link
Owner

@alaendle I can't reproduce this locally. These "just" compile fine on my machine.

@alaendle
Copy link
Author

I've successively reproduced the problem using the verify-package script. Alternatively just try to compile your package with stack using the latest nightly snapshot. Please let me know if you are still unable to reproduce this.
If I remember correctly I could build using nightly-2024-07-19, but no longer with nightly-2024-07-20 - so my suspicion that this has to do with autodocodec-0.3.0.0 - since only little other packages have changed (https://www.stackage.org/diff/nightly-2024-07-19/nightly-2024-07-20).

@NorfairKing
Copy link
Owner

@alaendle Aha I just figured out what happened. Fix incoming soon.

@NorfairKing
Copy link
Owner

@alaendle Fixed with autodocodec-schema-0.1.0.5, autodocodec-yaml-0.3.0.1, autodocodec-swagger2-0.0.1.2, autodocodec-openapi3-0.2.1.2, and autodocodec-servant-multipart-0.0.0.1.

@alaendle
Copy link
Author

Many thanks @NorfairKing for your quick action!

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