We’re trying to compile a Golang plugin which uses GRPC. Compiling the plugin on MacOS works fine, but when using the recommended Docker image tyk-plugin-compiler the build fails.
Command used for compilation (Tyk version v4.0.3)
docker run --rm -v $(pwd):/plugin-source tykio/tyk-plugin-compiler:v4.0.3 my-post-plugin.so
go.mod file:
module my_plugin
go 1.15
replace github.com/jensneuse/graphql-go-tools => github.com/TykTechnologies/graphql-go-tools v1.6.2-0.20220426094453-0cc35471c1ca
require (
github.com/TykTechnologies/tyk v1.9.2-0.20220614105651-6c76e802a298
github.com/authzed/authzed-go v0.6.0
github.com/authzed/grpcutil v0.0.0-20220104222419-f813f77722e5
)
We’re getting the following error during compilation:
+ GO111MODULE=off
+ go build -buildmode=plugin -o my-post-plugin.so
../github.com/authzed/authzed-go/proto/authzed/api/v1/permission_service.pb.go:11:2: cannot find package "google.golang.org/genproto/googleapis/api/annotations" in any of:
/usr/local/go/src/google.golang.org/genproto/googleapis/api/annotations (from $GOROOT)
/go/src/google.golang.org/genproto/googleapis/api/annotations (from $GOPATH)
../github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go:11:2: cannot find package "google.golang.org/genproto/googleapis/api/httpbody" in any of:
/usr/local/go/src/google.golang.org/genproto/googleapis/api/httpbody (from $GOROOT)
/go/src/google.golang.org/genproto/googleapis/api/httpbody (from $GOPATH)
../github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go:9:2: cannot find package "google.golang.org/genproto/protobuf/field_mask" in any of:
/usr/local/go/src/google.golang.org/genproto/protobuf/field_mask (from $GOROOT)
/go/src/google.golang.org/genproto/protobuf/field_mask (from $GOPATH)
../github.com/authzed/grpcutil/middleware.go:12:2: cannot find package "google.golang.org/grpc/health" in any of:
/usr/local/go/src/google.golang.org/grpc/health (from $GOROOT)
/go/src/google.golang.org/grpc/health (from $GOPATH)
../github.com/authzed/grpcutil/middleware.go:13:2: cannot find package "google.golang.org/grpc/health/grpc_health_v1" in any of:
/usr/local/go/src/google.golang.org/grpc/health/grpc_health_v1 (from $GOROOT)
/go/src/google.golang.org/grpc/health/grpc_health_v1 (from $GOPATH)
../github.com/authzed/grpcutil/reflection.go:5:2: cannot find package "google.golang.org/grpc/reflection" in any of:
/usr/local/go/src/google.golang.org/grpc/reflection (from $GOROOT)
/go/src/google.golang.org/grpc/reflection (from $GOPATH)
../github.com/authzed/grpcutil/reflection.go:6:2: cannot find package "google.golang.org/grpc/reflection/grpc_reflection_v1alpha" in any of:
/usr/local/go/src/google.golang.org/grpc/reflection/grpc_reflection_v1alpha (from $GOROOT)
/go/src/google.golang.org/grpc/reflection/grpc_reflection_v1alpha (from $GOPATH)
../github.com/grpc-ecosystem/grpc-gateway/v2/runtime/convert.go:9:2: cannot find package "google.golang.org/protobuf/encoding/protojson" in any of:
/usr/local/go/src/google.golang.org/protobuf/encoding/protojson (from $GOROOT)
/go/src/google.golang.org/protobuf/encoding/protojson (from $GOPATH)
../github.com/envoyproxy/protoc-gen-validate/validate/validate.pb.go:12:2: cannot find package "google.golang.org/protobuf/types/descriptorpb" in any of:
/usr/local/go/src/google.golang.org/protobuf/types/descriptorpb (from $GOROOT)
/go/src/google.golang.org/protobuf/types/descriptorpb (from $GOPATH)
../github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options/openapiv2.pb.go:12:2: cannot find package "google.golang.org/protobuf/types/known/structpb" in any of:
/usr/local/go/src/google.golang.org/protobuf/types/known/structpb (from $GOROOT)
/go/src/google.golang.org/protobuf/types/known/structpb (from $GOPATH)
../github.com/grpc-ecosystem/grpc-gateway/v2/runtime/convert.go:12:2: cannot find package "google.golang.org/protobuf/types/known/wrapperspb" in any of:
/usr/local/go/src/google.golang.org/protobuf/types/known/wrapperspb (from $GOROOT)
/go/src/google.golang.org/protobuf/types/known/wrapperspb (from $GOPATH)
../github.com/authzed/grpcutil/x509util.go:6:2: cannot find package "io/fs" in any of:
/usr/local/go/src/io/fs (from $GOROOT)
/go/src/io/fs (from $GOPATH)
Is there some limitation on the dependencies that a plugin is allowed to use?
Kind regards, Barry