You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gazelle: 0.20.0
rules_go: 0.22.1
bazel: 2.1.1
OS: Mac OS Catalina
Processor Architecture: x86
Running the versions specified in the README.md.
What did you do?
I have a go.mod file that includes the line require gopkg.in/yaml.v3 v3. At the time of writing this ticket, this repository has not created a v3 tag, only a branch.
When attempting to use Gazelle to generate BUILD files for this project it exits with code 1.
What did you see?
go: errors parsing go.mod:
/private/var/folders/8s/gn_6097n1kgbrv19qs29fr8m0000gn/T/gazelle-temp-gomod578605918/go.mod:4: no matching versions for query "v3"
gazelle: exit status 1
Per the GoPkg.in semantics a version can point to either a branch or a tag. Gazelle however only supports tags. Can Gazelle support branches in addition to tags to satisfy the gopkg.in spec? Branch and tag refs must be unique within a repository.
The text was updated successfully, but these errors were encountered:
Sorry, Gazelle will only follow Go module semantics when importing go.mod files, nothing additional on top of that.
go.mod files may temporarily refer to versions using version queries (anything that goes after @ in go get, like latest or master). Any command that loads the module graph will attempt to resolve these to canonical version. Gazelle runs go list -m -json all, so that's what's failing.
v3 in this case is being interpreted as a version prefix rather than a tag or branch. It matches the highest version from the list returned by go list -m -versions gopkg.in/yaml.v3 that starts with v3. That list is empty, so an error is reported. This behavior is a bit surprising, and I think we should change it, but that's another issue (golang/go#29731).
Versions
gazelle: 0.20.0
rules_go: 0.22.1
bazel: 2.1.1
OS: Mac OS Catalina
Processor Architecture: x86
Running the versions specified in the
README.md
.What did you do?
I have a
go.mod
file that includes the linerequire gopkg.in/yaml.v3 v3
. At the time of writing this ticket, this repository has not created av3
tag, only a branch.When attempting to use Gazelle to generate
BUILD
files for this project it exits with code 1.What did you see?
Per the GoPkg.in semantics a version can point to either a branch or a tag. Gazelle however only supports tags. Can Gazelle support branches in addition to tags to satisfy the
gopkg.in
spec? Branch and tag refs must be unique within a repository.The text was updated successfully, but these errors were encountered: