Dockerum run for go plugin is failing with v5.0.7

I was trying to build go lang plugin but its failing
my go-version v1.16.15

docker run --rm -v pwd:/plugin-source tykio/tyk-plugin-compiler:v5.0.7 plugin.so

  • mkdir -p /go/src/github.com/TykTechnologies/plugin_plugin
  • cp -r /plugin-source/go.mod /plugin-source/go.sum /plugin-source/go1.16.15.linux-amd64.tar.gz /plugin-source/user_agent_plugin.go /plugin-source/vendor /go/src/github.com/TykTechnologies/plugin_plugin
  • yes
  • cd /go/src/github.com/TykTechnologies/plugin_plugin
  • ‘[’ -f go.mod ‘]’
  • ‘[’ ‘!’ -d ./vendor ‘]’
  • true
  • rm -rf /go/src/github.com/TykTechnologies/plugin_plugin/vendor/github.com/TykTechnologies/tyk
  • ‘[’ -d ./vendor ‘]’
  • cp -rf /go/src/github.com/TykTechnologies/plugin_plugin/vendor/github.com /go/src/github.com/TykTechnologies/plugin_plugin/vendor/gitlab.devops.mhealth.tech /go/src/github.com/TykTechnologies/plugin_plugin/vendor/golang.org /go/src/github.com/TykTechnologies/plugin_plugin/vendor/google.golang.org /go/src/github.com/TykTechnologies/plugin_plugin/vendor/gopkg.in /go/src/github.com/TykTechnologies/plugin_plugin/vendor/modules.txt /go/src
  • rm -rf /go/src/github.com/TykTechnologies/plugin_plugin/vendor
  • sed ‘s|/go/src/github.com/TykTechnologies/tyk/vendor|/go/src|g’
  • ls -d ‘/go/src/github.com/TykTechnologies/tyk/vendor/github.com//
    ls: cannot access ‘/go/src/github.com/TykTechnologies/tyk/vendor/github.com//’: No such file or directory
  • xargs --no-run-if-empty -d ‘\n’ rm -rf
  • ls -d ‘/go/src/github.com/TykTechnologies/tyk/vendor//
  • sed ‘s|/go/src/github.com/TykTechnologies/tyk/vendor|/go/src|g’
    ls: cannot access ‘/go/src/github.com/TykTechnologies/tyk/vendor//’: No such file or directory
  • grep -v github
  • xargs --no-run-if-empty -d ‘\n’ rm -rf
  • ‘[’ -d /go/src/github.com/TykTechnologies/tyk/vendor ‘]’
  • rm /go/src/modules.txt
  • set +x
    PLUGIN_BUILD_PATH: /go/src/github.com/TykTechnologies/plugin_plugin
    PLUGIN_SOURCE_PATH: /plugin-source
    CC: gcc
    plugin_name: plugin_v5.0.7_linux_amd64.so
  • CGO_ENABLED=1
  • GO111MODULE=off
  • CC=gcc
  • GOOS=linux
  • GOARCH=amd64
  • go build -buildmode=plugin -o plugin_v5.0.7_linux_amd64.so

The Go Programming Language

/go/src/golang.org/x/sys/unix/syscall.go:83:16: undefined: unsafe.Slice
/go/src/golang.org/x/sys/unix/syscall_linux.go:1018:20: undefined: unsafe.Slice
/go/src/golang.org/x/sys/unix/syscall_linux.go:2289:9: undefined: unsafe.Slice
/go/src/golang.org/x/sys/unix/syscall_unix.go:118:7: undefined: unsafe.Slice
/go/src/golang.org/x/sys/unix/sysvshm_unix.go:33:7: undefined: unsafe.Slice

github.com/cespare/xxhash/v2

…/…/cespare/xxhash/v2/xxhash_asm.go:12:6: Sum64 redeclared in this block
previous declaration at …/…/cespare/xxhash/v2/xxhash_amd64.go:10:22
…/…/cespare/xxhash/v2/xxhash_asm.go:15:6: writeBlocks redeclared in this block
previous declaration at …/…/cespare/xxhash/v2/xxhash_amd64.go:13:39

@Olu any possible reason for this?

Hi @Swamy_M_S ,

The issue is within the vendor directory. Please remove or rename it and try the build again.

Cheers,
Pete