Skip to content

Migrate from protobuild to buf#12762

Merged
fuweid merged 10 commits intocontainerd:mainfrom
mxpv:proto
Jan 9, 2026
Merged

Migrate from protobuild to buf#12762
fuweid merged 10 commits intocontainerd:mainfrom
mxpv:proto

Conversation

@mxpv
Copy link
Member

@mxpv mxpv commented Jan 8, 2026

This PR migrates from Protobuild (which we all love and use for quite some time) to buf to manage our proto files.

Immediate benefits:

  • No need to install protoc dependency. Mush simpler CI setup.
  • Much better local/CI reproducibility - all generators and dependencies are pinned in buf.yaml and buf.lock, so same output is expected everywhere. Only the buf binary need to be installed on the system to get things going.
  • No longer needs containerd to be in GOPATH (not strictly buf’s feature, but implemented in this PR)

There are also some longer term nice-to-have features that we could benefit from, which we don't have in protobuild:

  • Breaking change detector (we can run this on CI to guaranty API compatibility)
  • Linter
  • Formatter.

I was able to generate exactly the same code with buf as it was before.
The only annoying thing is

// protoc (unknown)

which seems to be expected when buf is not using external protoc binary (which we don't):

The protoc (unknown) line is being inserted by protoc-gen-go which we do not control. Part of the CodeGeneratorRequest passed to protoc-gen-go specifies the version of protoc being used, but buf is not, and doesn't use, protoc, so there is no appropriate answer here.

Made a few follow up changes based on feedback:

  • Switched to relative imports (which buf supports natively), so workarounds in the Makefile no longer necessary.
  • Moved buf configuration files under api/ directory

mxpv added 3 commits January 8, 2026 15:12
Signed-off-by: Maksym Pavlenko <[email protected]>
Signed-off-by: Maksym Pavlenko <[email protected]>
Signed-off-by: Maksym Pavlenko <[email protected]>
@mxpv mxpv marked this pull request as ready for review January 8, 2026 23:41
@dosubot dosubot bot added the area/toolchain Build and Release Toolchain label Jan 8, 2026
@dmcgowan dmcgowan added this to the 2.3 milestone Jan 9, 2026
mxpv added 2 commits January 8, 2026 16:51
Signed-off-by: Maksym Pavlenko <[email protected]>
Signed-off-by: Maksym Pavlenko <[email protected]>
Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


  1. protoc: (unknown) is not bug. bufbuild/buf#3913
  2. We should have follow-up to cleanup warning from buf
+ protos
(cd api && buf dep update)
(cd api && PATH="/home/fuweid/go/src/github.com/containerd/containerd//bin:$PATH" buf generate)
WARN    plugin "protoc-gen-go-fieldpath" does not support required features.
  Feature "proto3 optional" is required by 1 file(s):
    services/images/v1/images.proto

REF: https://github.com/bufbuild/buf/blob/b74d4bbf123b7486b90a12ef666fd2730eec7904/private/buf/bufgen/features.go#L160

@github-project-automation github-project-automation bot moved this from Needs Triage to Review In Progress in Pull Request Review Jan 9, 2026
@fuweid fuweid added this pull request to the merge queue Jan 9, 2026
Merged via the queue into containerd:main with commit a49ed60 Jan 9, 2026
52 checks passed
@github-project-automation github-project-automation bot moved this from Review In Progress to Done in Pull Request Review Jan 9, 2026
kzys added a commit to containerd/cgroups that referenced this pull request Feb 27, 2026
Like containerd did recently, we can migrate from protobuild to buf.

containerd/containerd#12762

Co-Authored-By: Claude Opus 4.6 <[email protected]>
kzys added a commit to containerd/cgroups that referenced this pull request Feb 27, 2026
Like containerd did recently, we can migrate from protobuild to buf.

containerd/containerd#12762

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: Kazuyoshi Kato <[email protected]>
kzys added a commit to containerd/cgroups that referenced this pull request Feb 27, 2026
Like containerd did recently, we can migrate from protobuild to buf.

containerd/containerd#12762

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: Kazuyoshi Kato <[email protected]>
kzys added a commit to containerd/cgroups that referenced this pull request Mar 5, 2026
Like containerd did recently, we can migrate from protobuild to buf.

containerd/containerd#12762

Signed-off-by: Kazuyoshi Kato <[email protected]>
kzys added a commit to containerd/cgroups that referenced this pull request Mar 5, 2026
Like containerd did recently, we can migrate from protobuild to buf.

containerd/containerd#12762

Signed-off-by: Kazuyoshi Kato <[email protected]>
kzys added a commit to containerd/cgroups that referenced this pull request Mar 5, 2026
Like containerd did recently, we can migrate from protobuild to buf.

containerd/containerd#12762

Signed-off-by: Kazuyoshi Kato <[email protected]>
kzys added a commit to containerd/cgroups that referenced this pull request Mar 5, 2026
Like containerd did recently, we can migrate from protobuild to buf.

containerd/containerd#12762

Signed-off-by: Kazuyoshi Kato <[email protected]>
kzys added a commit to containerd/cgroups that referenced this pull request Mar 5, 2026
Like containerd did recently, we can migrate from protobuild to buf.

containerd/containerd#12762

Signed-off-by: Kazuyoshi Kato <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/toolchain Build and Release Toolchain size/XXL

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants