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

x/vgo: vgo vendor fails with github.com/stretchr/testify #25871

Closed
mwf opened this issue Jun 13, 2018 · 4 comments
Closed

x/vgo: vgo vendor fails with github.com/stretchr/testify #25871

mwf opened this issue Jun 13, 2018 · 4 comments
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@mwf
Copy link

mwf commented Jun 13, 2018

What version of Go are you using (go version)?

go version go1.10.1 darwin/amd64 vgo:2018-02-20.1

Latest vgo:

commit 7fbc8df48a749126c4596fd0a5e78f3941c7913b (HEAD -> master, origin/master, origin/HEAD)
Author: Russ Cox <rsc@golang.org>
Date:   Fri Jun 8 13:18:03 2018 -0400

    x/vgo: incorporate current Go 1.11 development tree

What did you do?

Please refer to https://github.com/mwf/goplay/tree/master/vgo/testify

vgo list -m
MODULE                             VERSION
github.com/mwf/goplay/vgo/testify  -
github.com/davecgh/go-spew         v1.1.0
github.com/pmezard/go-difflib      v1.0.0
github.com/stretchr/objx           v0.0.0-20180106011353-facf9a85c22f
github.com/stretchr/testify        v1.2.2

vgo vendor
vgo: import "github.com/davecgh/go-spew/spew/testdata" [/Users/ikorolev/dev/go/src/v/github.com/davecgh/go-spew@v1.1.0/spew/testdata]: no Go source files

This happens with all projects using github.com/stretchr/testify when you try to use vgo vendor.

If you check https://github.com/davecgh/go-spew/blob/master/spew/testdata/dumpcgo.go you can see that it uses build tags // +build cgo,testcgo

And this file is used in https://github.com/davecgh/go-spew/blob/master/spew/dumpcgo_test.go which is also built only when using the same build tags.

What did you expect to see?

I expect vgo vendor to populate the vendor folder.
It seems it doesn't respect build tags on some stage.

What did you see instead?

vgo vendor fails to populate vendor folder with an error:

vgo: import "github.com/davecgh/go-spew/spew/testdata" [/Users/ikorolev/dev/go/src/v/github.com/davecgh/go-spew@v1.1.0/spew/testdata]: no Go source files
@gopherbot gopherbot added this to the vgo milestone Jun 13, 2018
@oiooj oiooj added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 13, 2018
@oiooj
Copy link
Member

oiooj commented Jun 13, 2018

@rsc @bcmills Should we skip this error for package import?

@oiooj oiooj added NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 13, 2018
@bcmills
Copy link
Contributor

bcmills commented Jun 13, 2018

I expect vgo vendor to populate the vendor folder.
It seems it doesn't respect build tags on some stage.

Ignoring build tags is the intended behavior as of https://golang.org/cl/117258, but I don't understand why vgo vendor is trying to actually import the vendored packages with build constraints applied. That seems like a bug.

@mwf
Copy link
Author

mwf commented Jun 14, 2018

Ignoring build tags is the intended behavior as of https://golang.org/cl/117258, but I don't understand why vgo vendor is trying to actually import the vendored packages with build constraints applied. That seems like a bug.

Thanks! The problem is introduced with this change indeed.
I will use vgo from the parent commit for now - 1df2402.

Looking forward to a bugfix :)

@gopherbot
Copy link

Change https://golang.org/cl/118956 mentions this issue: cmd/go/internal/vgo: fix vendor for packages limited to a single tag

@golang golang locked and limited conversation to collaborators Jun 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

4 participants