Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

checkErrors is preventing dep ensure from working within dep #995

Closed
ibrasho opened this issue Aug 12, 2017 · 4 comments · Fixed by #997
Closed

checkErrors is preventing dep ensure from working within dep #995

ibrasho opened this issue Aug 12, 2017 · 4 comments · Fixed by #997

Comments

@ibrasho
Copy link
Collaborator

ibrasho commented Aug 12, 2017

What dep command did you run?

I tried to dep ensure -v in github.com/golang/dep and got the following output:

$ dep ensure -v
Found 5 errors:

/Users/ibrahim/Code/go/src/github.com/golang/dep/cmd/dep/testdata/harness_tests/ensure/pkg-errors/case2/initial/bar/bar.go:3:51: expected 'package', found 'EOF'
/Users/ibrahim/Code/go/src/github.com/golang/dep/internal/gps/_testdata/src/bad/bad.go:6:43: expected 'package', found 'EOF'
import path github.com/golang/dep/internal/gps/_testdata/src/relimport/dotslash had a local import: "./simple"
import path github.com/golang/dep/internal/gps/_testdata/src/relimport/dotdotslash had a local import: "../github.com/golang/dep/internal/gps"
import path github.com/golang/dep/internal/gps/_testdata/src/relimport/dotdot had a local import: ".."

What did you expect to see?

A normal ensure output.

What did you see instead?

#844 introduced some additional rules to check when projects contain Go files with errors. Applying these rules on dep resulted in this case. 😁

Since dep has some test cases (and test data) with invalid Go files, dep ensure cannot be used in github.com/golang/dep.

cc: @grepory

@ibrasho ibrasho changed the title checkErrors is checkErrors is preventing dep ensure from working within dep Aug 12, 2017
@ibrasho
Copy link
Collaborator Author

ibrasho commented Aug 12, 2017

I think it would be great if we add more output before printing Found # errors:. Since it's not really clear what went wrong.

Something like Calculating imported package tree... and Finished calculating imported package tree. if no error occurred?

@sdboyer
Copy link
Member

sdboyer commented Aug 12, 2017

baaaaaarrrgghhhh lol

@sdboyer
Copy link
Member

sdboyer commented Aug 12, 2017

i thought i pieced through those cases, but evidently not. let's get a fast fix in on this one, if we can?

ibrasho added a commit to ibrasho-forks/dep that referenced this issue Aug 12, 2017
checkErrors doesn't allow dep ensure to be used in a project that
contains any Go files containing build errors. This commit update
checkErrors to return a warning instead of an error as long as the
project contains some compilable Go files.

Fixes golang#995

Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
@ibrasho
Copy link
Collaborator Author

ibrasho commented Aug 12, 2017

I created a PR. That function does the following now:

  • If all directories lack Go files, return an error.
  • If all directories have build errors, return an error.
  • If all directories either lack Go files or has a build error, return an error.
  • If some directories are compilable but the tree contains build errors, return a warning with the errors.

ibrasho added a commit to ibrasho-forks/dep that referenced this issue Aug 18, 2017
checkErrors doesn't allow dep ensure to be used in a project that
contains any Go files containing build errors. This commit update
checkErrors to return a warning instead of an error as long as the
project contains some compilable Go files.

Fixes golang#995

Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
ibrasho added a commit to ibrasho-forks/dep that referenced this issue Aug 18, 2017
checkErrors doesn't allow dep ensure to be used in a project that
contains any Go files containing build errors. This commit update
checkErrors to return a warning instead of an error as long as the
project contains some compilable Go files.

Fixes golang#995

Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
ibrasho added a commit to ibrasho-forks/dep that referenced this issue Aug 18, 2017
checkErrors doesn't allow dep ensure to be used in a project that
contains any Go files containing build errors. This commit update
checkErrors to return a warning instead of an error as long as the
project contains some compilable Go files.

Fixes golang#995

Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
ibrasho added a commit to ibrasho-forks/dep that referenced this issue Aug 19, 2017
checkErrors doesn't allow dep ensure to be used in a project that
contains any Go files containing build errors. This commit update
checkErrors to return a warning instead of an error as long as the
project contains some compilable Go files.

Fixes golang#995

Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
ibrasho added a commit to ibrasho-forks/dep that referenced this issue Aug 19, 2017
checkErrors doesn't allow dep ensure to be used in a project that
contains any Go files containing build errors. This commit update
checkErrors to return a warning instead of an error as long as the
project contains some compilable Go files.

Fixes golang#995

Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
ibrasho added a commit to ibrasho-forks/dep that referenced this issue Aug 19, 2017
checkErrors doesn't allow dep ensure to be used in a project that
contains any Go files containing build errors. This commit update
checkErrors to return a warning instead of an error as long as the
project contains some compilable Go files.

Fixes golang#995

Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
ibrasho added a commit to ibrasho-forks/dep that referenced this issue Aug 22, 2017
checkErrors doesn't allow dep ensure to be used in a project that
contains any Go files containing build errors. This commit update
checkErrors to return a warning instead of an error as long as the
project contains some compilable Go files.

Fixes golang#995

Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
ibrasho added a commit that referenced this issue Aug 22, 2017
checkErrors doesn't allow dep ensure to be used in a project that
contains any Go files containing build errors. This commit update
checkErrors to return a warning instead of an error as long as the
project contains some compilable Go files.

Fixes #995

Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants