Prechádzať zdrojové kódy

reflect/protoregistry: provide more informative errors for conflicts

The v2 implementation strictly enforces that there are no conflicts at
all in the protobuf namespace unlike the prior v1 implementation.
This change is almost certainly going to cause loud failures for users
that were unknowingly tolerating registration conflicts.

We modify internal/filedesc to be able to record the Go package path
that the file descriptor is declared within. This information is used
by reflect/protoregistry to print both the previous Go package that
registered some declaration, and current Go package that is attempting
to register some declaration.

Change-Id: Ib5eb21c1c98495afc51aa08bd4404bd9d64b5b57
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/186177
Reviewed-by: Damien Neil <dneil@google.com>
Joe Tsai 6 rokov pred
rodič
commit
af57087245
88 zmenil súbory, kde vykonal 304 pridanie a 16 odobranie
  1. 3 0
      cmd/protoc-gen-go-grpc/testdata/grpc/deprecation.pb.go
  2. 3 0
      cmd/protoc-gen-go-grpc/testdata/grpc/grpc.pb.go
  3. 2 1
      cmd/protoc-gen-go/internal_gengo/main.go
  4. 2 0
      cmd/protoc-gen-go/internal_gengo/reflect.go
  5. 3 0
      cmd/protoc-gen-go/testdata/annotations/annotations.pb.go
  6. 1 1
      cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta
  7. 3 0
      cmd/protoc-gen-go/testdata/comments/comments.pb.go
  8. 3 0
      cmd/protoc-gen-go/testdata/comments/deprecated.pb.go
  9. 3 0
      cmd/protoc-gen-go/testdata/extensions/base/base.pb.go
  10. 3 0
      cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go
  11. 3 0
      cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go
  12. 3 0
      cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go
  13. 3 0
      cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go
  14. 3 0
      cmd/protoc-gen-go/testdata/import_public/a.pb.go
  15. 3 0
      cmd/protoc-gen-go/testdata/import_public/b.pb.go
  16. 3 0
      cmd/protoc-gen-go/testdata/import_public/c.pb.go
  17. 3 0
      cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
  18. 3 0
      cmd/protoc-gen-go/testdata/import_public/sub/b.pb.go
  19. 3 0
      cmd/protoc-gen-go/testdata/import_public/sub2/a.pb.go
  20. 3 0
      cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go
  21. 3 0
      cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
  22. 3 0
      cmd/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go
  23. 3 0
      cmd/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go
  24. 3 0
      cmd/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go
  25. 3 0
      cmd/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go
  26. 3 0
      cmd/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go
  27. 3 0
      cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go
  28. 3 0
      cmd/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go
  29. 3 0
      cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go
  30. 3 0
      cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go
  31. 3 0
      cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go
  32. 3 0
      cmd/protoc-gen-go/testdata/proto2/enum.pb.go
  33. 3 0
      cmd/protoc-gen-go/testdata/proto2/fields.pb.go
  34. 3 0
      cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go
  35. 3 0
      cmd/protoc-gen-go/testdata/proto2/proto2.pb.go
  36. 3 0
      cmd/protoc-gen-go/testdata/proto3/enum.pb.go
  37. 3 0
      cmd/protoc-gen-go/testdata/proto3/fields.pb.go
  38. 3 0
      encoding/testprotos/pb2/test.pb.go
  39. 3 0
      encoding/testprotos/pb3/test.pb.go
  40. 3 0
      internal/filedesc/build.go
  41. 9 0
      internal/filedesc/desc.go
  42. 3 0
      internal/testprotos/benchmarks/benchmarks.pb.go
  43. 3 0
      internal/testprotos/benchmarks/datasets/google_message1/proto2/benchmark_message1_proto2.pb.go
  44. 3 0
      internal/testprotos/benchmarks/datasets/google_message1/proto3/benchmark_message1_proto3.pb.go
  45. 3 0
      internal/testprotos/benchmarks/datasets/google_message2/benchmark_message2.pb.go
  46. 3 0
      internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3.pb.go
  47. 3 0
      internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_1.pb.go
  48. 3 0
      internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_2.pb.go
  49. 3 0
      internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_3.pb.go
  50. 3 0
      internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_4.pb.go
  51. 3 0
      internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_5.pb.go
  52. 3 0
      internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_6.pb.go
  53. 3 0
      internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_7.pb.go
  54. 3 0
      internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_8.pb.go
  55. 3 0
      internal/testprotos/benchmarks/datasets/google_message4/benchmark_message4.pb.go
  56. 3 0
      internal/testprotos/benchmarks/datasets/google_message4/benchmark_message4_1.pb.go
  57. 3 0
      internal/testprotos/benchmarks/datasets/google_message4/benchmark_message4_2.pb.go
  58. 3 0
      internal/testprotos/benchmarks/datasets/google_message4/benchmark_message4_3.pb.go
  59. 3 0
      internal/testprotos/conformance/conformance.pb.go
  60. 3 0
      internal/testprotos/conformance/test_messages_proto2.pb.go
  61. 3 0
      internal/testprotos/conformance/test_messages_proto3.pb.go
  62. 3 0
      internal/testprotos/irregular/test.pb.go
  63. 3 0
      internal/testprotos/legacy/legacy.pb.go
  64. 3 0
      internal/testprotos/messageset/messagesetpb/message_set.pb.go
  65. 3 0
      internal/testprotos/messageset/msetextpb/msetextpb.pb.go
  66. 3 0
      internal/testprotos/test/ext.pb.go
  67. 3 0
      internal/testprotos/test/test.pb.go
  68. 3 0
      internal/testprotos/test/test_import.pb.go
  69. 3 0
      internal/testprotos/test/test_public.pb.go
  70. 3 0
      internal/testprotos/test/weak/test_weak.pb.go
  71. 3 0
      internal/testprotos/test/weak1/test_weak.pb.go
  72. 3 0
      internal/testprotos/test/weak2/test_weak.pb.go
  73. 3 0
      internal/testprotos/test3/test.pb.go
  74. 3 0
      internal/testprotos/test3/test_import.pb.go
  75. 41 14
      reflect/protoregistry/registry.go
  76. 3 0
      reflect/protoregistry/testprotos/test.pb.go
  77. 3 0
      types/descriptorpb/descriptor.pb.go
  78. 3 0
      types/known/anypb/any.pb.go
  79. 3 0
      types/known/apipb/api.pb.go
  80. 3 0
      types/known/durationpb/duration.pb.go
  81. 3 0
      types/known/emptypb/empty.pb.go
  82. 3 0
      types/known/fieldmaskpb/field_mask.pb.go
  83. 3 0
      types/known/sourcecontextpb/source_context.pb.go
  84. 3 0
      types/known/structpb/struct.pb.go
  85. 3 0
      types/known/timestamppb/timestamp.pb.go
  86. 3 0
      types/known/typepb/type.pb.go
  87. 3 0
      types/known/wrapperspb/wrappers.pb.go
  88. 3 0
      types/pluginpb/plugin.pb.go

+ 3 - 0
cmd/protoc-gen-go-grpc/testdata/grpc/deprecation.pb.go

@@ -6,6 +6,7 @@ package grpc
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -69,8 +70,10 @@ func file_grpc_deprecation_proto_init() {
 		return
 		return
 	}
 	}
 	file_grpc_grpc_proto_init()
 	file_grpc_grpc_proto_init()
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_grpc_deprecation_proto_rawDesc,
 			RawDescriptor: file_grpc_deprecation_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   0,
 			NumMessages:   0,

+ 3 - 0
cmd/protoc-gen-go-grpc/testdata/grpc/grpc.pb.go

@@ -6,6 +6,7 @@ package grpc
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -180,8 +181,10 @@ func file_grpc_grpc_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_grpc_grpc_proto_rawDesc,
 			RawDescriptor: file_grpc_grpc_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   2,
 			NumMessages:   2,

+ 2 - 1
cmd/protoc-gen-go/internal_gengo/main.go

@@ -74,8 +74,9 @@ const (
 )
 )
 
 
 const (
 const (
-	syncPackage          = protogen.GoImportPath("sync")
 	mathPackage          = protogen.GoImportPath("math")
 	mathPackage          = protogen.GoImportPath("math")
+	reflectPackage       = protogen.GoImportPath("reflect")
+	syncPackage          = protogen.GoImportPath("sync")
 	protoifacePackage    = protogen.GoImportPath("google.golang.org/protobuf/runtime/protoiface")
 	protoifacePackage    = protogen.GoImportPath("google.golang.org/protobuf/runtime/protoiface")
 	protoimplPackage     = protogen.GoImportPath("google.golang.org/protobuf/runtime/protoimpl")
 	protoimplPackage     = protogen.GoImportPath("google.golang.org/protobuf/runtime/protoimpl")
 	protoreflectPackage  = protogen.GoImportPath("google.golang.org/protobuf/reflect/protoreflect")
 	protoreflectPackage  = protogen.GoImportPath("google.golang.org/protobuf/reflect/protoreflect")

+ 2 - 0
cmd/protoc-gen-go/internal_gengo/reflect.go

@@ -193,8 +193,10 @@ func genReflectFileDescriptor(gen *protogen.Plugin, g *protogen.GeneratedFile, f
 		}
 		}
 	}
 	}
 
 
+	g.P("type x struct{}")
 	g.P("out := ", protoimplPackage.Ident("TypeBuilder"), "{")
 	g.P("out := ", protoimplPackage.Ident("TypeBuilder"), "{")
 	g.P("File: ", protoimplPackage.Ident("DescBuilder"), "{")
 	g.P("File: ", protoimplPackage.Ident("DescBuilder"), "{")
+	g.P("GoPackagePath: ", reflectPackage.Ident("TypeOf"), "(x{}).PkgPath(),")
 	g.P("RawDescriptor: ", rawDescVarName(f), ",")
 	g.P("RawDescriptor: ", rawDescVarName(f), ",")
 	g.P("NumEnums: ", len(f.allEnums), ",")
 	g.P("NumEnums: ", len(f.allEnums), ",")
 	g.P("NumMessages: ", len(f.allMessages), ",")
 	g.P("NumMessages: ", len(f.allMessages), ",")

+ 3 - 0
cmd/protoc-gen-go/testdata/annotations/annotations.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -176,8 +177,10 @@ func file_annotations_annotations_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_annotations_annotations_proto_rawDesc,
 			RawDescriptor: file_annotations_annotations_proto_rawDesc,
 			NumEnums:      1,
 			NumEnums:      1,
 			NumMessages:   1,
 			NumMessages:   1,

+ 1 - 1
cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta

@@ -1 +1 @@
-annotation:{path:5 path:0 source_file:"annotations/annotations.proto" begin:571 end:590} annotation:{path:5 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:607 end:654} annotation:{path:4 path:0 source_file:"annotations/annotations.proto" begin:1879 end:1901} annotation:{path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:1957 end:1977} annotation:{path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:2953 end:2976}
+annotation:{path:5 path:0 source_file:"annotations/annotations.proto" begin:590 end:609} annotation:{path:5 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:626 end:673} annotation:{path:4 path:0 source_file:"annotations/annotations.proto" begin:1898 end:1920} annotation:{path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:1976 end:1996} annotation:{path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:2972 end:2995}

+ 3 - 0
cmd/protoc-gen-go/testdata/comments/comments.pb.go

@@ -8,6 +8,7 @@ package comments
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -394,8 +395,10 @@ func file_comments_comments_proto_init() {
 	file_comments_comments_proto_msgTypes[0].OneofWrappers = []interface{}{
 	file_comments_comments_proto_msgTypes[0].OneofWrappers = []interface{}{
 		(*Message1_Oneof1AField1)(nil),
 		(*Message1_Oneof1AField1)(nil),
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_comments_comments_proto_rawDesc,
 			RawDescriptor: file_comments_comments_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   6,
 			NumMessages:   6,

+ 3 - 0
cmd/protoc-gen-go/testdata/comments/deprecated.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -166,8 +167,10 @@ func file_comments_deprecated_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_comments_deprecated_proto_rawDesc,
 			RawDescriptor: file_comments_deprecated_proto_rawDesc,
 			NumEnums:      1,
 			NumEnums:      1,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/extensions/base/base.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -192,8 +193,10 @@ func file_extensions_base_base_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_extensions_base_base_proto_rawDesc,
 			RawDescriptor: file_extensions_base_base_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   2,
 			NumMessages:   2,

+ 3 - 0
cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go

@@ -10,6 +10,7 @@ import (
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -1374,8 +1375,10 @@ func file_extensions_ext_ext_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_extensions_ext_ext_proto_rawDesc,
 			RawDescriptor: file_extensions_ext_ext_proto_rawDesc,
 			NumEnums:      1,
 			NumEnums:      1,
 			NumMessages:   8,
 			NumMessages:   8,

+ 3 - 0
cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go

@@ -6,6 +6,7 @@ package extra
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -116,8 +117,10 @@ func file_extensions_extra_extra_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_extensions_extra_extra_proto_rawDesc,
 			RawDescriptor: file_extensions_extra_extra_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go

@@ -9,6 +9,7 @@ import (
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	descriptorpb "google.golang.org/protobuf/types/descriptorpb"
 	descriptorpb "google.golang.org/protobuf/types/descriptorpb"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -764,8 +765,10 @@ func file_extensions_proto3_ext3_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_extensions_proto3_ext3_proto_rawDesc,
 			RawDescriptor: file_extensions_proto3_ext3_proto_rawDesc,
 			NumEnums:      1,
 			NumEnums:      1,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go

@@ -6,6 +6,7 @@ package fieldnames
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -423,8 +424,10 @@ func file_fieldnames_fieldnames_proto_init() {
 		(*Message_OneofConflictB_)(nil),
 		(*Message_OneofConflictB_)(nil),
 		(*Message_OneofMessageConflict_)(nil),
 		(*Message_OneofMessageConflict_)(nil),
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_fieldnames_fieldnames_proto_rawDesc,
 			RawDescriptor: file_fieldnames_fieldnames_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   2,
 			NumMessages:   2,

+ 3 - 0
cmd/protoc-gen-go/testdata/import_public/a.pb.go

@@ -7,6 +7,7 @@ import (
 	sub "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/import_public/sub"
 	sub "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/import_public/sub"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -189,8 +190,10 @@ func file_import_public_a_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_import_public_a_proto_rawDesc,
 			RawDescriptor: file_import_public_a_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/import_public/b.pb.go

@@ -7,6 +7,7 @@ import (
 	sub "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/import_public/sub"
 	sub "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/import_public/sub"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -135,8 +136,10 @@ func file_import_public_b_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_import_public_b_proto_rawDesc,
 			RawDescriptor: file_import_public_b_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/import_public/c.pb.go

@@ -7,6 +7,7 @@ import (
 	sub2 "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/import_public/sub2"
 	sub2 "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/import_public/sub2"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -141,8 +142,10 @@ func file_import_public_c_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_import_public_c_proto_rawDesc,
 			RawDescriptor: file_import_public_c_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go

@@ -10,6 +10,7 @@ import (
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	math "math"
 	math "math"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -512,8 +513,10 @@ func file_import_public_sub_a_proto_init() {
 		(*M_Submessage_SubmessageOneofInt32)(nil),
 		(*M_Submessage_SubmessageOneofInt32)(nil),
 		(*M_Submessage_SubmessageOneofInt64)(nil),
 		(*M_Submessage_SubmessageOneofInt64)(nil),
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_import_public_sub_a_proto_rawDesc,
 			RawDescriptor: file_import_public_sub_a_proto_rawDesc,
 			NumEnums:      3,
 			NumEnums:      3,
 			NumMessages:   2,
 			NumMessages:   2,

+ 3 - 0
cmd/protoc-gen-go/testdata/import_public/sub/b.pb.go

@@ -6,6 +6,7 @@ package sub
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -106,8 +107,10 @@ func file_import_public_sub_b_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_import_public_sub_b_proto_rawDesc,
 			RawDescriptor: file_import_public_sub_b_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/import_public/sub2/a.pb.go

@@ -6,6 +6,7 @@ package sub2
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -107,8 +108,10 @@ func file_import_public_sub2_a_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_import_public_sub2_a_proto_rawDesc,
 			RawDescriptor: file_import_public_sub2_a_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go

@@ -6,6 +6,7 @@ package fmt
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -104,8 +105,10 @@ func file_imports_fmt_m_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_imports_fmt_m_proto_rawDesc,
 			RawDescriptor: file_imports_fmt_m_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -208,8 +209,10 @@ func file_imports_test_a_1_m1_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_imports_test_a_1_m1_proto_rawDesc,
 			RawDescriptor: file_imports_test_a_1_m1_proto_rawDesc,
 			NumEnums:      1,
 			NumEnums:      1,
 			NumMessages:   2,
 			NumMessages:   2,

+ 3 - 0
cmd/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go

@@ -6,6 +6,7 @@ package test_a_1
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -105,8 +106,10 @@ func file_imports_test_a_1_m2_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_imports_test_a_1_m2_proto_rawDesc,
 			RawDescriptor: file_imports_test_a_1_m2_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go

@@ -6,6 +6,7 @@ package test_a_2
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -105,8 +106,10 @@ func file_imports_test_a_2_m3_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_imports_test_a_2_m3_proto_rawDesc,
 			RawDescriptor: file_imports_test_a_2_m3_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go

@@ -6,6 +6,7 @@ package test_a_2
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -105,8 +106,10 @@ func file_imports_test_a_2_m4_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_imports_test_a_2_m4_proto_rawDesc,
 			RawDescriptor: file_imports_test_a_2_m4_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go

@@ -6,6 +6,7 @@ package beta
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -106,8 +107,10 @@ func file_imports_test_b_1_m1_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_imports_test_b_1_m1_proto_rawDesc,
 			RawDescriptor: file_imports_test_b_1_m1_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go

@@ -6,6 +6,7 @@ package beta
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -106,8 +107,10 @@ func file_imports_test_b_1_m2_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_imports_test_b_1_m2_proto_rawDesc,
 			RawDescriptor: file_imports_test_b_1_m2_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go

@@ -7,6 +7,7 @@ import (
 	test_a_1 "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/imports/test_a_1"
 	test_a_1 "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/imports/test_a_1"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -119,8 +120,10 @@ func file_imports_test_import_a1m1_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_imports_test_import_a1m1_proto_rawDesc,
 			RawDescriptor: file_imports_test_import_a1m1_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go

@@ -7,6 +7,7 @@ import (
 	test_a_1 "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/imports/test_a_1"
 	test_a_1 "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/imports/test_a_1"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -119,8 +120,10 @@ func file_imports_test_import_a1m2_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_imports_test_import_a1m2_proto_rawDesc,
 			RawDescriptor: file_imports_test_import_a1m2_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go

@@ -10,6 +10,7 @@ import (
 	test_b_1 "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/imports/test_b_1"
 	test_b_1 "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/imports/test_b_1"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -180,8 +181,10 @@ func file_imports_test_import_all_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_imports_test_import_all_proto_rawDesc,
 			RawDescriptor: file_imports_test_import_all_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go

@@ -6,6 +6,7 @@ package oneoftest
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -133,8 +134,10 @@ func file_issue780_oneof_conflict_test_proto_init() {
 	file_issue780_oneof_conflict_test_proto_msgTypes[0].OneofWrappers = []interface{}{
 	file_issue780_oneof_conflict_test_proto_msgTypes[0].OneofWrappers = []interface{}{
 		(*Foo_GetBar)(nil),
 		(*Foo_GetBar)(nil),
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_issue780_oneof_conflict_test_proto_rawDesc,
 			RawDescriptor: file_issue780_oneof_conflict_test_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -179,8 +180,10 @@ func file_nopackage_nopackage_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_nopackage_nopackage_proto_rawDesc,
 			RawDescriptor: file_nopackage_nopackage_proto_rawDesc,
 			NumEnums:      1,
 			NumEnums:      1,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/proto2/enum.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -530,8 +531,10 @@ func file_proto2_enum_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_proto2_enum_proto_rawDesc,
 			RawDescriptor: file_proto2_enum_proto_rawDesc,
 			NumEnums:      6,
 			NumEnums:      6,
 			NumMessages:   2,
 			NumMessages:   2,

+ 3 - 0
cmd/protoc-gen-go/testdata/proto2/fields.pb.go

@@ -8,6 +8,7 @@ import (
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	math "math"
 	math "math"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -1827,8 +1828,10 @@ func file_proto2_fields_proto_init() {
 		(*FieldTestMessage_OneofTwo_1)(nil),
 		(*FieldTestMessage_OneofTwo_1)(nil),
 		(*FieldTestMessage_OneofTwo_2)(nil),
 		(*FieldTestMessage_OneofTwo_2)(nil),
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_proto2_fields_proto_rawDesc,
 			RawDescriptor: file_proto2_fields_proto_rawDesc,
 			NumEnums:      1,
 			NumEnums:      1,
 			NumMessages:   9,
 			NumMessages:   9,

+ 3 - 0
cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go

@@ -6,6 +6,7 @@ package proto2
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -237,8 +238,10 @@ func file_proto2_nested_messages_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_proto2_nested_messages_proto_rawDesc,
 			RawDescriptor: file_proto2_nested_messages_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   3,
 			NumMessages:   3,

+ 3 - 0
cmd/protoc-gen-go/testdata/proto2/proto2.pb.go

@@ -6,6 +6,7 @@ package proto2
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -126,8 +127,10 @@ func file_proto2_proto2_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_proto2_proto2_proto_rawDesc,
 			RawDescriptor: file_proto2_proto2_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
cmd/protoc-gen-go/testdata/proto3/enum.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -108,8 +109,10 @@ func file_proto3_enum_proto_init() {
 	if File_proto3_enum_proto != nil {
 	if File_proto3_enum_proto != nil {
 		return
 		return
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_proto3_enum_proto_rawDesc,
 			RawDescriptor: file_proto3_enum_proto_rawDesc,
 			NumEnums:      1,
 			NumEnums:      1,
 			NumMessages:   0,
 			NumMessages:   0,

+ 3 - 0
cmd/protoc-gen-go/testdata/proto3/fields.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -644,8 +645,10 @@ func file_proto3_fields_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_proto3_fields_proto_rawDesc,
 			RawDescriptor: file_proto3_fields_proto_rawDesc,
 			NumEnums:      1,
 			NumEnums:      1,
 			NumMessages:   5,
 			NumMessages:   5,

+ 3 - 0
encoding/testprotos/pb2/test.pb.go

@@ -15,6 +15,7 @@ import (
 	structpb "google.golang.org/protobuf/types/known/structpb"
 	structpb "google.golang.org/protobuf/types/known/structpb"
 	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
 	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
 	wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
 	wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -2382,8 +2383,10 @@ func file_pb2_test_proto_init() {
 	file_pb2_test_proto_msgTypes[8].OneofWrappers = []interface{}{
 	file_pb2_test_proto_msgTypes[8].OneofWrappers = []interface{}{
 		(*IndirectRequired_OneofNested)(nil),
 		(*IndirectRequired_OneofNested)(nil),
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_pb2_test_proto_rawDesc,
 			RawDescriptor: file_pb2_test_proto_rawDesc,
 			NumEnums:      2,
 			NumEnums:      2,
 			NumMessages:   20,
 			NumMessages:   20,

+ 3 - 0
encoding/testprotos/pb3/test.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -878,8 +879,10 @@ func file_pb3_test_proto_init() {
 		(*Oneofs_OneofString)(nil),
 		(*Oneofs_OneofString)(nil),
 		(*Oneofs_OneofNested)(nil),
 		(*Oneofs_OneofNested)(nil),
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_pb3_test_proto_rawDesc,
 			RawDescriptor: file_pb3_test_proto_rawDesc,
 			NumEnums:      2,
 			NumEnums:      2,
 			NumMessages:   12,
 			NumMessages:   12,

+ 3 - 0
internal/filedesc/build.go

@@ -15,6 +15,9 @@ import (
 
 
 // DescBuilder construct a protoreflect.FileDescriptor from the raw descriptor.
 // DescBuilder construct a protoreflect.FileDescriptor from the raw descriptor.
 type DescBuilder struct {
 type DescBuilder struct {
+	// GoPackagePath is the Go package path that is invoking this builder.
+	GoPackagePath string
+
 	// RawDescriptor is the wire-encoded bytes of FileDescriptorProto
 	// RawDescriptor is the wire-encoded bytes of FileDescriptorProto
 	// and must be populated.
 	// and must be populated.
 	RawDescriptor []byte
 	RawDescriptor []byte

+ 9 - 0
internal/filedesc/desc.go

@@ -106,6 +106,15 @@ func (fd *File) ProtoLegacyRawDesc() []byte {
 	return fd.builder.RawDescriptor
 	return fd.builder.RawDescriptor
 }
 }
 
 
+// GoPackagePath is a pseudo-internal API for determining the Go package path
+// that this file descriptor is declared in.
+//
+// WARNING: This method is exempt from the compatibility promise and may be
+// removed in the future without warning.
+func (fd *File) GoPackagePath() string {
+	return fd.builder.GoPackagePath
+}
+
 type (
 type (
 	Enum struct {
 	Enum struct {
 		Base
 		Base

+ 3 - 0
internal/testprotos/benchmarks/benchmarks.pb.go

@@ -6,6 +6,7 @@ package benchmarks
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -158,8 +159,10 @@ func file_benchmarks_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_benchmarks_proto_rawDesc,
 			RawDescriptor: file_benchmarks_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
internal/testprotos/benchmarks/datasets/google_message1/proto2/benchmark_message1_proto2.pb.go

@@ -6,6 +6,7 @@ package proto2
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -798,8 +799,10 @@ func file_datasets_google_message1_proto2_benchmark_message1_proto2_proto_init()
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_datasets_google_message1_proto2_benchmark_message1_proto2_proto_rawDesc,
 			RawDescriptor: file_datasets_google_message1_proto2_benchmark_message1_proto2_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   2,
 			NumMessages:   2,

+ 3 - 0
internal/testprotos/benchmarks/datasets/google_message1/proto3/benchmark_message1_proto3.pb.go

@@ -6,6 +6,7 @@ package proto3
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -753,8 +754,10 @@ func file_datasets_google_message1_proto3_benchmark_message1_proto3_proto_init()
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_datasets_google_message1_proto3_benchmark_message1_proto3_proto_rawDesc,
 			RawDescriptor: file_datasets_google_message1_proto3_benchmark_message1_proto3_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   2,
 			NumMessages:   2,

+ 3 - 0
internal/testprotos/benchmarks/datasets/google_message2/benchmark_message2.pb.go

@@ -6,6 +6,7 @@ package google_message2
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -790,8 +791,10 @@ func file_datasets_google_message2_benchmark_message2_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_datasets_google_message2_benchmark_message2_proto_rawDesc,
 			RawDescriptor: file_datasets_google_message2_benchmark_message2_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   3,
 			NumMessages:   3,

+ 3 - 0
internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -6569,8 +6570,10 @@ func file_datasets_google_message3_benchmark_message3_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_datasets_google_message3_benchmark_message3_proto_rawDesc,
 			RawDescriptor: file_datasets_google_message3_benchmark_message3_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   33,
 			NumMessages:   33,

+ 3 - 0
internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_1.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -8822,8 +8823,10 @@ func file_datasets_google_message3_benchmark_message3_1_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_datasets_google_message3_benchmark_message3_1_proto_rawDesc,
 			RawDescriptor: file_datasets_google_message3_benchmark_message3_1_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   59,
 			NumMessages:   59,

+ 3 - 0
internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_2.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -6107,8 +6108,10 @@ func file_datasets_google_message3_benchmark_message3_2_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_datasets_google_message3_benchmark_message3_2_proto_rawDesc,
 			RawDescriptor: file_datasets_google_message3_benchmark_message3_2_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   34,
 			NumMessages:   34,

+ 3 - 0
internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_3.pb.go

@@ -6,6 +6,7 @@ package google_message3
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -5789,8 +5790,10 @@ func file_datasets_google_message3_benchmark_message3_3_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_datasets_google_message3_benchmark_message3_3_proto_rawDesc,
 			RawDescriptor: file_datasets_google_message3_benchmark_message3_3_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   37,
 			NumMessages:   37,

+ 3 - 0
internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_4.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -6349,8 +6350,10 @@ func file_datasets_google_message3_benchmark_message3_4_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_datasets_google_message3_benchmark_message3_4_proto_rawDesc,
 			RawDescriptor: file_datasets_google_message3_benchmark_message3_4_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   54,
 			NumMessages:   54,

+ 3 - 0
internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_5.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -5809,8 +5810,10 @@ func file_datasets_google_message3_benchmark_message3_5_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_datasets_google_message3_benchmark_message3_5_proto_rawDesc,
 			RawDescriptor: file_datasets_google_message3_benchmark_message3_5_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   49,
 			NumMessages:   49,

+ 3 - 0
internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_6.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -5425,8 +5426,10 @@ func file_datasets_google_message3_benchmark_message3_6_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_datasets_google_message3_benchmark_message3_6_proto_rawDesc,
 			RawDescriptor: file_datasets_google_message3_benchmark_message3_6_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   42,
 			NumMessages:   42,

+ 3 - 0
internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_7.pb.go

@@ -6,6 +6,7 @@ package google_message3
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -726,8 +727,10 @@ func file_datasets_google_message3_benchmark_message3_7_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_datasets_google_message3_benchmark_message3_7_proto_rawDesc,
 			RawDescriptor: file_datasets_google_message3_benchmark_message3_7_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   10,
 			NumMessages:   10,

+ 3 - 0
internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_8.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -10435,8 +10436,10 @@ func file_datasets_google_message3_benchmark_message3_8_proto_init() {
 	if File_datasets_google_message3_benchmark_message3_8_proto != nil {
 	if File_datasets_google_message3_benchmark_message3_8_proto != nil {
 		return
 		return
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_datasets_google_message3_benchmark_message3_8_proto_rawDesc,
 			RawDescriptor: file_datasets_google_message3_benchmark_message3_8_proto_rawDesc,
 			NumEnums:      59,
 			NumEnums:      59,
 			NumMessages:   0,
 			NumMessages:   0,

+ 3 - 0
internal/testprotos/benchmarks/datasets/google_message4/benchmark_message4.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -5888,8 +5889,10 @@ func file_datasets_google_message4_benchmark_message4_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_datasets_google_message4_benchmark_message4_proto_rawDesc,
 			RawDescriptor: file_datasets_google_message4_benchmark_message4_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   45,
 			NumMessages:   45,

+ 3 - 0
internal/testprotos/benchmarks/datasets/google_message4/benchmark_message4_1.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -5991,8 +5992,10 @@ func file_datasets_google_message4_benchmark_message4_1_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_datasets_google_message4_benchmark_message4_1_proto_rawDesc,
 			RawDescriptor: file_datasets_google_message4_benchmark_message4_1_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   44,
 			NumMessages:   44,

+ 3 - 0
internal/testprotos/benchmarks/datasets/google_message4/benchmark_message4_2.pb.go

@@ -6,6 +6,7 @@ package google_message4
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -3725,8 +3726,10 @@ func file_datasets_google_message4_benchmark_message4_2_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_datasets_google_message4_benchmark_message4_2_proto_rawDesc,
 			RawDescriptor: file_datasets_google_message4_benchmark_message4_2_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   35,
 			NumMessages:   35,

+ 3 - 0
internal/testprotos/benchmarks/datasets/google_message4/benchmark_message4_3.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -4782,8 +4783,10 @@ func file_datasets_google_message4_benchmark_message4_3_proto_init() {
 	if File_datasets_google_message4_benchmark_message4_3_proto != nil {
 	if File_datasets_google_message4_benchmark_message4_3_proto != nil {
 		return
 		return
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_datasets_google_message4_benchmark_message4_3_proto_rawDesc,
 			RawDescriptor: file_datasets_google_message4_benchmark_message4_3_proto_rawDesc,
 			NumEnums:      42,
 			NumEnums:      42,
 			NumMessages:   0,
 			NumMessages:   0,

+ 3 - 0
internal/testprotos/conformance/conformance.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -748,8 +749,10 @@ func file_conformance_conformance_proto_init() {
 		(*ConformanceResponse_JspbPayload)(nil),
 		(*ConformanceResponse_JspbPayload)(nil),
 		(*ConformanceResponse_TextPayload)(nil),
 		(*ConformanceResponse_TextPayload)(nil),
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_conformance_conformance_proto_rawDesc,
 			RawDescriptor: file_conformance_conformance_proto_rawDesc,
 			NumEnums:      2,
 			NumEnums:      2,
 			NumMessages:   4,
 			NumMessages:   4,

+ 3 - 0
internal/testprotos/conformance/test_messages_proto2.pb.go

@@ -8,6 +8,7 @@ import (
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -2024,8 +2025,10 @@ func file_google_protobuf_test_messages_proto2_proto_init() {
 		(*TestAllTypesProto2_OneofDouble)(nil),
 		(*TestAllTypesProto2_OneofDouble)(nil),
 		(*TestAllTypesProto2_OneofEnum)(nil),
 		(*TestAllTypesProto2_OneofEnum)(nil),
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_google_protobuf_test_messages_proto2_proto_rawDesc,
 			RawDescriptor: file_google_protobuf_test_messages_proto2_proto_rawDesc,
 			NumEnums:      2,
 			NumEnums:      2,
 			NumMessages:   26,
 			NumMessages:   26,

+ 3 - 0
internal/testprotos/conformance/test_messages_proto3.pb.go

@@ -13,6 +13,7 @@ import (
 	structpb "google.golang.org/protobuf/types/known/structpb"
 	structpb "google.golang.org/protobuf/types/known/structpb"
 	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
 	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
 	wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
 	wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -2205,8 +2206,10 @@ func file_google_protobuf_test_messages_proto3_proto_init() {
 		(*TestAllTypesProto3_OneofDouble)(nil),
 		(*TestAllTypesProto3_OneofDouble)(nil),
 		(*TestAllTypesProto3_OneofEnum)(nil),
 		(*TestAllTypesProto3_OneofEnum)(nil),
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_google_protobuf_test_messages_proto3_proto_rawDesc,
 			RawDescriptor: file_google_protobuf_test_messages_proto3_proto_rawDesc,
 			NumEnums:      3,
 			NumEnums:      3,
 			NumMessages:   22,
 			NumMessages:   22,

+ 3 - 0
internal/testprotos/irregular/test.pb.go

@@ -6,6 +6,7 @@ package irregular
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -211,8 +212,10 @@ func file_irregular_test_proto_init() {
 	file_irregular_test_proto_msgTypes[0].OneofWrappers = []interface{}{
 	file_irregular_test_proto_msgTypes[0].OneofWrappers = []interface{}{
 		(*Message_OneofMessage)(nil),
 		(*Message_OneofMessage)(nil),
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_irregular_test_proto_rawDesc,
 			RawDescriptor: file_irregular_test_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   2,
 			NumMessages:   2,

+ 3 - 0
internal/testprotos/legacy/legacy.pb.go

@@ -18,6 +18,7 @@ import (
 	proto3_v1_21 "google.golang.org/protobuf/internal/testprotos/legacy/proto3.v1.2.1-20181126-8d0c54c1"
 	proto3_v1_21 "google.golang.org/protobuf/internal/testprotos/legacy/proto3.v1.2.1-20181126-8d0c54c1"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -320,8 +321,10 @@ func file_legacy_legacy_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_legacy_legacy_proto_rawDesc,
 			RawDescriptor: file_legacy_legacy_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
internal/testprotos/messageset/messagesetpb/message_set.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -121,8 +122,10 @@ func file_messageset_messagesetpb_message_set_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_messageset_messagesetpb_message_set_proto_rawDesc,
 			RawDescriptor: file_messageset_messagesetpb_message_set_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
internal/testprotos/messageset/msetextpb/msetextpb.pb.go

@@ -8,6 +8,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -233,8 +234,10 @@ func file_messageset_msetextpb_msetextpb_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_messageset_msetextpb_msetextpb_proto_rawDesc,
 			RawDescriptor: file_messageset_msetextpb_msetextpb_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   2,
 			NumMessages:   2,

+ 3 - 0
internal/testprotos/test/ext.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -79,8 +80,10 @@ func file_test_ext_proto_init() {
 		return
 		return
 	}
 	}
 	file_test_test_proto_init()
 	file_test_test_proto_init()
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_test_ext_proto_rawDesc,
 			RawDescriptor: file_test_ext_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   0,
 			NumMessages:   0,

+ 3 - 0
internal/testprotos/test/test.pb.go

@@ -8,6 +8,7 @@ import (
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -4908,8 +4909,10 @@ func file_test_test_proto_init() {
 	file_test_test_proto_msgTypes[9].OneofWrappers = []interface{}{
 	file_test_test_proto_msgTypes[9].OneofWrappers = []interface{}{
 		(*TestRequiredForeign_OneofMessage)(nil),
 		(*TestRequiredForeign_OneofMessage)(nil),
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_test_test_proto_rawDesc,
 			RawDescriptor: file_test_test_proto_rawDesc,
 			NumEnums:      4,
 			NumEnums:      4,
 			NumMessages:   41,
 			NumMessages:   41,

+ 3 - 0
internal/testprotos/test/test_import.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -161,8 +162,10 @@ func file_test_test_import_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_test_test_import_proto_rawDesc,
 			RawDescriptor: file_test_test_import_proto_rawDesc,
 			NumEnums:      1,
 			NumEnums:      1,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
internal/testprotos/test/test_public.pb.go

@@ -6,6 +6,7 @@ package test
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -105,8 +106,10 @@ func file_test_test_public_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_test_test_public_proto_rawDesc,
 			RawDescriptor: file_test_test_public_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
internal/testprotos/test/weak/test_weak.pb.go

@@ -6,6 +6,7 @@ package weak
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -115,8 +116,10 @@ func file_test_weak_test_weak_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_test_weak_test_weak_proto_rawDesc,
 			RawDescriptor: file_test_weak_test_weak_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
internal/testprotos/test/weak1/test_weak.pb.go

@@ -6,6 +6,7 @@ package weak1
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -115,8 +116,10 @@ func file_test_weak1_test_weak_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_test_weak1_test_weak_proto_rawDesc,
 			RawDescriptor: file_test_weak1_test_weak_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
internal/testprotos/test/weak2/test_weak.pb.go

@@ -6,6 +6,7 @@ package weak2
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -115,8 +116,10 @@ func file_test_weak2_test_weak_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_test_weak2_test_weak_proto_rawDesc,
 			RawDescriptor: file_test_weak2_test_weak_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
internal/testprotos/test3/test.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -1390,8 +1391,10 @@ func file_test3_test_proto_init() {
 		(*TestAllTypes_OneofDouble)(nil),
 		(*TestAllTypes_OneofDouble)(nil),
 		(*TestAllTypes_OneofEnum)(nil),
 		(*TestAllTypes_OneofEnum)(nil),
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_test3_test_proto_rawDesc,
 			RawDescriptor: file_test3_test_proto_rawDesc,
 			NumEnums:      2,
 			NumEnums:      2,
 			NumMessages:   20,
 			NumMessages:   20,

+ 3 - 0
internal/testprotos/test3/test_import.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -151,8 +152,10 @@ func file_test3_test_import_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_test3_test_import_proto_rawDesc,
 			RawDescriptor: file_test3_test_import_proto_rawDesc,
 			NumEnums:      1,
 			NumEnums:      1,
 			NumMessages:   1,
 			NumMessages:   1,

+ 41 - 14
reflect/protoregistry/registry.go

@@ -24,11 +24,6 @@ import (
 	"google.golang.org/protobuf/reflect/protoreflect"
 	"google.golang.org/protobuf/reflect/protoreflect"
 )
 )
 
 
-// TODO: Perhaps Register should record the frame of where the function was
-// called and surface that in the error? That would help users debug duplicate
-// registration issues. This presumes that we provide a way to disable automatic
-// registration in generated code.
-
 // GlobalFiles is a global registry of file descriptors.
 // GlobalFiles is a global registry of file descriptors.
 var GlobalFiles *Files = new(Files)
 var GlobalFiles *Files = new(Files)
 
 
@@ -95,21 +90,24 @@ func (r *Files) Register(files ...protoreflect.FileDescriptor) error {
 }
 }
 func (r *Files) registerFile(fd protoreflect.FileDescriptor) error {
 func (r *Files) registerFile(fd protoreflect.FileDescriptor) error {
 	path := fd.Path()
 	path := fd.Path()
-	if r.filesByPath[path] != nil {
-		return errors.New("file %q is already registered", fd.Path())
+	if prev := r.filesByPath[path]; prev != nil {
+		err := errors.New("file %q is already registered", fd.Path())
+		return amendErrorWithCaller(err, prev, fd)
 	}
 	}
 
 
 	for name := fd.Package(); name != ""; name = name.Parent() {
 	for name := fd.Package(); name != ""; name = name.Parent() {
-		switch r.descsByName[name].(type) {
+		switch prev := r.descsByName[name]; prev.(type) {
 		case nil, *packageDescriptor:
 		case nil, *packageDescriptor:
 		default:
 		default:
-			return errors.New("file %q has a name conflict over %v", fd.Path(), name)
+			err := errors.New("file %q has a name conflict over %v", fd.Path(), name)
+			return amendErrorWithCaller(err, prev, fd)
 		}
 		}
 	}
 	}
 	var err error
 	var err error
 	rangeTopLevelDescriptors(fd, func(d protoreflect.Descriptor) {
 	rangeTopLevelDescriptors(fd, func(d protoreflect.Descriptor) {
-		if r.descsByName[d.FullName()] != nil {
+		if prev := r.descsByName[d.FullName()]; prev != nil {
 			err = errors.New("file %q has a name conflict over %v", fd.Path(), d.FullName())
 			err = errors.New("file %q has a name conflict over %v", fd.Path(), d.FullName())
+			err = amendErrorWithCaller(err, prev, fd)
 		}
 		}
 	})
 	})
 	if err != nil {
 	if err != nil {
@@ -414,9 +412,10 @@ typeLoop:
 			default:
 			default:
 				panic(fmt.Sprintf("invalid type: %T", t))
 				panic(fmt.Sprintf("invalid type: %T", t))
 			}
 			}
-			if r.typesByName[name] != nil {
+			if prev := r.typesByName[name]; prev != nil {
 				if firstErr == nil {
 				if firstErr == nil {
-					firstErr = errors.New("%v %v is already registered", typeName(typ), name)
+					err := errors.New("%v %v is already registered", typeName(typ), name)
+					firstErr = amendErrorWithCaller(err, prev, typ)
 				}
 				}
 				continue typeLoop
 				continue typeLoop
 			}
 			}
@@ -425,9 +424,10 @@ typeLoop:
 			if xt, _ := typ.(protoreflect.ExtensionType); xt != nil {
 			if xt, _ := typ.(protoreflect.ExtensionType); xt != nil {
 				field := xt.Number()
 				field := xt.Number()
 				message := xt.ContainingMessage().FullName()
 				message := xt.ContainingMessage().FullName()
-				if r.extensionsByMessage[message][field] != nil {
+				if prev := r.extensionsByMessage[message][field]; prev != nil {
 					if firstErr == nil {
 					if firstErr == nil {
-						firstErr = errors.New("extension %v is already registered on message %v", name, message)
+						err := errors.New("extension number %d is already registered on message %v", field, message)
+						firstErr = amendErrorWithCaller(err, prev, typ)
 					}
 					}
 					continue typeLoop
 					continue typeLoop
 				}
 				}
@@ -610,3 +610,30 @@ func typeName(t Type) string {
 		return fmt.Sprintf("%T", t)
 		return fmt.Sprintf("%T", t)
 	}
 	}
 }
 }
+
+func amendErrorWithCaller(err error, prev, curr interface{}) error {
+	prevPkg := goPackage(prev)
+	currPkg := goPackage(curr)
+	if prevPkg == "" || currPkg == "" || prevPkg == currPkg {
+		return err
+	}
+	return errors.New("%s; previously from %q, currently from %q", err, prevPkg, currPkg)
+}
+
+func goPackage(v interface{}) string {
+	switch d := v.(type) {
+	case protoreflect.EnumType:
+		v = d.Descriptor()
+	case protoreflect.MessageType:
+		v = d.Descriptor()
+	case protoreflect.ExtensionType:
+		v = d.Descriptor()
+	}
+	if d, ok := v.(protoreflect.Descriptor); ok {
+		v = d.ParentFile()
+	}
+	if d, ok := v.(interface{ GoPackagePath() string }); ok {
+		return d.GoPackagePath()
+	}
+	return ""
+}

+ 3 - 0
reflect/protoregistry/testprotos/test.pb.go

@@ -8,6 +8,7 @@ import (
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -534,8 +535,10 @@ func file_test_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_test_proto_rawDesc,
 			RawDescriptor: file_test_proto_rawDesc,
 			NumEnums:      3,
 			NumEnums:      3,
 			NumMessages:   4,
 			NumMessages:   4,

+ 3 - 0
types/descriptorpb/descriptor.pb.go

@@ -8,6 +8,7 @@ import (
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoiface "google.golang.org/protobuf/runtime/protoiface"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -3754,8 +3755,10 @@ func file_google_protobuf_descriptor_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_google_protobuf_descriptor_proto_rawDesc,
 			RawDescriptor: file_google_protobuf_descriptor_proto_rawDesc,
 			NumEnums:      6,
 			NumEnums:      6,
 			NumMessages:   27,
 			NumMessages:   27,

+ 3 - 0
types/known/anypb/any.pb.go

@@ -6,6 +6,7 @@ package anypb
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -237,8 +238,10 @@ func file_google_protobuf_any_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_google_protobuf_any_proto_rawDesc,
 			RawDescriptor: file_google_protobuf_any_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
types/known/apipb/api.pb.go

@@ -8,6 +8,7 @@ import (
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	sourcecontextpb "google.golang.org/protobuf/types/known/sourcecontextpb"
 	sourcecontextpb "google.golang.org/protobuf/types/known/sourcecontextpb"
 	typepb "google.golang.org/protobuf/types/known/typepb"
 	typepb "google.golang.org/protobuf/types/known/typepb"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -514,8 +515,10 @@ func file_google_protobuf_api_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_google_protobuf_api_proto_rawDesc,
 			RawDescriptor: file_google_protobuf_api_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   3,
 			NumMessages:   3,

+ 3 - 0
types/known/durationpb/duration.pb.go

@@ -6,6 +6,7 @@ package durationpb
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -198,8 +199,10 @@ func file_google_protobuf_duration_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_google_protobuf_duration_proto_rawDesc,
 			RawDescriptor: file_google_protobuf_duration_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
types/known/emptypb/empty.pb.go

@@ -6,6 +6,7 @@ package emptypb
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -118,8 +119,10 @@ func file_google_protobuf_empty_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_google_protobuf_empty_proto_rawDesc,
 			RawDescriptor: file_google_protobuf_empty_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
types/known/fieldmaskpb/field_mask.pb.go

@@ -6,6 +6,7 @@ package fieldmaskpb
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -320,8 +321,10 @@ func file_google_protobuf_field_mask_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_google_protobuf_field_mask_proto_rawDesc,
 			RawDescriptor: file_google_protobuf_field_mask_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
types/known/sourcecontextpb/source_context.pb.go

@@ -6,6 +6,7 @@ package sourcecontextpb
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -125,8 +126,10 @@ func file_google_protobuf_source_context_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_google_protobuf_source_context_proto_rawDesc,
 			RawDescriptor: file_google_protobuf_source_context_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
types/known/structpb/struct.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	prototype "google.golang.org/protobuf/reflect/prototype"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -440,8 +441,10 @@ func file_google_protobuf_struct_proto_init() {
 		(*Value_StructValue)(nil),
 		(*Value_StructValue)(nil),
 		(*Value_ListValue)(nil),
 		(*Value_ListValue)(nil),
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_google_protobuf_struct_proto_rawDesc,
 			RawDescriptor: file_google_protobuf_struct_proto_rawDesc,
 			NumEnums:      1,
 			NumEnums:      1,
 			NumMessages:   4,
 			NumMessages:   4,

+ 3 - 0
types/known/timestamppb/timestamp.pb.go

@@ -6,6 +6,7 @@ package timestamppb
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -218,8 +219,10 @@ func file_google_protobuf_timestamp_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_google_protobuf_timestamp_proto_rawDesc,
 			RawDescriptor: file_google_protobuf_timestamp_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   1,
 			NumMessages:   1,

+ 3 - 0
types/known/typepb/type.pb.go

@@ -9,6 +9,7 @@ import (
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	anypb "google.golang.org/protobuf/types/known/anypb"
 	anypb "google.golang.org/protobuf/types/known/anypb"
 	sourcecontextpb "google.golang.org/protobuf/types/known/sourcecontextpb"
 	sourcecontextpb "google.golang.org/protobuf/types/known/sourcecontextpb"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -883,8 +884,10 @@ func file_google_protobuf_type_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_google_protobuf_type_proto_rawDesc,
 			RawDescriptor: file_google_protobuf_type_proto_rawDesc,
 			NumEnums:      3,
 			NumEnums:      3,
 			NumMessages:   5,
 			NumMessages:   5,

+ 3 - 0
types/known/wrapperspb/wrappers.pb.go

@@ -6,6 +6,7 @@ package wrapperspb
 import (
 import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -606,8 +607,10 @@ func file_google_protobuf_wrappers_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_google_protobuf_wrappers_proto_rawDesc,
 			RawDescriptor: file_google_protobuf_wrappers_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   9,
 			NumMessages:   9,

+ 3 - 0
types/pluginpb/plugin.pb.go

@@ -7,6 +7,7 @@ import (
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	descriptorpb "google.golang.org/protobuf/types/descriptorpb"
 	descriptorpb "google.golang.org/protobuf/types/descriptorpb"
+	reflect "reflect"
 	sync "sync"
 	sync "sync"
 )
 )
 
 
@@ -473,8 +474,10 @@ func file_google_protobuf_compiler_plugin_proto_init() {
 			}
 			}
 		}
 		}
 	}
 	}
+	type x struct{}
 	out := protoimpl.TypeBuilder{
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
 		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_google_protobuf_compiler_plugin_proto_rawDesc,
 			RawDescriptor: file_google_protobuf_compiler_plugin_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
 			NumMessages:   4,
 			NumMessages:   4,