Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Dep ensure failing for survey #229

Closed
vermdeep opened this issue Jun 24, 2019 · 11 comments
Closed

Dep ensure failing for survey #229

vermdeep opened this issue Jun 24, 2019 · 11 comments

Comments

@vermdeep
Copy link

I have the following constraint in Gopkg.toml

[[constraint]]
  name = "github.com/AlecAivazis/survey"
  version = "2.0.0"

Dep ensure with the above constraint is failing with error:

v2.0.0:  "github.com/AlecAivazis/survey" imports "github.com/AlecAivazis/survey/v2/core", which contains malformed code: no package exists at "github.com/AlecAivazis/survey/v2/core"`

After ignoring the pkg github.com/AlecAivazis/survey/v2/core in dep, build is failing with the following error:

# github.com/Zomato/ZomatoDBQuery/query-parser/vendor/github.com/AlecAivazis/survey
vendor/github.com/AlecAivazis/survey/multiselect.go:46:18: undefined: core.OptionAnswer
@ahmetb
Copy link
Contributor

ahmetb commented Jun 24, 2019

related: #230

@AlecAivazis
Copy link
Owner

Are you sure @ahmetb? I don't see anywhere how @vermdeep would be pulling the wrong casing...

@ahmetb
Copy link
Contributor

ahmetb commented Jun 24, 2019

my bad, I jumped into conclusions as dep is known not to work well with case-sensitivity.

@AlecAivazis
Copy link
Owner

AlecAivazis commented Jun 24, 2019

No worries! Just wanted to make sure I wasn't missing anything.

I'm not quite sure what is going on with dep here @vermdeep. Can you make a small repo that reproduces this issue so I can take a look?

@vermdeep
Copy link
Author

vermdeep commented Jun 24, 2019

By default, dep is picking up v1.8.5. When I am running dep ensure in my sample repository here after updating Gopkg.toml file to use v2.0.0 following errors are coming:

Solving failure: No versions of github.com/AlecAivazis/survey met constraints:
	v1.8.5: Could not introduce github.com/AlecAivazis/survey@v1.8.5, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v2.0.1: "github.com/AlecAivazis/survey" imports "github.com/AlecAivazis/survey/v2/core", which contains malformed code: no package exists at "github.com/AlecAivazis/survey/v2/core"
	v2.0.0: "github.com/AlecAivazis/survey" imports "github.com/AlecAivazis/survey/v2/core", which contains malformed code: no package exists at "github.com/AlecAivazis/survey/v2/core"
	v1.8.4: Could not introduce github.com/AlecAivazis/survey@v1.8.4, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.8.3: Could not introduce github.com/AlecAivazis/survey@v1.8.3, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.8.2: Could not introduce github.com/AlecAivazis/survey@v1.8.2, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.8.1: Could not introduce github.com/AlecAivazis/survey@v1.8.1, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.8.0: Could not introduce github.com/AlecAivazis/survey@v1.8.0, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.8: Could not introduce github.com/AlecAivazis/survey@v1.8, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.7.1: Could not introduce github.com/AlecAivazis/survey@v1.7.1, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.7.0: Could not introduce github.com/AlecAivazis/survey@v1.7.0, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.6.4: Could not introduce github.com/AlecAivazis/survey@v1.6.4, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.6.3: Could not introduce github.com/AlecAivazis/survey@v1.6.3, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.6.2: Could not introduce github.com/AlecAivazis/survey@v1.6.2, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.6.1: Could not introduce github.com/AlecAivazis/survey@v1.6.1, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.6.0: Could not introduce github.com/AlecAivazis/survey@v1.6.0, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.5.3: Could not introduce github.com/AlecAivazis/survey@v1.5.3, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.5.2: Could not introduce github.com/AlecAivazis/survey@v1.5.2, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.5.1: Could not introduce github.com/AlecAivazis/survey@v1.5.1, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.5.0: Could not introduce github.com/AlecAivazis/survey@v1.5.0, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.4.2: Could not introduce github.com/AlecAivazis/survey@v1.4.2, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.4.1: Could not introduce github.com/AlecAivazis/survey@v1.4.1, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.4.0: Could not introduce github.com/AlecAivazis/survey@v1.4.0, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.3.4: Could not introduce github.com/AlecAivazis/survey@v1.3.4, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.3.1: Could not introduce github.com/AlecAivazis/survey@v1.3.1, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.3.0: Could not introduce github.com/AlecAivazis/survey@v1.3.0, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.2.5: Could not introduce github.com/AlecAivazis/survey@v1.2.5, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	1.2.4: Could not introduce github.com/AlecAivazis/survey@1.2.4, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.2.4: Could not introduce github.com/AlecAivazis/survey@v1.2.4, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.2.3: Could not introduce github.com/AlecAivazis/survey@v1.2.3, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.2.2: Could not introduce github.com/AlecAivazis/survey@v1.2.2, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.2.1: Could not introduce github.com/AlecAivazis/survey@v1.2.1, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.2.0: Could not introduce github.com/AlecAivazis/survey@v1.2.0, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.1.4: Could not introduce github.com/AlecAivazis/survey@v1.1.4, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.1.3: Could not introduce github.com/AlecAivazis/survey@v1.1.3, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.1.2: Could not introduce github.com/AlecAivazis/survey@v1.1.2, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.1.1: Could not introduce github.com/AlecAivazis/survey@v1.1.1, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.1.0: Could not introduce github.com/AlecAivazis/survey@v1.1.0, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.0.3: Could not introduce github.com/AlecAivazis/survey@v1.0.3, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.0.2: Could not introduce github.com/AlecAivazis/survey@v1.0.2, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1.0.1: Could not introduce github.com/AlecAivazis/survey@v1.0.1, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1: Could not introduce github.com/AlecAivazis/survey@v1, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v0.5.1: Could not introduce github.com/AlecAivazis/survey@v0.5.1, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v0.5: Could not introduce github.com/AlecAivazis/survey@v0.5, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v0: Could not introduce github.com/AlecAivazis/survey@v0, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	master: Could not introduce github.com/AlecAivazis/survey@master, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.
	v1: Could not introduce github.com/AlecAivazis/survey@v1, as it is not allowed by constraint ^2.0.0 from project github.com/vermdeep/survey.

I am using go1.11.4 darwin/amd64 with 0.5.0 dep version:

dep:
 version     : v0.5.0
 build date  : 2018-08-16
 git hash    : 224a564
 go version  : go1.10.3
 go compiler : gc
 platform    : darwin/amd64
 features    : ImportDuringSolve=false

@AlecAivazis
Copy link
Owner

Any luck with this @vermdeep? I'm not familiar enough with dep to debug this and I am very busy for the next few months so this likely won't get much attention any time soon 😢

@vermdeep
Copy link
Author

Actually, the issue here is that v2 directory is not present in your repo, yet you are using github.com/AlecAivazis/survey/v2/core in many places. I am not sure how it is working for others, but locally I am copying core and terminal into manually created v2 directory, to make go build work.

@AlecAivazis
Copy link
Owner

That's how gomodules work - the path underneath the package name is for major versions. You can see more here. That's why I was saying it's on dep to integrate with go modules

@AlecAivazis
Copy link
Owner

Whoops wrong button! But it sounds like you have a solution that works for now and the problem is part of a wider issue in dep on how to support go modules. Sorry i couldn't be more help!

@vermdeep
Copy link
Author

Thanks for the help 👍, will checkout if there is a way to support go modules in dep, Will update here once I find a solution.

@mkumatag
Copy link
Contributor

mkumatag commented Aug 2, 2019

ah! I also faced the same issue when I tried updating to latest v2 version, here is my analysis why it is happening. I tried all the possible way to fix it via dep tool by couldn't able to do it. My analysis is here with sample code - #241

There is PR hanging our there in the golang/dep community which may fix this issue - golang/dep#1963, but don't see much activity.

The only option I'm left with is to start using go mod!

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

No branches or pull requests

4 participants