Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,20 @@ jobs:
working-directory: src/github.com/containerd/protobuild
run: |
go build .

- name: Install protoc
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protoc-3.17.3-linux-x86_64.zip
sudo unzip -x protoc-3.17.3-linux-x86_64.zip -d /usr/local
sudo chmod -R go+rX /usr/local
sudo chmod go+x /usr/local/bin/protoc

- name: Install protoc-gen-go
run: |
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1

- name: Run protobuild
working-directory: src/github.com/containerd/protobuild
run: |
export PATH=$(go env GOBIN):$PATH
go list ./... | grep -v vendor | xargs ./protobuild
9 changes: 0 additions & 9 deletions Protobuild.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ version = "unstable"
# example that selects the ctrd vanity binary.
# generator = "gogoctrd"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

According to https://grpc.io/docs/languages/go/quickstart/#regenerate-grpc-code, the new command line options for generating gRPC code is like

$ protoc --go_out=. --go_opt=paths=source_relative \
    --go-grpc_out=. --go-grpc_opt=paths=source_relative \
    helloworld/helloworld.proto

So we may need to have multiple generators instead.


# Plugins allows one to specify one or more plugins for use in generation.
#
# The common example grpc is provided below.
plugins = ["grpc"]
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The new Go code generator doesn't support plugins. We may need to deprecate the field.


# Control protoc include paths. Below are usually some good defaults, but feel
# free to try it without them if it works for your project.
[includes]
Expand Down Expand Up @@ -53,10 +48,6 @@ plugins = ["grpc"]
#
# We have a few examples to map packages from the examples.
[packages]
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The package replacement still works, but gogo would not work with the latest protobuf. We may need another packages as an example.

https://developers.google.com/protocol-buffers/docs/reference/go-generated#package

"gogoproto/gogo.proto" = "github.com/gogo/protobuf/gogoproto"
"google/protobuf/descriptor.proto" = "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
"google/protobuf/timestamp.proto" = "github.com/gogo/protobuf/types"
"google/protobuf/empty.proto" = "github.com/gogo/protobuf/types"

# Overrides allows one to specify configuration overrides for specific
# packages. Currently, only overriding the generator and plugin set are
Expand Down
2 changes: 1 addition & 1 deletion descriptors.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"os/exec"
"strings"

"github.com/gogo/protobuf/proto"
"github.com/golang/protobuf/protoc-gen-go/descriptor"
"google.golang.org/protobuf/proto"
)

type descriptorSet struct {
Expand Down
273 changes: 134 additions & 139 deletions examples/bar/bar.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading