Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ambiguous import when building disruptor with last K6 version #330

Closed
MrsDaehin opened this issue Sep 6, 2023 · 5 comments
Closed

ambiguous import when building disruptor with last K6 version #330

MrsDaehin opened this issue Sep 6, 2023 · 5 comments

Comments

@MrsDaehin
Copy link

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

@liggitt
Copy link

liggitt commented Sep 6, 2023

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

@roobre
Copy link
Collaborator

roobre commented Sep 7, 2023

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.

@MrsDaehin
Copy link
Author

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
Copy link
Collaborator

roobre commented Sep 7, 2023

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!

@MrsDaehin
Copy link
Author

working perfectly :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants