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

Error when parsing packages without an explicit package name #27

Closed
mathsaey opened this issue Feb 22, 2018 · 0 comments
Closed

Error when parsing packages without an explicit package name #27

mathsaey opened this issue Feb 22, 2018 · 0 comments

Comments

@mathsaey
Copy link

The following proto file, fails to compile for me:

syntax = "proto3";

message Test {
    string tst = 1;
}

It returns the following error:

** (FunctionClauseError) no function clause matching in String.split/3

    The following arguments were given to String.split/3:

        # 1
        nil

        # 2
        "."

        # 3
        []

    (elixir) lib/string.ex:383: String.split/3
    lib/protobuf/protoc/generator/util.ex:33: Protobuf.Protoc.Generator.Util.normalize_pkg_name/1
    lib/protobuf/protoc/generator/util.ex:11: Protobuf.Protoc.Generator.Util.attach_pkg/2
    lib/protobuf/protoc/generator/message.ex:22: Protobuf.Protoc.Generator.Message.parse_desc/2
    lib/protobuf/protoc/generator/message.ex:11: Protobuf.Protoc.Generator.Message.generate/2
    (elixir) lib/enum.ex:1294: Enum."-map/2-lists^map/1-0-"/2
    lib/protobuf/protoc/generator.ex:24: Protobuf.Protoc.Generator.generate_content/2
    lib/protobuf/protoc/generator.ex:11: Protobuf.Protoc.Generator.generate/2
--elixir_out: protoc-gen-elixir: Plugin failed with status code 1.

Adding package test; to the proto file fixes the problem.
However, since the --ccp_out generator seems to accept the original proto file, I don't think this behaviour is intended.

I don't have a lot of experience with protocol buffers, so forgive me if I'm doing something incredibly wrong here :).

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