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: failure to download when tag does not contain patch version #24024

Closed
zeebo opened this issue Feb 22, 2018 · 5 comments
Closed

x/vgo: failure to download when tag does not contain patch version #24024

zeebo opened this issue Feb 22, 2018 · 5 comments
Milestone

Comments

@zeebo
Copy link
Contributor

zeebo commented Feb 22, 2018

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

go version go1.10 darwin/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

darwin, amd64

What did you do?

ran vgo test all in a module that depends on github.com/stretchr/objx

What did you expect to see?

Tests running.

What did you see instead?

vgo: finding github.com/stretchr/objx v0.1.0
vgo: github.com/stretchr/objx v0.1.0: unexpected status (https://api.github.com/repos/stretchr/objx/git/refs/tags/v0.1.0): 404 Not Found
vgo: finding github.com/stretchr/objx v0.1.0
vgo: github.com/stretchr/objx v0.1.0: unexpected status (https://api.github.com/repos/stretchr/objx/git/refs/tags/v0.1.0): 404 Not Found
vgo: unexpected status (https://api.github.com/repos/stretchr/objx/git/refs/tags/v0.1.0): 404 Not Found

I believe this is caused by the repo having a v0.1 tag, which ends up parsed as v0.1.0 internally, and it doesn't keep the original tag string, or something.

@henderjon
Copy link

henderjon commented Feb 22, 2018

Same here. Same details.

[edit]
If I delete the entire line for the dependency that is improperly tagged from the go.mod file, vgo vendor will rebuild the go.mod file with the shortened tag (e.g. v1.2). However, running vgo build or vgo vendor a second time will re-rebuild the go.mod but add the .PATCH digit thereby triggering the error mentioned above.

@henderjon
Copy link

This has me stuck in dependency purgatory.

How do I tell vgo to use a commit hash instead of a tag? Do I need to suss out the timestamp of the commit and just shoehorn v0.0.0-$TIMESTAMP-$COMMITHASH into the go.mod file?

@zeebo
Copy link
Contributor Author

zeebo commented Feb 22, 2018

That was my workaround. It seemed to be fine. I don't believe the timestamp has to match the commit hash, either. But getting it close is probably a good idea to make updates work better.

@henderjon
Copy link

For those coming after us.

vgo seems to ignore the timestamp(?) as any 14 digit number between the v0.0.0- and the -$COMMITHASH seems to appease vgo.

@zeebo
Copy link
Contributor Author

zeebo commented Feb 22, 2018

Actually this looks like a dupe of #23954, so I'll close this in favor of that.

@zeebo zeebo closed this as completed Feb 22, 2018
@golang golang locked and limited conversation to collaborators Feb 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants