awakesecurity / proto3-suite

Haskell Protobuf Implementation
https://hackage.haskell.org/package/proto3-suite
Other
81 stars 56 forks source link

cabal test fails #240

Closed fumieval closed 4 months ago

fumieval commented 1 year ago

I got the following errors (with flags: -dhall -large-records)

fumieval@GTPC21032 proto3-suite % cabal test                   
Build profile: -w ghc-9.2.5 -O1
In order, the following will be built (use -v for more details):
 - proto3-suite-0.6.0 (test:tests) (first run)
Preprocessing test suite 'tests' for proto3-suite-0.6.0..
Building test suite 'tests' for proto3-suite-0.6.0..
[ 6 of 13] Compiling TestProto        ( gen/TestProto.hs, /Users/fumieval/herp/hs/proto3-suite/dist-newstyle/build/aarch64-osx/ghc-9.2.5/proto3-suite-0.6.0/t/tests/build/tests/tests-tmp/TestProto.o )

gen/TestProto.hs:175:34: error:
    Ambiguous occurrence ‘HsProtobuf.String’
    It could refer to
       either ‘HsProtobuf.String’,
              imported qualified from ‘Proto3.Suite.DotProto’ at gen/TestProto.hs:16:1-52
              (and originally defined in ‘Proto3.Suite.DotProto.AST’)
           or ‘HsProtobuf.String’,
              imported qualified from ‘Proto3.Suite.Types’ at gen/TestProto.hs:19:1-49
    |
175 |                 (HsProtobuf.Prim HsProtobuf.String)
    |                                  ^^^^^^^^^^^^^^^^^

gen/TestProto.hs:566:34: error:
    Ambiguous occurrence ‘HsProtobuf.String’
    It could refer to
       either ‘HsProtobuf.String’,
              imported qualified from ‘Proto3.Suite.DotProto’ at gen/TestProto.hs:16:1-52
              (and originally defined in ‘Proto3.Suite.DotProto.AST’)
           or ‘HsProtobuf.String’,
              imported qualified from ‘Proto3.Suite.Types’ at gen/TestProto.hs:19:1-49
    |
566 |                 (HsProtobuf.Prim HsProtobuf.String)
    |                                  ^^^^^^^^^^^^^^^^^
riz0id commented 4 months ago

@fumieval we plan on not supporting large-records going forward since it doesn't seem to provide any benefit and is creating backwards compatibility issues. I'm going to close this issue. Feel free to re-open if you feel like there is still a problem that needs to be addressed.

j6carey commented 4 months ago

Please note the comments by @riz0id above about long term issues. As to the short term: thanks to recent fixes, nix-build does work at the current HEAD of master with both dhall and large-records enabled and GHC 9.2.8 or 9.0.2:

$ git rev-parse HEAD
bec9d40e2767143deed5b2d451197191f1d8c7d5
$ nix-build --argstr compiler ghc902 --arg enableDhall true --arg enableSwagger false --arg enableLargeRecords true
/nix/store/cg7y9bga64mdcv0mxd6l2bf4ivf3l73b-proto3-suite-base-0.8.0
/nix/store/ksz1ssjhlkq603631zbmxn45x06mw7kj-proto3-suite-base-0.8.0
$ nix-build --argstr compiler ghc928 --arg enableDhall true --arg enableSwagger false --arg enableLargeRecords true
/nix/store/11pg1cyj9vzv4grphr98xv3wyrc9b3sf-proto3-suite-base-0.8.0
/nix/store/7f90pkqlkxgms2yj8d4qy65nidcb1y8z-proto3-suite-base-0.8.0

That said, there are some problems with the current nix-shell environment when using GHC 9.2.8 or 9.0.2. For interactive development in a nix-shell environment you might have better luck with GHC 9.4.8 or later, though probably there's a way to jailbreak or otherwise modify the dependencies of the interactive environment in order to make them build with GHC 9.2.*.