containerd / containerd/containerd
containerd can not be used with github.com/u-root/u-root due to genproto dependencies
- Dominant language
- Go
- Stars
- 21.3k
- Forks
- 4.1k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 92
Description
### Description
we would like to bulid compact images, containing containerd, integrated into u-root, as part of k4s (kuties) project.
But we've hit a snag: containerd can not be build in a 'go work' environment. Here is a simple reproducer.
I suspect there are other cases where building in a 'go work'-style environment might be useful.
I've tried to fix this, and will continue to try, but perhaps you can do a much better job than I.
### Steps to reproduce the issue
```
rminnich@pop-os:~/k4s/containerd$ cd /tmp
rminnich@pop-os:/tmp$ mkdir x
rminnich@pop-os:/tmp$ cd x
rminnich@pop-os:/tmp/x$ git clone --depth 1 github.com:containerd/containerd.git
Cloning into 'containerd'...
remote: Enumerating objects: 7482, done.
remote: Counting objects: 100% (7482/7482), done.
remote: Compressing objects: 100% (6065/6065), done.
remote: Total 7482 (delta 1454), reused 3924 (delta 889), pack-reused 0 (from 0)
Receiving objects: 100% (7482/7482), 11.95 MiB | 9.97 MiB/s, done.
Resolving deltas: 100% (1454/1454), done.
rminnich@pop-os:/tmp/x$ ls
containerd
rminnich@pop-os:/tmp/x$ go work init containerd/
go: containerd/go.mod requires go >= 1.26.2; switching to go1.26.2
rminnich@pop-os:/tmp/x$ go build ./containerd/cmd/containerd
go: downloading github.com/urfave/cli v1.22.16
go: downloading github.com/pelletier/go-toml v1.9.5
go: downloading github.com/russross/blackfriday v1.6.0
/home/rminnich/go/pkg/mod/github.com/containerd/ttrpc@v1.2.8/request.pb.go:10:2: ambiguous import: found package google.golang.org/genproto/googleapis/rpc/status in multiple modules:
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 (/home/rminnich/go/pkg/mod/google.golang.org/genproto@v0.0.0-20230410155749-daa745c078e1/googleapis/rpc/status)
google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 (/home/rminnich/go/pkg/mod/google.golang.org/genproto/googleapis/rpc@v0.0.0-20260401024825-9d38bb4040a9/status)
/home/rminnich/go/pkg/mod/github.com/grpc-ecosystem/grpc-gateway/v2@v2.28.0/runtime/handler.go:13:2: ambiguous import: found package google.golang.org/genproto/googleapis/api/httpbody in multiple modules:
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 (/home/rminnich/go/pkg/mod/google.golang.org/genproto@v0.0.0-20230410155749-daa745c078e1/googleapis/api/httpbody)
google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 (/home/rminnich/go/pkg/mod/google.golang.org/genproto/googleapis/api@v0.0.0-20260401024825-9d38bb4040a9/httpbody)
/home/rminnich/go/pkg/mod/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc@v1.43.0/client.go:14:2: ambiguous import: found package google.golang.org/genproto/googleapis/rpc/errdetails in multiple modules:
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 (/home/rminnich/go/pkg/mod/google.golang.org/genproto@v0.0.0-20230410155749-daa745c078e1/googleapis/rpc/errdetails)
google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 (/home/rminnich/go/pkg/mod/google.golang.org/genproto/googleapis/rpc@v0.0.0-20260401024825-9d38bb4040a9/errdetails)
containerd/plugins/services/introspection/local.go:29:2: ambiguous import: found package google.golang.org/genproto/googleapis/rpc/code in multiple modules:
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 (/home/rminnich/go/pkg/mod/google.golang.org/genproto@v0.0.0-20230410155749-daa745c078e1/googleapis/rpc/code)
google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 (/home/rminnich/go/pkg/mod/google.golang.org/genproto/googleapis/rpc@v0.0.0-20260401024825-9d38bb4040a9/code)
rminnich@pop-os:/tmp/x$
```
### Describe the results you received and expected
I hoped it would build, as it does without the go.work in the parent directory.
### What version of containerd are you using?
tag: v2.3.0-rc.0
### Any other relevant information
This fails on any go 1.26 on and OS.
### Show configuration if it is related to CRI plugin.
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.