Giter VIP home page Giter VIP logo

Comments (8)

bojand avatar bojand commented on August 12, 2024 1

There seems to be U+FEFF, which can be problematic it seems, at the start of the file. Removing it fixes the problem.

$ bat /Users/bojand/Downloads/GHZtest/grpc-proto/src/proto/common/si.proto
───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: /Users/bojand/Downloads/GHZtest/grpc-proto/src/proto/common/si.proto
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ <U+FEFF>syntax = "proto3";
   2   │
   3   │ package proto.common;
   4   │
   5   │ option java_multiple_files = true;
   6   │ option objc_class_prefix = "AAA";
   7   │
   8   │
   9   │ message SI {
  10   │     message TAndM {
  11   │         string t = 1;
  12   │         string m = 2;
  13   │     }
  14   │
  15   │     oneof spec {
  16   │         int64               secur_id             = 1;
  17   │         TAndM                   t_m                      = 2;
  18   │     }
  19   │ }
───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Also the output argument should specify the actual file and not just a directory.

from ghz.

bojand avatar bojand commented on August 12, 2024

Hello, unfortunately I do no have Windows or easy access to test on that platform so can't really reproduce if there is an issue related to usage of that OS specifically. However a few things:

message E {
  in32 id = 1;
  string name = 2;
}

There is a typo there. Type of id should be int32 instead of in32

The config file specifies the proto as

C:/Users/1/Desktop/GHZ/protorepo/sr.proto

But you say all proto files are in C:\Users\1\Desktop\GHZ\protorepo\grpc-proto\src\proto\common while the imports are "proto/common... and i is "C:/Users/1/Desktop/GHZ/protorepo/grpc-proto/src/". This all is somewhat contradictory and confusing...

Based on the main sr.proto file is at C:/Users/1/Desktop/GHZ/protorepo/sr.proto and the contents of it it seems you should have something like:

sr.proto
|-- proto/common/
     |-- e.proto
     |-- si.proto

We will automatically add the proto file path's directory in import paths, your import paths should just include the location of empty.proto which should be wherever protoc is installed.

Finally, you include si.proto but that proto file doesn't define any messages or calls, so it seems completely redundant.

Hope all of this helps.

from ghz.

BesSlaaneshi avatar BesSlaaneshi commented on August 12, 2024

sorry, i updated first message to fix typo.
i deleted some info from proto files because they are big.
si.proto - have messages, i just delete them while write this issue because GEinfo dont need the file si.proto and the problem not in message.
but another messages in sr.proto - need it. (i just didnt write it here)
at least the problem is exactly with si.proto referee to error text message.

and import are correctly. i have content somethink like this:
sr.proto

|-- protorepo
    |-- sr.proto
    |-- grpc-proto
        |-- src
            |-- proto
                 |-- common
                      |-- e.proto
                      |-- empty.proto
                      |-- si.proto

also e.proto is correctly imported with no error. because the error exactly in si.proto
and with "i" no problem because ghz find proto files correctly. Just protoc gives error that means that he cant parse si.proto. or i dont know -_-
for the test i add "syntax error" in e.proto in line 3 symbol 5
and when i start ghz - i get error failed to load imports for "e.proto": proto/common/e.proto:3:5: syntax error
also error means si.proto:1:1: - that's means first line first symbol?

also we try this on linux, but the problem are same.
and our programmers can compile proto files with no errors in protoc. They are correct and work good.

from ghz.

bojand avatar bojand commented on August 12, 2024

Hello, it would be very useful if you could provide a full reproducible example with all the code for all relevant proto files and the structure of folders and ghz parameters. You can just place dummy / simple, but valid, messages that's similar to your usage. I am having a hard time under standing the structure and relationship of all the protos from all the information above.

from ghz.

BesSlaaneshi avatar BesSlaaneshi commented on August 12, 2024

Hello. I make example files for you to reproduce my error.
So, i start ghz with command ghz -config .\configtestsr.json
And get error.
failed to load imports for "sr.proto": proto/common/si.proto:1:1: syntax error: unexpected $unk
GHZtest.zip

from ghz.

BesSlaaneshi avatar BesSlaaneshi commented on August 12, 2024

Also. It worked with protoset.
But still can't make it with path to .proto

from ghz.

bojand avatar bojand commented on August 12, 2024

Hello, thanks for including the data. Sorry I have not had the time to look into this deeper, but will try to do so soon. Protoset is certainly an option as a workaround if that works for you.

from ghz.

LoremipsumSharp avatar LoremipsumSharp commented on August 12, 2024

In Windows OS,try using dos2unix to convert to proto file,it works for me!

from ghz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.