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

Cannot download 1.8.0 with modules #886

Closed
kernle32dll opened this issue Mar 1, 2019 · 6 comments
Closed

Cannot download 1.8.0 with modules #886

kernle32dll opened this issue Mar 1, 2019 · 6 comments

Comments

@kernle32dll
Copy link

kernle32dll commented Mar 1, 2019

Well, I just tried to update my project's dependencies, and things broke apart.
Seems like its not possible to get grpc-gateway at the moment:

Steps you follow to reproduce the error:

$ go get -u github.com/grpc-ecosystem/grpc-gateway
go: github.com/go-resty/[email protected]: parsing go.mod: unexpected module path "gopkg.in/resty.v1"
go: finding golang.org/x/sys latest
go: finding golang.org/x/net latest
go get: error loading module requirements

FYI, go get github.com/grpc-ecosystem/[email protected] is just as broken.

What did you expect to happen instead:

Work?

What's your theory on why it isn't working:

grpc-gateway is using the wrong import path - its seems the replace directive in go.mod does not propagate properly?

https://github.com/go-resty/resty#installation
go-resty/resty#230

Not directly related issue, but a discussion and reference for impact of "unexpected module path":
golang/lint#436

EDIT: I was a bit fast on naming the issue - please correct as seen fit.

@kernle32dll kernle32dll changed the title Cannot pull 1.8 as dependency Cannot download 1.8.0 with modules Mar 1, 2019
@johanbrandhorst
Copy link
Collaborator

Argh, sorry about this. I figured this was working since the Go mod things we're running in CI didn't throw up any errors. Do you have any ideas for fixing this?

@kernle32dll
Copy link
Author

kernle32dll commented Mar 1, 2019

Well, there is two things.

First, is the question if the replace directive should propagate - I am not sure, as the go module documentation is not sufficiently clear about this (imo). However, I have a strong sense they don't. See the last paragraph here (emphasis by me):

exclude and replace directives only operate on the current (“main”) module. exclude and replace directives in modules other than the main module are ignored when building the main module. The replace and exclude statements therefore allow the main module complete control over its own build, without also being subject to complete control by dependencies. (See FAQ below for discussion of when to use a replace directive).

So, as how to fix this.... The only thing I can think of then is to go search&replace and fix the import paths everywhere :/ Option B might be to use v2 of resty, but I have no insight of the state of that version (as its still in development).

@johanbrandhorst
Copy link
Collaborator

We've long discussed replacing the OpenAPI generator we use which is what is causing this import dependency - none of the runtime actually depends on resty. So that's another option. I'll try and work on this tomorrow and see what I can find. If this is blocking you right now and you find a solution, please open a PR and I'd be happy to review it.

@kernle32dll
Copy link
Author

Thanks, no worries ;-)

FYI, I totally forgot to mention how to workaround this, if someone is seriously blocked by this: As mentioned in linked resty issue above, you can use the same replace directive in your go.mod depending on grpc-gateway (either directly or indirectly).

@johanbrandhorst
Copy link
Collaborator

This was closed a bit prematurely, but please test https://github.com/grpc-ecosystem/grpc-gateway/releases/tag/v1.8.1-pre1 and see if that fixes it. Once someone has confirmed this is working I will prepare v1.8.1 proper and close this issue.

@johanbrandhorst
Copy link
Collaborator

I've confirmed this is working with both v1.8.1-pre1 and v1.8.1. Thanks for raising this issue.

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

No branches or pull requests

2 participants