What is the problem you're trying to solve
Importing the plugin standard library package makes binaries significantly bigger, due to disabling some dead code elimination (cmd/link/internal/ld/deadcode.go) and symbol names being longer (cmd/link/internal/ld/lib.go).
github.com/containerd/containerd imports github.com/containerd/containerd/plugin which imports plugin on amd64:

As shown in DataDog/datadog-agent#32538, just removing the import on amd64 reduces the size of one of our binaries from 218MB to 150MB (-31%).
I would like to suggest adding a specific build tag to remove this import. I know using the static_build tag would do the same, but since it is used by many other dependencies I'm worried it would have unexpected consequences...
Describe the solution you'd like
Have a way to use containerd v1 types and functions without having to import the plugin package, and without changing behavior of other dependencies.
Additional context
No response
What is the problem you're trying to solve
Importing the
pluginstandard library package makes binaries significantly bigger, due to disabling some dead code elimination (cmd/link/internal/ld/deadcode.go) and symbol names being longer (cmd/link/internal/ld/lib.go).github.com/containerd/containerdimportsgithub.com/containerd/containerd/pluginwhich importspluginon amd64:As shown in DataDog/datadog-agent#32538, just removing the import on amd64 reduces the size of one of our binaries from 218MB to 150MB (-31%).
I would like to suggest adding a specific build tag to remove this import. I know using the
static_buildtag would do the same, but since it is used by many other dependencies I'm worried it would have unexpected consequences...Describe the solution you'd like
Have a way to use
containerdv1 types and functions without having to import thepluginpackage, and without changing behavior of other dependencies.Additional context
No response