Generating the proto libraries can be tricky without proper setup. This document describes how to set up the environment to generate the proto libraries. Please follow the steps below exactly to avoid any issues.
-
Ensure that Go is installed and the
GOPATH
environment variable is set. -
Install Proto Buffer compiler (
protoc
) version 3.0.0 or higher.-
Download the latest version of
protoc
from here. -
Unzip and copy the
protoc
binary to a directory in yourPATH
environment variable. i.e. for linuxunzip protoc-24.3-linux-x86_64.zip -d $HOME/.local export PATH="$PATH:$HOME/.local/bin"
-
Ensure
protoc
is installed and reachable by runningprotoc --version
in a terminal. -
Important Ensure there is a
include
directory containingproto
files. i.e. for linux# .local # ├── bin # │ └── protoc # └── include # └── google # └── protobuf # └── <proto-files> ls $HOME/.local/include/google/protobuf any.proto any_test.proto api.proto compiler descriptor.proto descriptor_test.proto empty.proto struct.proto struct_test.proto timestamp.proto timestamp_test.proto type.proto type_test.proto wrappers.proto wrappers_test.proto
-
-
Install plugins required for Tekton Results proto library generation.
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest go install google.golang.org/protobuf/cmd/protoc-gen-go@latest go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
Here we will use go generate to generate the proto libraries. The proto libraries
are generated in the proto
directory.
-
Change the directory to
proto
directory.cd proto
-
Make your changes to the proto files. If you are adding a new plugin please update this document with the steps to install the plugin.
-
Run Go Generate
go generate ./...
This will generate the proto libraries in the proto
directory. Please report any issues
with the above steps.