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

Incompatible With Glide Package Manager #50

Closed
armsnyder opened this issue Nov 25, 2018 · 5 comments
Closed

Incompatible With Glide Package Manager #50

armsnyder opened this issue Nov 25, 2018 · 5 comments

Comments

@armsnyder
Copy link

I'm working on a project which uses Glide for Go package management.

In my glide.yml I have:

- package: github.com/mediocregopher/radix
  version: v3.0.0

When I run glide update I get an error:

[ERROR] Error scanning github.com/mediocregopher/radix/v3/resp: cannot find package "." in:
        /Users/asnyder/.glide/cache/src/https-github.com-mediocregopher-radix/v3/resp
[ERROR] Error scanning github.com/mediocregopher/radix/v3/resp/resp2: cannot find package "." in:
        /Users/asnyder/.glide/cache/src/https-github.com-mediocregopher-radix/v3/resp/resp2

For now I have worked around this by adding these additional lines to my glide.yml:

ignore:
- github.com/mediocregopher/radix/v3/resp
- github.com/mediocregopher/radix/v3/resp/resp2

However, by doing this, I am now unable to use any types from the resp package, which means I can't do any custom marshaling/unmarshaling. If I try using one of these types, I get Go compilation errors. For example, this is what I get when I try to mock a Conn type using gomock:

./cache_impl_test.go:56:12: cannot use a (type *mock_radix.MockConn) as type radix.Conn in argument to arg.Run:
	*mock_radix.MockConn does not implement radix.Conn (wrong type for Decode method)
		have Decode("github.com/lyft/ratelimit/vendor/github.com/mediocregopher/radix/resp".Unmarshaler) error
		want Decode("github.com/mediocregopher/radix/resp".Unmarshaler) error

So it looks like ignoring those resp packages in my glide.yml is not the correct approach. I'm not super familiar with Go's new module system, but I think that's related to the issue here. I was not able to find literature online about Glide + Go modules.

Is there a recommended way of using radix with Glide?

I have also tried these other variations of my glide.yml but to no avail.

- package: github.com/mediocregopher/radix/v3
  version: v3.0.0
- package: github.com/mediocregopher/radix
  version: v3.0.0
  subpackages:
  - v3
- package: github.com/mediocregopher/radix
  version: v3.0.0
  subpackages:
  - v3
  - resp
  - resp/resp2
- package: github.com/mediocregopher/radix
  version: v3.0.0
  subpackages:
  - v3
  - v3/resp
  - v3/resp/resp2
@mediocregopher
Copy link
Owner

Hey @armsnyder , it seems like other people are having similar problems with glide, like in this issue. Unfortunately there's not much I can do on my end, and I'm not really familiar with glide at all, but I'd recommend putting your two cents into that thread. Ultimately it's up to glide to properly support go modules.

There's also this message on the glide README:

The Go community now has the dep project to manage dependencies. Please consider trying to migrate from Glide to dep. If there is an issue preventing you from migrating please file an issue with dep so the problem can be corrected. Glide will continue to be supported for some time but is considered to be in a state of support rather than active feature development.

So maybe there's not much they'll do either, you might have to just migrate to dep =/

Gonna go ahead and close this, sorry I couldn't be more helpful here.

@armsnyder
Copy link
Author

Makes sense. Thanks for reading.

@jemartti
Copy link

@mediocregopher I think I'm having a similar issue with dep:

 (master) ~/workspace/go/src/github.com/interspace/v2-api 
jacob-> dep ensure
Solving failure: No versions of github.com/mediocregopher/radix met constraints:
	v3.0.0: "github.com/mediocregopher/radix" imports "github.com/mediocregopher/radix/v3/resp/resp2", which contains malformed code: no package exists at "github.com/mediocregopher/radix/v3/resp/resp2"
	master: "github.com/mediocregopher/radix" imports "github.com/mediocregopher/radix/v3/resp", which contains malformed code: unknown error for "github.com/mediocregopher/radix/v3/resp", if you get this error see https://github.com/golang/dep/issues/351
	v3: "github.com/mediocregopher/radix" imports "github.com/mediocregopher/radix/v3/resp", which contains malformed code: no package exists at "github.com/mediocregopher/radix/v3/resp"

Any suggestions? Things worked fine with radix.v3 up until the module refactor.

@mediocregopher
Copy link
Owner

@jemartti once again there's not much I can do here, the package supports the builtin module system, and there's not much which I can do to support dependency managers which don't support that system. You can try contacting the maintainers of dep and see if they can help you. Sorry to not be much help.

@dcu
Copy link

dcu commented Jan 8, 2019

maybe you can restore the radix.v3 repo with the original code that was working instead of breaking every existing project that was relying on this code

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

4 participants