ProtoBuf.jl icon indicating copy to clipboard operation
ProtoBuf.jl copied to clipboard

Code generation error

Open rssdev10 opened this issue 3 years ago • 1 comments

Getting issue with code generation for https://github.com/milvus-io/milvus-proto

using ProtoBuf
ProtoBuf.protoc(`-I=proto --julia_out=jlout proto/milvus.proto`)
ERROR: unresolved name milvus.proto.common.Status at scope 
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] qualify_in_hierarchy(name::String, scope::ProtoBuf.Gen.Scope)
    @ ProtoBuf.Gen ~/.julia/dev/ProtoBuf/src/gen.jl:158
  [3] qualify_in_hierarchy(name::String, scope::ProtoBuf.Gen.Scope) (repeats 3 times)
    @ ProtoBuf.Gen ~/.julia/dev/ProtoBuf/src/gen.jl:156
  [4] scoped_svc_type_name(scope::ProtoBuf.Gen.Scope, typ_name::String)
    @ ProtoBuf.Gen ~/.julia/dev/ProtoBuf/src/gen.jl:613
  [5] generate_svc(io::IOBuffer, errio::IOBuffer, stype::ProtoBuf.GoogleProtoBuf.ServiceDescriptorProto, scope::ProtoBuf.Gen.Scope, svcidx::Int64, exports::Vector{String})
    @ ProtoBuf.Gen ~/.julia/dev/ProtoBuf/src/gen.jl:630
  [6] generate_file(io::IOBuffer, errio::IOBuffer, protofile::ProtoBuf.GoogleProtoBuf.FileDescriptorProto)
    @ ProtoBuf.Gen ~/.julia/dev/ProtoBuf/src/gen.jl:775
  [7] codegen(srcio::Base.PipeEndpoint)
    @ ProtoBuf.Gen ~/.julia/dev/ProtoBuf/src/gen.jl:863
  [8] (::ProtoBuf.Gen.var"#21#22")()
    @ ProtoBuf.Gen ~/.julia/dev/ProtoBuf/src/gen.jl:916
  [9] with_debug
    @ ~/.julia/dev/ProtoBuf/src/gen.jl:899 [inlined]
 [10] gen()
    @ ProtoBuf.Gen ~/.julia/dev/ProtoBuf/src/gen.jl:914
 [11] top-level scope
    @ none:1
--julia_out: protoc-gen-julia: Plugin failed with status code 1.

The Status is actually present inside internally included file common.proto

Code generation for common.proto and schema.proto works without issues.

rssdev10 avatar Jul 01 '22 01:07 rssdev10

I had the same problem, hope to repair this. @tanmaykm

zsz00 avatar Aug 08 '22 10:08 zsz00

Similar, https://github.com/JuliaIO/ProtoBuf.jl/issues/137, the good news is that ProtoBuf.jl 1.0 should be able to resolve the issue you are having, but there is currently no support for Services and RPCs. This will be tracked in a separate issue. Closing for now.

Drvi avatar Aug 18 '22 09:08 Drvi