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 import any version above 3.0.0 using 'dep' package manager #349

Closed
dandee opened this issue Oct 1, 2018 · 5 comments
Closed

Cannot import any version above 3.0.0 using 'dep' package manager #349

dandee opened this issue Oct 1, 2018 · 5 comments

Comments

@dandee
Copy link

dandee commented Oct 1, 2018

An application can import chi package using dep package manager only when requesting version '3.0.0' or '3'. When trying to request anything above this version an error occurs. For example I'm trying to get most recent (3.3.3) version pulled to get more middleware available and fail with the following:

cd src/prjkt-api && GOPATH=/Users/deeee/prjkt /usr/local/bin/dep ensure
Solving failure: No versions of github.com/go-chi/chi met constraints:
	v3.0.0: Could not introduce github.com/go-chi/chi@v3.0.0, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	v3.3.3: Could not introduce github.com/go-chi/chi@v3.3.3, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.3.2: Could not introduce github.com/go-chi/chi@v3.3.2, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	v3.3.1: Could not introduce github.com/go-chi/chi@v3.3.1, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	v3.3.0: Could not introduce github.com/go-chi/chi@v3.3.0, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	v3.2.1: Could not introduce github.com/go-chi/chi@v3.2.1, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	v3.2.0: Could not introduce github.com/go-chi/chi@v3.2.0, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	v3.1.5: Could not introduce github.com/go-chi/chi@v3.1.5, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	v3.1.4: Could not introduce github.com/go-chi/chi@v3.1.4, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	v3.1.3: Could not introduce github.com/go-chi/chi@v3.1.3, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	v3.1.2: Could not introduce github.com/go-chi/chi@v3.1.2, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	v3.1.1: Could not introduce github.com/go-chi/chi@v3.1.1, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	v3.1.0: Could not introduce github.com/go-chi/chi@v3.1.0, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	v2.1.0: Could not introduce github.com/go-chi/chi@v2.1.0, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	v2.0.0: Could not introduce github.com/go-chi/chi@v2.0.0, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	v1.0.0: Could not introduce github.com/go-chi/chi@v1.0.0, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	v0.9.0: Could not introduce github.com/go-chi/chi@v0.9.0, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	master: Could not introduce github.com/go-chi/chi@master, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	v1: Could not introduce github.com/go-chi/chi@v1, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	v2: Could not introduce github.com/go-chi/chi@v2, as it is not allowed by constraint >=3.3.3 from project prjkt-api.
	v2.0.0rc1: Could not introduce github.com/go-chi/chi@v2.0.0rc1, as it is not allowed by constraint >=3.3.3 from project prjkt-api.

when I try to lower required version to 3.3.2 it still complains the same about missing subpackage "github.com/go-chi/chi/render" and fails.

@dandee
Copy link
Author

dandee commented Oct 1, 2018

It seems that it goes back deeper until version 3.1.0:

(edited Gopkg.toml file to require the following versions of 'chi': "3.3", "3.2", "3.1")

cd src/prjkt-api && GOPATH=/Users/danielk/Work/prjkt /usr/local/bin/dep ensure
Solving failure: No versions of github.com/go-chi/chi met constraints:
	v3.3.3: Could not introduce github.com/go-chi/chi@v3.3.3, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.3.2: Could not introduce github.com/go-chi/chi@v3.3.2, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.3.1: Could not introduce github.com/go-chi/chi@v3.3.1, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.3.0: Could not introduce github.com/go-chi/chi@v3.3.0, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.2.1: Could not introduce github.com/go-chi/chi@v3.2.1, as it is not allowed by constraint ^3.3.0 from project prjkt-api.
	v3.2.0: Could not introduce github.com/go-chi/chi@v3.2.0, as it is not allowed by constraint ^3.3.0 from project prjkt-api.
	v3.1.5: Could not introduce github.com/go-chi/chi@v3.1.5, as it is not allowed by constraint ^3.3.0 from project prjkt-api.
	v3.1.4: Could not introduce github.com/go-chi/chi@v3.1.4, as it is not allowed by constraint ^3.3.0 from project prjkt-api.
	v3.1.3: Could not introduce github.com/go-chi/chi@v3.1.3, as it is not allowed by constraint ^3.3.0 from project prjkt-api.
	v3.1.2: Could not introduce github.com/go-chi/chi@v3.1.2, as it is not allowed by constraint ^3.3.0 from project prjkt-api.
	v3.1.1: Could not introduce github.com/go-chi/chi@v3.1.1, as it is not allowed by constraint ^3.3.0 from project prjkt-api.
	v3.1.0: Could not introduce github.com/go-chi/chi@v3.1.0, as it is not allowed by constraint ^3.3.0 from project prjkt-api.
	v3.0.0: Could not introduce github.com/go-chi/chi@v3.0.0, as it is not allowed by constraint ^3.3.0 from project prjkt-api.
	v2.1.0: Could not introduce github.com/go-chi/chi@v2.1.0, as it is not allowed by constraint ^3.3.0 from project prjkt-api.
	v2.0.0: Could not introduce github.com/go-chi/chi@v2.0.0, as it is not allowed by constraint ^3.3.0 from project prjkt-api.
	v1.0.0: Could not introduce github.com/go-chi/chi@v1.0.0, as it is not allowed by constraint ^3.3.0 from project prjkt-api.
	v0.9.0: Could not introduce github.com/go-chi/chi@v0.9.0, as it is not allowed by constraint ^3.3.0 from project prjkt-api.
	master: Could not introduce github.com/go-chi/chi@master, as it is not allowed by constraint ^3.3.0 from project prjkt-api.
	v1: Could not introduce github.com/go-chi/chi@v1, as it is not allowed by constraint ^3.3.0 from project prjkt-api.
	v2: Could not introduce github.com/go-chi/chi@v2, as it is not allowed by constraint ^3.3.0 from project prjkt-api.
	v2.0.0rc1: Could not introduce github.com/go-chi/chi@v2.0.0rc1, as it is not allowed by constraint ^3.3.0 from project prjkt-api.
make: *** [src/prjkt-api/Gopkg.lock] Error 1
➜  prjkt ✗ make build
cd src/prjkt-api && GOPATH=/Users/danielk/Work/prjkt /usr/local/bin/dep ensure
Solving failure: No versions of github.com/go-chi/chi met constraints:
	v3.3.3: Could not introduce github.com/go-chi/chi@v3.3.3, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.3.2: Could not introduce github.com/go-chi/chi@v3.3.2, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.3.1: Could not introduce github.com/go-chi/chi@v3.3.1, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.3.0: Could not introduce github.com/go-chi/chi@v3.3.0, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.2.1: Could not introduce github.com/go-chi/chi@v3.2.1, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.2.0: Could not introduce github.com/go-chi/chi@v3.2.0, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.1.5: Could not introduce github.com/go-chi/chi@v3.1.5, as it is not allowed by constraint ^3.2.0 from project prjkt-api.
	v3.1.4: Could not introduce github.com/go-chi/chi@v3.1.4, as it is not allowed by constraint ^3.2.0 from project prjkt-api.
	v3.1.3: Could not introduce github.com/go-chi/chi@v3.1.3, as it is not allowed by constraint ^3.2.0 from project prjkt-api.
	v3.1.2: Could not introduce github.com/go-chi/chi@v3.1.2, as it is not allowed by constraint ^3.2.0 from project prjkt-api.
	v3.1.1: Could not introduce github.com/go-chi/chi@v3.1.1, as it is not allowed by constraint ^3.2.0 from project prjkt-api.
	v3.1.0: Could not introduce github.com/go-chi/chi@v3.1.0, as it is not allowed by constraint ^3.2.0 from project prjkt-api.
	v3.0.0: Could not introduce github.com/go-chi/chi@v3.0.0, as it is not allowed by constraint ^3.2.0 from project prjkt-api.
	v2.1.0: Could not introduce github.com/go-chi/chi@v2.1.0, as it is not allowed by constraint ^3.2.0 from project prjkt-api.
	v2.0.0: Could not introduce github.com/go-chi/chi@v2.0.0, as it is not allowed by constraint ^3.2.0 from project prjkt-api.
	v1.0.0: Could not introduce github.com/go-chi/chi@v1.0.0, as it is not allowed by constraint ^3.2.0 from project prjkt-api.
	v0.9.0: Could not introduce github.com/go-chi/chi@v0.9.0, as it is not allowed by constraint ^3.2.0 from project prjkt-api.
	master: Could not introduce github.com/go-chi/chi@master, as it is not allowed by constraint ^3.2.0 from project prjkt-api.
	v1: Could not introduce github.com/go-chi/chi@v1, as it is not allowed by constraint ^3.2.0 from project prjkt-api.
	v2: Could not introduce github.com/go-chi/chi@v2, as it is not allowed by constraint ^3.2.0 from project prjkt-api.
	v2.0.0rc1: Could not introduce github.com/go-chi/chi@v2.0.0rc1, as it is not allowed by constraint ^3.2.0 from project prjkt-api.
make: *** [src/prjkt-api/Gopkg.lock] Error 1
➜  prjkt ✗ make build
cd src/prjkt-api && GOPATH=/Users/danielk/Work/prjkt /usr/local/bin/dep ensure
Solving failure: No versions of github.com/go-chi/chi met constraints:
	v3.3.3: Could not introduce github.com/go-chi/chi@v3.3.3, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.3.2: Could not introduce github.com/go-chi/chi@v3.3.2, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.3.1: Could not introduce github.com/go-chi/chi@v3.3.1, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.3.0: Could not introduce github.com/go-chi/chi@v3.3.0, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.2.1: Could not introduce github.com/go-chi/chi@v3.2.1, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.2.0: Could not introduce github.com/go-chi/chi@v3.2.0, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.1.5: Could not introduce github.com/go-chi/chi@v3.1.5, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.1.4: Could not introduce github.com/go-chi/chi@v3.1.4, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.1.3: Could not introduce github.com/go-chi/chi@v3.1.3, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.1.2: Could not introduce github.com/go-chi/chi@v3.1.2, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.1.1: Could not introduce github.com/go-chi/chi@v3.1.1, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.1.0: Could not introduce github.com/go-chi/chi@v3.1.0, as its subpackage github.com/go-chi/chi/render is missing. (Package is required by (root).)
	v3.0.0: Could not introduce github.com/go-chi/chi@v3.0.0, as it is not allowed by constraint ^3.1.0 from project prjkt-api.
	v2.1.0: Could not introduce github.com/go-chi/chi@v2.1.0, as it is not allowed by constraint ^3.1.0 from project prjkt-api.
	v2.0.0: Could not introduce github.com/go-chi/chi@v2.0.0, as it is not allowed by constraint ^3.1.0 from project prjkt-api.
	v1.0.0: Could not introduce github.com/go-chi/chi@v1.0.0, as it is not allowed by constraint ^3.1.0 from project prjkt-api.
	v0.9.0: Could not introduce github.com/go-chi/chi@v0.9.0, as it is not allowed by constraint ^3.1.0 from project prjkt-api.
	master: Could not introduce github.com/go-chi/chi@master, as it is not allowed by constraint ^3.1.0 from project prjkt-api.
	v1: Could not introduce github.com/go-chi/chi@v1, as it is not allowed by constraint ^3.1.0 from project prjkt-api.
	v2: Could not introduce github.com/go-chi/chi@v2, as it is not allowed by constraint ^3.1.0 from project prjkt-api.
	v2.0.0rc1: Could not introduce github.com/go-chi/chi@v2.0.0rc1, as it is not allowed by constraint ^3.1.0 from project prjkt-api.
make: *** [src/prjkt-api/Gopkg.lock] Error 1

@pkieltyka
Copy link
Member

@dandee chi/render was moved to github.com/go-chi/render at some point, perhaps this is the issue you're facing

@dandee
Copy link
Author

dandee commented Oct 2, 2018

I know but I don't want to use go-chi/render. I wanted to get access to the most recent middleware so I tried to reference the most recent version of go-chi/chi and dep gives me the above shit. It seems to me that some dependencies hasn't been fixed properly after separation.

@VojtechVitek
Copy link
Contributor

If you want to use older chi and its built-in chi/render (ie v2.x) but use newer chi/middleware (v3.x) at the same time, I suggest you create a fork from the old chi commit. No dependency manager can do this for you automatically.

However, I strongly suggest to use the latest github.com/go-chi/chi and latest github.com/go-chi/render together. Is there anything in particular, that prevents you from switching?

Also, I'd recommend using go modules (introduced in go1.11), they work much better than dep.

It seems to me that some dependencies hasn't been fixed properly after separation

What do you mean? Afaik, all dependencies work well.

@dandee
Copy link
Author

dandee commented Oct 4, 2018

All right, so it turned out that it was my fault - there was some obscure file still referencing old renderer and it forced dep to select older packages. Turns out that dep is really smart figuring out all project's dependencies. Apologize for taking so much of your time. Thank you.

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