4

Where is the (meta) .proto file which describes .desc files?

I make .desc files with:

protoc --descriptor_set_out=foo.desc --include_imports foo.proto

Am I correct in believing that the .desc files are in protobuf format?

If so, where can I get the .proto file which describes their format?

fadedbee
  • 42,671
  • 44
  • 178
  • 308

3 Answers3

5

The format is FileDescriptorSet as defined in descriptor.proto:

https://code.google.com/p/protobuf/source/browse/trunk/src/google/protobuf/descriptor.proto

descriptor.proto is typically installed to /usr/include/descriptor.proto or /usr/local/include/descriptor.proto on Unix systems. descriptor.pb.h is installed with the protobuf headers and descriptor.pb.cc is compiled into the protobuf library, so you don't have to generate them yourself if you are using C++. Similarly, in Java, the com.google.protobuf.DescriptorProtos class is compiled into the base library.

Kenton Varda
  • 41,353
  • 8
  • 121
  • 105
  • It got moved to GitHub here: https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/descriptor.proto – Collin Krawll Apr 16 '20 at 21:47
2

If you install protocol buffers, the definition is in

   <PB install directory>/src/google/protobuf/descriptor.proto

Some/Most of the Instalation processes (e.g. Java) will "Generate" pb classes from this definition.

As keton said it is also available at

https://code.google.com/p/protobuf/source/browse/trunk/src/google/protobuf/descriptor.proto

Bruce Martin
  • 10,358
  • 1
  • 27
  • 38
0

Presumably, it should be in the reference documentation, here:

https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.descriptor.pb#FileDescriptorSet

Sebastian Redl
  • 69,373
  • 8
  • 123
  • 157