Skip to content

imports don't appear to work #3

@commandodev

Description

@commandodev

I can't refer between proto files with imports:

// message.proto
message Msg {
  required string name = 1;
  extensions 100 to 199;
}

extend Msg {
  optional bool sameFile = 105;
}

// extension.proto
import "message.proto";


message Test {
  required Msg msg = 1;
}

extend Msg {
    optional string extn = 101;
}

running hprotoc -d hs *.proto gives:

Loading filepath: "/home/.../tst/extension.proto"
Loading filepath: "/home/.../tst/message.proto"
hprotoc: user error (Parsing proto:
"extension.proto"
has failed with message
Text.ProtocolBuffers.ProtoCompile.Resolve annErr: fqFileDP FileDescriptorProto (name,package) is (Just "extension.proto",Nothing)
  Text.ProtocolBuffers.ProtoCompile.Resolve annErr: fqMessage DescriptorProto name is Just "Test"
    Text.ProtocolBuffers.ProtoCompile.Resolve annErr: fqField FieldDescriptorProto name is Just "msg"
      Text.ProtocolBuffers.ProtoCompile.Resolve fatal error encountered, message:
        resolvePredEnv: Could not lookup "Msg"
        which parses as (False,[IName "Msg"])
        in environment: .Extension.Test in "extension.proto"
        looking for: Message or Group or Enum
        allowed (local):  [([IName "Extension",IName "Test"],[IName "msg"])]
        allowed (global): [(PackageID {getPackageID = [IName "Extension"]},[IName "Test",IName "extn"]),(PackageID {getPackageID = [IName "Message"]},[IName "Msg",IName "sameFile"])]

)

It works fine with protoc and running hprotoc -d hs message.proto also works as expected.

Appolgies if this isn't the right place to post bug (or if it's user error!)

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