openSUSE / obs-service-go_modules

OBS Source Service to download, verify, and vendor Go module dependency sources
GNU General Public License v2.0
19 stars 18 forks source link

go mod download can error on invalid module versions in dependencies #20

Closed jfkw closed 2 years ago

jfkw commented 2 years ago

The go mod download subcommand can raise errors on certain modules where the module path does not match the module version. Notably, the go mod vendor subcommand does not error on the same repository version and dependency set. TBD if there is an upstream issue filed for this behavior. obs-service-go_modules calling of commands via the subprocess module must handle this behavior while occurrence remains a possibility.

k3s $ git checkout v1.23.6+k3s1
k3s $ go mod download
go: github.com/k3s-io/etcd@v3.4.18-k3s1+incompatible: invalid version: module contains a go.mod file, so module path must match major version ("github.com/k3s-io/etcd/v3")

In the above case, go mod download has return code 1, stdout is empty and the error message is written to stderr.