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

Quasi.GRpc fails to parse float in protobuf file #336

Open
4eUeP opened this issue Jul 12, 2022 · 1 comment
Open

Quasi.GRpc fails to parse float in protobuf file #336

4eUeP opened this issue Jul 12, 2022 · 1 comment

Comments

@4eUeP
Copy link

4eUeP commented Jul 12, 2022

Hi, I'm trying to include this library into grpc_bench. However, it doesn't compile. The reason seems to be a float field in the proto file. (It seems that language-protobuf doesn't support the float field)

Reproduce

-- test.hs
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}

module Main where

import Mu.Quasi.GRpc

grpc "Hello" id "test.proto"

main :: IO ()
main = undefined
// test.proto
syntax = "proto3";

message msg {
  float xx = 1;
}
cabal repl mu-protobuf
> :load test.hs

<no location info>: warning: [-Wmissing-home-modules]
    These modules are needed for compilation but not listed in your .cabal file's other-modules: 
        Mu.Adapter.ProtoBuf Mu.Quasi.GRpc Mu.Quasi.ProtoBuf
[1 of 4] Compiling Mu.Adapter.ProtoBuf ( src/Mu/Adapter/ProtoBuf.hs, interpreted )
[2 of 4] Compiling Mu.Quasi.ProtoBuf ( src/Mu/Quasi/ProtoBuf.hs, interpreted )
[3 of 4] Compiling Mu.Quasi.GRpc    ( src/Mu/Quasi/GRpc.hs, interpreted )
[4 of 4] Compiling Main             ( test.hs, interpreted )

test.hs:1:1: error:
    Exception when trying to run compile-time code:
      this should never happen
CallStack (from HasCallStack):
  error, called at src/Mu/Quasi/ProtoBuf.hs:72:27 in mu-protobuf-0.4.2.0-inplace:Mu.Quasi.ProtoBuf
    Code: grpc "Hello" id "test.proto"
  |
1 | {-# LANGUAGE TemplateHaskell #-}
  | ^
Failed, three modules loaded.
@fintara
Copy link

fintara commented Sep 11, 2023

I've hit the same, thanks for submitting this issue 😅

It would be nice (apart from supporting float) to improve the "this should never happen" error and mention that this type is not supported.

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