Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.
This repository was archived by the owner on Oct 19, 2024. It is now read-only.

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

@4eUeP

Description

@4eUeP

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions