gogo/protobuf fork has been replaced by upstream protocolbuffers/protobuf because gogo/protobuf is deprecated.
I had to do this upgrade because I encountered some troubles while trying to compile the CycloneDX SBOM definition in #212.
Here are some examples of error I got when trying to compile the upstream CycloneDX SBOM definition without the deprecation version of gogo/protobuf:
Generating sbom proto
proto/deps/github.com/CycloneDX/specification/schema/bom-1.4.proto:9:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
proto/deps/github.com/CycloneDX/specification/schema/bom-1.4.proto:11:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
proto/deps/github.com/CycloneDX/specification/schema/bom-1.4.proto:20:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
proto/deps/github.com/CycloneDX/specification/schema/bom-1.4.proto:22:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
proto/deps/github.com/CycloneDX/specification/schema/bom-1.4.proto:24:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
proto/deps/github.com/CycloneDX/specification/schema/bom-1.4.proto:61:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
proto/deps/github.com/CycloneDX/specification/schema/bom-1.4.proto:63:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
…
# github.com/DataDog/agent-payload/v5/cyclonedx_v1_4
cyclonedx_v1_4/bom-1.4.pb.go:3522:55: m.Timestamp.Size undefined (type *timestamppb.Timestamp has no field or method Size)
cyclonedx_v1_4/bom-1.4.pb.go:3523:26: m.Timestamp.MarshalTo undefined (type *timestamppb.Timestamp has no field or method MarshalTo)
cyclonedx_v1_4/bom-1.4.pb.go:3762:55: m.Timestamp.Size undefined (type *timestamppb.Timestamp has no field or method Size)
cyclonedx_v1_4/bom-1.4.pb.go:3763:27: m.Timestamp.MarshalTo undefined (type *timestamppb.Timestamp has no field or method MarshalTo)
cyclonedx_v1_4/bom-1.4.pb.go:4585:55: m.Timestamp.Size undefined (type *timestamppb.Timestamp has no field or method Size)
cyclonedx_v1_4/bom-1.4.pb.go:4586:27: m.Timestamp.MarshalTo undefined (type *timestamppb.Timestamp has no field or method MarshalTo)
cyclonedx_v1_4/bom-1.4.pb.go:4773:53: m.Created.Size undefined (type *timestamppb.Timestamp has no field or method Size)
cyclonedx_v1_4/bom-1.4.pb.go:4774:25: m.Created.MarshalTo undefined (type *timestamppb.Timestamp has no field or method MarshalTo)
cyclonedx_v1_4/bom-1.4.pb.go:4783:55: m.Published.Size undefined (type *timestamppb.Timestamp has no field or method Size)
cyclonedx_v1_4/bom-1.4.pb.go:4784:27: m.Published.MarshalTo undefined (type *timestamppb.Timestamp has no field or method MarshalTo)
cyclonedx_v1_4/bom-1.4.pb.go:4784:27: too many errors
protoc
has been upgraded from3.5.1
to21.12
.gogo/protobuf
fork has been replaced by upstreamprotocolbuffers/protobuf
becausegogo/protobuf
is deprecated.I had to do this upgrade because I encountered some troubles while trying to compile the CycloneDX SBOM definition in #212.
Here are some examples of error I got when trying to compile the upstream CycloneDX SBOM definition without the deprecation version of
gogo/protobuf
:I ran the benchmark before and after the upgrade.
After the upgrade:
In short: