Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

record.proto is too generic and results in conflict with other packages #788

Closed
dereknola opened this issue Jan 10, 2025 · 3 comments · Fixed by #789
Closed

record.proto is too generic and results in conflict with other packages #788

dereknola opened this issue Jan 10, 2025 · 3 comments · Fixed by #789
Assignees
Labels
effort/hours Estimated to take one or several hours kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up

Comments

@dereknola
Copy link
Contributor

dereknola commented Jan 10, 2025

Background

I work on the k3s project, which has a large dependency trail. Recently we attempted to move to a new version of spegel, which pulled in new versions of libp2p/go-libp2p-kad-dht which bumped boxo from from v0.10.0 -> v0.24.3

Issue

All these dependencies thrown together has resulted in conflicts around record.proto registration:

panic: proto: file "record.proto" is already registered
	See https://protobuf.dev/reference/go/faq#namespace-conflict

Looking thru our vendor list you can see that there are a multitude of dependencies that use a very generic record.proto for some protobuf.

grep -rF 'record.proto' vendor/
vendor/go.etcd.io/etcd/server/v3/wal/walpb/record.pb.go:// source: record.proto
vendor/go.etcd.io/etcd/server/v3/wal/walpb/record.pb.go:func init() { proto.RegisterFile("record.proto", fileDescriptor_bf94fd919e302a1d) }
vendor/github.com/libp2p/go-libp2p-record/pb/record.pb.go:// source: record.proto
vendor/github.com/libp2p/go-libp2p-record/pb/record.pb.go:func init() { proto.RegisterFile("record.proto", fileDescriptor_bf94fd919e302a1d) }
vendor/github.com/libp2p/go-libp2p-record/pb/record.proto:// `protoc --gogo_out=. record.proto`
vendor/github.com/libp2p/go-libp2p-kad-dht/pb/dht.proto:import "github.com/libp2p/go-libp2p-record/pb/record.proto";
vendor/github.com/libp2p/go-libp2p/p2p/protocol/identify/pb/identify.proto:  // github.com/libp2p/go-libp2p/core/peer/pb/peer_record.proto for message definitions.
vendor/github.com/libp2p/go-libp2p/p2p/protocol/identify/pb/identify.pb.go:	// github.com/libp2p/go-libp2p/core/peer/pb/peer_record.proto for message definitions.
vendor/github.com/libp2p/go-libp2p/core/peer/pb/peer_record.pb.go:// source: core/peer/pb/peer_record.proto
vendor/github.com/ipfs/boxo/ipns/pb/record.pb.go:// source: record.proto
vendor/github.com/ipfs/boxo/ipns/record.go://go:generate protoc -I=pb --go_out=pb --go_opt=module=github.com/ipfs/boxo/ipns/pb pb/record.proto

Looking at the FAQ around how to resolve this that https://protobuf.dev/reference/go/faq#namespace-conflict, it seems that boxo does not define a unique enough option go_package for its protobuf. Additionally, it is likely a good idea to just change the name entirely from something so generic as record.

@dereknola dereknola added the need/triage Needs initial labeling and prioritization label Jan 10, 2025
Copy link

welcome bot commented Jan 10, 2025

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@lidel lidel added P2 Medium: Good to have, but can wait until someone steps up effort/hours Estimated to take one or several hours kind/bug A bug in existing code (including security flaws) and removed need/triage Needs initial labeling and prioritization labels Jan 14, 2025
@lidel
Copy link
Member

lidel commented Jan 14, 2025

Triage notes:

@dereknola
Copy link
Contributor Author

Thanks for covering this and the follow on Issue, I appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/hours Estimated to take one or several hours kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants