protocolbuffers / protobuf

Protocol Buffers - Google's data interchange format
http://protobuf.dev
Other
65.92k stars 15.53k forks source link

descriptor.proto using not official syntax #16943

Open oldergod opened 6 months ago

oldergod commented 6 months ago

Hello, a change has been done to descriptor.proto recently defining declarations on extensions

https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto#L1074-L1091

  extensions 1000 to 9994 [
    declaration = {
      number: 1000,
      full_name: ".pb.cpp",
      type: ".pb.CppFeatures"
    },

The doc doesn't have any info about it here https://protobuf.dev/reference/protobuf/proto2-spec/#extensions_and_reserved

extensions = "extensions" ranges ";"
ranges = range { "," range }
range =  intLit [ "to" ( intLit | "max" ) ]
zhangskz commented 6 months ago

This reserves the extension number 1000 exclusively for cpp features, and errors if the extension number is used for a different extension.

Looks like we do have this documented in https://protobuf.dev/programming-guides/extension_declarations/ but should probably consolidate or link from https://protobuf.dev/reference/protobuf/proto2-spec/#extensions_and_reserved? @Logofile Could you take a look?

IIRC we haven't fully open-sourced extension declarations for custom options yet, since we need to add a way for users to pass this to protoc in OSS. (@shaod2 is working on this, but is out for a bit)

Logofile commented 6 months ago

Thanks for raising this issue. I'll work on getting the docs current.

github-actions[bot] commented 3 months ago

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago. This issue will be closed and archived after 14 additional days without activity.

github-actions[bot] commented 6 days ago

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago. This issue will be closed and archived after 14 additional days without activity.