JuliaIO / ProtoBuf.jl

Julia protobuf implementation
Other
205 stars 55 forks source link

"service" doesn't get generated #165

Closed mkschulze closed 3 years ago

mkschulze commented 3 years ago

Hello,

we are trying to generate these .proto files here.

It seems to work fine in general, but there is one file that doesn't get generated. It holds a so called "service" statement here:

It's the file grakn.proto

syntax = "proto3";

option java_package = "grakn.protocol";
option java_outer_classname = "GraknProto";

import "database.proto";
import "session.proto";
import "transaction.proto";

package grakn.protocol;

service Grakn {

    rpc database_contains (Database.Contains.Req) returns (Database.Contains.Res);
    rpc database_create (Database.Create.Req) returns (Database.Create.Res);
    rpc database_all (Database.All.Req) returns (Database.All.Res);
    rpc database_delete (Database.Delete.Req) returns (Database.Delete.Res);

    rpc session_open (Session.Open.Req) returns (Session.Open.Res);
    rpc session_close (Session.Close.Req) returns (Session.Close.Res);

    // Checks with the server that the session is still alive, and informs it that it should be kept alive.
    rpc session_pulse (Session.Pulse.Req) returns (Session.Pulse.Res);

    // Opens a bi-directional stream representing a stateful transaction, streaming
    // requests and responses back-and-forth. The first request message must
    // be {Transaction.Open.Req}. Closing the stream closes the transaction.
    rpc transaction (stream Transaction.Req) returns (stream Transaction.Res);

}

Would be great to see this also generated somehow.

Thanks for consideration. Referencing our issue here #https://github.com/Humans-of-Julia/GraknClient.jl/issues/20

mkschulze commented 3 years ago

It seems like a common type of issue:

we experienced an identical issue when trying to compile protobuf for client-nodejs. We were using a tool named protoc from the grpc-tools npm package, which had an optional flag that enabled creation of the service method definitions. Why on earth such a thing would be optional, well... who knows. But maybe the tool you use to compile protobuf into a Julia library has the same flag.

@tanmaykm do we have such a flag as well here?

mkschulze commented 3 years ago

Has been solved by reading the instructions carefully and adding this to the mentioned file: option java_generic_services = true;