grafana/xk6-disruptor

ambiguous import when building disruptor with last K6 version

Closed this issue · 5 comments

I have tried to build a new binary with last version of k6 and the disruptor extension

docker run --rm -it -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" grafana/xk6 build v0.46.0
--with github.com/grafana/xk6-disruptor

It results in the following error
k6 imports
github.com/grafana/xk6-disruptor imports
go.k6.io/k6/js/modules imports
go.k6.io/k6/loader tested by
go.k6.io/k6/loader.test imports
go.k6.io/k6/lib/testutils/httpmultibin imports
google.golang.org/grpc/status imports
google.golang.org/genproto/googleapis/rpc/status: ambiguous import: found package google.golang.org/genproto/googleapis/rpc/status in multiple modules:
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 (/go/pkg/mod/google.golang.org/genproto@v0.0.0-20230410155749-daa745c078e1/googleapis/rpc/status)
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 (/go/pkg/mod/google.golang.org/genproto/googleapis/rpc@v0.0.0-20230525234030-28d5490b6b19/status)

I have tried to clean and update dependencies with no luck finding a jsonpb reference that cannot be solved.

Workaround: it works still with older versions

go get google.golang.org/genproto@latest should resolve the issue. see googleapis/go-genproto#1015 for details

roobre commented

Hi, thanks @MrsDaehin for reporting this and @liggitt for your pointer!

It seems that the issue at hand was slightly more complicated, and stemmed from a desync between the the disruptor imports and k6's core imports. In the long term, both this repository and k6 core should upgrade to the new submodules.

I have forcefully synced disruptor's grpc-related dependencies to the versions k6 core uses, and build seems to be working so far if you point to the commit where I made the change:

docker run --rm -it -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" grafana/xk6 build v0.46.0 --with github.com/grafana/xk6-disruptor@e1e50d5c92cf5eb799614769e088e12625f2c0cb

I'll make a patch release soon to unbreak build when using @latest.

A better question would be why the CI was able to build this successfully: https://github.com/grafana/xk6-disruptor/actions/runs/6027488403/job/16352789989

I'll follow up with the rest of k6 to see if we can figure this out.

Sorry i didn't answer @liggitt , it was just what i tried and i saw there was a dependency i got stuck on ( that reference to jsonpb i was not able to solve -.- )

Thanks @roobre :) i will try it out tomorrow as i am on my way to a k6 workshop in galicia ;)

roobre commented

Awesome, v0.3.9 should be out now and it appears to be building correctly to me. In case it didn't work for you please let us know!

Have fun in as terras galegas!

working perfectly :)