moby / moby/libnetwork

library vendoring breaks third-party network drivers

Open
#1,630 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2.2k
Forks
875
PR merge metrics
No merged PRs in 30d

Description

Commit 54b97aee7814c57789f666c60eb8521b9ee61e92 introduced vendoring which is causing link conflicts for third-party network drivers that must also use netlink; for example when building a network driver using:

  • github.com/docker/libnetwork/vendor/github.com/vishvananda/netlink
  • github.com/vishvananda/netlink
/usr/local/go/pkg/tool/linux_amd64/link: running g++ failed: exit status 1
/tmp/go-link-221588250/000005.o: In function `_cgo_f36fc5609ae4_C2func_load_simple_bpf':

/src/github.com/docker/libnetwork/vendor/github.com/vishvananda/netlink/bpf_linux.go:77: multiple definition of `_cgo_f36fc5609ae4_C2func_load_simple_bpf'
/tmp/go-link-221588250/000003.o:/src/github.com/vishvananda/netlink/bpf_linux.go:77: first defined here
/tmp/go-link-221588250/000005.o: In function `_cgo_f36fc5609ae4_Cfunc_load_simple_bpf':
/src/github.com/docker/libnetwork/vendor/github.com/vishvananda/netlink/bpf_linux.go:100: multiple definition of `_cgo_f36fc5609ae4_Cfunc_load_simple_bpf'
/tmp/go-link-221588250/000003.o:/src/github.com/vishvananda/netlink/bpf_linux.go:100: first defined here
collect2: error: ld returned 1 exit status

As I understand it, golang libraries should not be using vendoring; only applications.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting commit 54b97aee7814c57789f666c60eb8521b9ee61e92 and the vendored github.com/vishvananda/netlink files, especially bpf_linux.go. Reproduce the build with both github.com/docker/libnetwork/vendor/github.com/vishvananda/netlink and github.com/vishvananda/netlink, then verify that the third-party driver links without duplicate load_simple_bpf definitions.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.