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.
Pre-requisites
Ensure that Go is installed and the
GOPATH environment variable is set.
Install Proto Buffer compiler (protoc) version 3.0.0 or higher.
Ensure protoc is installed and reachable by running protoc --version in a terminal.
Important Ensure there is a include directory containing proto 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
Generating the proto libraries
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.