krakend-ce icon indicating copy to clipboard operation
krakend-ce copied to clipboard

Plugin build failing with 2.0

Open henrisokka opened this issue 2 years ago • 3 comments

When trying to build plugins for 2.0 with it's dependencies we got following error:

# github.com/klauspost/compress/zstd/internal/xxhash
asm: xxhash_amd64.s:120: when dynamic linking, R15 is clobbered by a global variable access and is used here: 00092 (/go/pkg/mod/github.com/klauspost/[email protected]/zstd/internal/xxhash/xxhash_amd64.s:120)       ADDQ    R15, AX
asm: assembly failed

The dependency klauspost/compress has already patched the bug (https://github.com/klauspost/compress/pull/430) but you're InfluxDB-library seems to be still using old version through it's github.com/influxdata/influxdb -dependency

We were able to workaround the issue by just editing go.mod to github.com/klauspost/compress v1.13.6 and build a new Docker image.

Steps to reproduce:

  1. clone krakend-ce and go to folder
  2. git checkout tags/v2.0.0
  3. copy your plugin code to krakend-ce/plugins
  4. go build -buildmode=plugin plugins/plugin.go

henrisokka avatar Mar 17 '22 08:03 henrisokka

Check my Issue #437 and you need update xxhash to version v2.1.2 to solve it

flyznex avatar Mar 18 '22 02:03 flyznex

Hi @henrisokka can you share some plugin example to trigger this error? With my current plugins I cannot reproduce it. Also please, fill the template that appears when you open the issue with your environment, versions and any other useful info.

taik0 avatar Mar 18 '22 14:03 taik0

I'm running into this issue as well after upgrading to v2.0.0. Running the following command in this repo points to krakend-opensensus using an old version of prometheus:

$ go mod why github.com/cespare/xxhash/v2
# github.com/cespare/xxhash/v2
github.com/devopsfaith/krakend-ce/v2
github.com/devopsfaith/krakend-opencensus/v2/exporter/prometheus
github.com/prometheus/client_golang/prometheus
github.com/cespare/xxhash/v2

In my case, a plugin I built is using the cespare/xxhash/v2 library as a result of using github.com/go-redis/redis/v8 v8.11.5:

$ go mod why github.com/cespare/xxhash/v2
# github.com/cespare/xxhash/v2
github.com/my-org/my-project/plugins/my-plugin
github.com/go-redis/redis/v8
github.com/cespare/xxhash/v2

Adding the following replace to my go.mod allows the plugin to build, but it fails to load since it's using a different version of cespare/xxhash/v2 than what's used here in KrakenD:

replace github.com/cespare/xxhash/v2 v2.1.2 => github.com/cespare/xxhash/v2 v2.1.1

chrismeyers avatar Mar 31 '22 17:03 chrismeyers

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] avatar Sep 30 '22 03:09 github-actions[bot]

This issue was closed because it has been marked as stalled for 15 days with no activity.

github-actions[bot] avatar Oct 15 '22 10:10 github-actions[bot]

This issue was marked as resolved a long time ago and now has been automatically locked as there has not been any recent activity after it. You can still open a new issue and reference this link.

github-actions[bot] avatar Jan 14 '23 10:01 github-actions[bot]