There were three changes in the final v27.0 that were not previously implemented in this compiler:
A new feature_support field on EnumValueOptions to allow defining the lifetime of a feature value. This is similar to the field of the same name and type on FieldOptions, but it controls the actual enum values and in which editions they are valid. (This resolves https://github.com/protocolbuffers/protobuf/issues/16369#issuecomment-2096547617.)
Unfortunately, this one isn't quite part of this PR because this configuration is not actually in the descriptorpb package. Why not? Because extension declarations are defined as source-only options, which means they aren't preserved at runtime, which means they are not present in the embedded descriptor in the latest descriptorpb package. I will address this in a subsequent PR by making the sources for these files available to compiler users. It will need to be in a separate package that so it doesn't get linked into user programs by default. For example, the buf CLI won't need it because it has its own mechanism of supplying the sources for these files.
This PR updates to use the latest (final) v27.0 release and also updates the protobuf-go dependency to include the v27.0 version of the descriptorpb package (first two commits). It then implements the same checks as the first two bullets mentioned above, each in its own commit.
There were three changes in the final v27.0 that were not previously implemented in this compiler:
feature_support
field onEnumValueOptions
to allow defining the lifetime of a feature value. This is similar to the field of the same name and type onFieldOptions
, but it controls the actual enum values and in which editions they are valid. (This resolves https://github.com/protocolbuffers/protobuf/issues/16369#issuecomment-2096547617.)A change to
google/protobuf/descriptor.proto
to add extension declarations for known custom features. (This resolves https://github.com/protocolbuffers/protobuf/issues/16757.)Unfortunately, this one isn't quite part of this PR because this configuration is not actually in the
descriptorpb
package. Why not? Because extension declarations are defined as source-only options, which means they aren't preserved at runtime, which means they are not present in the embedded descriptor in the latestdescriptorpb
package. I will address this in a subsequent PR by making the sources for these files available to compiler users. It will need to be in a separate package that so it doesn't get linked into user programs by default. For example, the buf CLI won't need it because it has its own mechanism of supplying the sources for these files.This PR updates to use the latest (final) v27.0 release and also updates the protobuf-go dependency to include the v27.0 version of the
descriptorpb
package (first two commits). It then implements the same checks as the first two bullets mentioned above, each in its own commit.