Skip to content

Commit 41298d3

Browse files
committed
types/descriptorpb: regenerate using latest protobuf v31 release
* Ignore the //clang-format off directive for copyright header checks. * Run the conformance tests with the protolegacy build tag, because (with protobuf v31) the conformance tests now include a test for message sets (which are a protolegacy feature). Change-Id: I23e649f433e9342020493180f20b92c1720da049 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/673495 Reviewed-by: Lasse Folger <lassefolger@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
1 parent e5d4468 commit 41298d3

File tree

13 files changed

+1117
-515
lines changed

13 files changed

+1117
-515
lines changed

integration_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ var (
3333
regenerate = flag.Bool("regenerate", false, "regenerate files")
3434
buildRelease = flag.Bool("buildRelease", false, "build release binaries")
3535

36-
protobufVersion = "30.0"
36+
protobufVersion = "31.0"
3737

3838
golangVersions = func() []string {
3939
// Version policy: oldest supported version of Go, plus the version before that.
4040
// This matches the version policy of the Google Cloud Client Libraries:
4141
// https://cloud.google.com/go/getting-started/supported-go-versions
4242
return []string{
4343
"1.22.12",
44-
"1.23.6",
45-
"1.24.0",
44+
"1.23.9",
45+
"1.24.2",
4646
}
4747
}()
4848
golangLatest = golangVersions[len(golangVersions)-1]
@@ -157,7 +157,7 @@ func TestIntegration(t *testing.T) {
157157
runGo("ProtoLegacyRace", command{}, "go", "test", "-race", "-tags", "protolegacy", "./...")
158158
runGo("ProtoLegacy", command{}, "go", "test", "-tags", "protolegacy", "./...")
159159
runGo("ProtocGenGo", command{Dir: "cmd/protoc-gen-go/testdata"}, "go", "test")
160-
runGo("Conformance", command{Dir: "internal/conformance"}, "go", "test", "-execute")
160+
runGo("Conformance", command{Dir: "internal/conformance"}, "go", "test", "-tags", "protolegacy", "-execute")
161161

162162
// Only run the 32-bit compatibility tests for Linux;
163163
// avoid Darwin since 10.15 dropped support i386 code execution.
@@ -520,6 +520,10 @@ File:
520520
if err != nil {
521521
t.Fatal(err)
522522
}
523+
// Files like test_messages_proto2_editions.pb.go start with a
524+
// clang-format directive that has to go before the copyright header for
525+
// technical reasons.
526+
b = bytes.TrimPrefix(b, []byte("// clang-format off\n"))
523527
for _, re := range copyrightRegex {
524528
if loc := re.FindIndex(b); loc != nil && loc[0] == 0 {
525529
continue File
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
Recommended.Proto2.ProtobufInput.ValidMessageSetEncoding.SubmessageEncoding.ProtobufOutput # Output was not equivalent to reference message: deleted: message_set_correct.(protobuf_test_messages.proto2.TestAllTypesProto2.M
12

internal/conformance/failing_tests_text_format.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongSh
1313
Required.Editions_Proto2.TextFormatInput.ClosedEnumFieldWithUnknownNumber # Should have failed to parse, but didn't.
1414
Required.Editions_Proto3.TextFormatInput.FloatFieldNoNegativeOctal # Should have failed to parse, but didn't.
1515
Required.Editions_Proto3.TextFormatInput.FloatFieldNoOctal # Should have failed to parse, but didn't.
16+
Required.Editions_Proto3.TextFormatInput.Int32FieldTooLargeHex # Should have failed to parse, but didn't.
17+
Required.Editions_Proto3.TextFormatInput.Int64FieldTooLargeHex # Should have failed to parse, but didn't.
1618
Required.Proto2.TextFormatInput.ClosedEnumFieldWithUnknownNumber # Should have failed to parse, but didn't.
1719
Required.Proto3.TextFormatInput.FloatFieldNoNegativeOctal # Should have failed to parse, but didn't.
1820
Required.Proto3.TextFormatInput.FloatFieldNoOctal # Should have failed to parse, but didn't.
21+
Required.Proto3.TextFormatInput.Int32FieldTooLargeHex # Should have failed to parse, but didn't.
22+
Required.Proto3.TextFormatInput.Int64FieldTooLargeHex # Should have failed to parse, but didn't.
8 Bytes
Binary file not shown.

internal/filedesc/build_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ func TestInit(t *testing.T) {
5959
// Support for weak fields has been removed.
6060
descPkg.Append("FileDescriptorProto.weak_dependency"): true,
6161

62+
// TODO: Test option_dependency.
63+
descPkg.Append("FileDescriptorProto.option_dependency"): true,
64+
65+
// Visibility is enforced in protoc, runtimes should not inspect this.
66+
descPkg.Append("DescriptorProto.visibility"): true,
67+
descPkg.Append("EnumDescriptorProto.visibility"): true,
68+
6269
// Impossible to test proto3 optional in a proto2 file.
6370
descPkg.Append("FieldDescriptorProto.proto3_optional"): true,
6471

internal/filedesc/editions.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ func unmarshalFeatureSet(b []byte, parent EditionFeatures) EditionFeatures {
7272
case genid.FeatureSet_EnforceNamingStyle_field_number:
7373
// EnforceNamingStyle is enforced in protoc, languages other than C++
7474
// are not supposed to do anything with this feature.
75+
case genid.FeatureSet_DefaultSymbolVisibility_field_number:
76+
// DefaultSymbolVisibility is enforced in protoc, runtimes should not
77+
// inspect this value.
7578
default:
7679
panic(fmt.Sprintf("unkown field number %d while unmarshalling FeatureSet", num))
7780
}

internal/genid/descriptor_gen.go

Lines changed: 68 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)