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

cmd/go: 'go mod download' did not download expected artifacts #28770

Closed
eladh opened this Issue Nov 13, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@eladh

eladh commented Nov 13, 2018

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

go version go1.11.2 darwin/amd64

Does this issue reproduce with the latest release?

yes

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

go env Output
go version go1.11.2 darwin/amd64
eladh-mac:metadata-api eladh$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/eladh/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/eladh/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11.2/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/eladh/Desktop/workspace/metadata-api/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/4q/783gnpcx3nl1yg67mtmpfsg80000gp/T/go-build049167184=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Hi , im trying to use the go module download and got some strange issues. for some reason running go mod download on the following go.mod is try to download a wrong dependency as it try to get github.com/davecgh/go-spew/@v/v1.1.0.mod -> 404 Not Found

when i try to get the dependency of 1.1.0 but it actually download go-spew 1.1.1 and no t1.1.0

the go.mod file

require (
cloud.google.com/go v0.26.0 // indirect
github.com/BurntSushi/toml v0.3.0 // indirect
github.com/Masterminds/squirrel v0.0.0-20180815162352-8a7e65843414
github.com/bwmarrin/snowflake v0.0.0-20180412010544-68117e6bbede
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/denisenkom/go-mssqldb v0.0.0-20180707235734-242fa5aa1b45 // indirect
github.com/fsnotify/fsnotify v1.4.7
github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7 // indirect
github.com/gin-gonic/gin v1.3.0
github.com/go-sql-driver/mysql v1.4.0 // indirect
github.com/go-xorm/core v0.6.0
github.com/go-xorm/xorm v0.7.0
github.com/gobuffalo/packr v1.13.3
github.com/golang/mock v1.1.1
github.com/golang/protobuf v1.1.0 // indirect
github.com/google/go-cmp v0.2.0 // indirect
github.com/google/uuid v1.0.0
github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce // indirect
github.com/json-iterator/go v0.0.0-20180806060727-1624edc4454b // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
github.com/lib/pq v0.0.0-20180523175426-90697d60dd84 // indirect
github.com/magiconair/properties v1.8.0
github.com/mattn/go-isatty v0.0.3 // indirect
github.com/mattn/go-sqlite3 v1.9.0
github.com/mitchellh/mapstructure v0.0.0-20180715050151-f15292f7a699 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect
github.com/pelletier/go-toml v1.2.0 // indirect
github.com/pkg/errors v0.8.0
github.com/rs/zerolog v1.8.1-0.20180815022311-85255a5e26e0
github.com/rubenv/sql-migrate v0.0.0-20180704111356-3f452fc0ebeb
github.com/spf13/afero v1.1.1 // indirect
github.com/spf13/cast v1.2.0 // indirect
github.com/spf13/jwalterweatherman v1.0.0 // indirect
github.com/spf13/viper v1.1.0
github.com/stretchr/testify v1.2.2
github.com/ugorji/go v1.1.1 // indirect
github.com/ziutek/mymysql v1.5.4 // indirect
golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac // indirect
golang.org/x/sys v0.0.0-20181005133103-4497e2df6f9e // indirect
golang.org/x/text v0.3.0 // indirect
google.golang.org/appengine v1.1.0 // indirect
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
gopkg.in/go-playground/validator.v8 v8.18.2 // indirect
gopkg.in/gorp.v1 v1.7.1 // indirect
gopkg.in/yaml.v2 v2.2.1
)

What did you expect to see?

go download should be download all relevant versions of the go-spew not just the latest one

What did you see instead?

go downloaded only go-spew 1.1.1

@bcmills

This comment has been minimized.

Member

bcmills commented Nov 13, 2018

What was the actual go mod download command that you ran, and why did you expect it to download versions other than v1.0.0?

When I tried go mod download github.com/davecgh/go-spew with the same go.mod file, I got a zip file for v1.1.1 and a go.mod file for both v1.1.1 and v1.1.0, and that broadly agrees with the output of go list -m github.com/davecgh/go-spew.

If you want to download a different version, you have to request it explicitly (go mod download github.com/davecgh/go-spew@v1.1.0).

$ cat go.mod
module github.com/golang/go/issues/28770

require (
        cloud.google.com/go v0.26.0 // indirect
        github.com/BurntSushi/toml v0.3.0 // indirect
        github.com/Masterminds/squirrel v0.0.0-20180815162352-8a7e65843414
        github.com/bwmarrin/snowflake v0.0.0-20180412010544-68117e6bbede
        github.com/davecgh/go-spew v1.1.1 // indirect
        github.com/denisenkom/go-mssqldb v0.0.0-20180707235734-242fa5aa1b45 // indirect
        github.com/fsnotify/fsnotify v1.4.7
        github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7 // indirect
        github.com/gin-gonic/gin v1.3.0
        github.com/go-sql-driver/mysql v1.4.0 // indirect
        github.com/go-xorm/core v0.6.0
        github.com/go-xorm/xorm v0.7.0
        github.com/gobuffalo/packr v1.13.3
        github.com/golang/mock v1.1.1
        github.com/golang/protobuf v1.1.0 // indirect
        github.com/google/go-cmp v0.2.0 // indirect
        github.com/google/uuid v1.0.0
        github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce // indirect
        github.com/json-iterator/go v0.0.0-20180806060727-1624edc4454b // indirect
        github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
        github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
        github.com/lib/pq v0.0.0-20180523175426-90697d60dd84 // indirect
        github.com/magiconair/properties v1.8.0
        github.com/mattn/go-isatty v0.0.3 // indirect
        github.com/mattn/go-sqlite3 v1.9.0
        github.com/mitchellh/mapstructure v0.0.0-20180715050151-f15292f7a699 // indirect
        github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
        github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect
        github.com/pelletier/go-toml v1.2.0 // indirect
        github.com/pkg/errors v0.8.0
        github.com/rs/zerolog v1.8.1-0.20180815022311-85255a5e26e0
        github.com/rubenv/sql-migrate v0.0.0-20180704111356-3f452fc0ebeb
        github.com/spf13/afero v1.1.1 // indirect
        github.com/spf13/cast v1.2.0 // indirect
        github.com/spf13/jwalterweatherman v1.0.0 // indirect
        github.com/spf13/viper v1.1.0
        github.com/stretchr/testify v1.2.2
        github.com/ugorji/go v1.1.1 // indirect
        github.com/ziutek/mymysql v1.5.4 // indirect
        golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac // indirect
        golang.org/x/sys v0.0.0-20181005133103-4497e2df6f9e // indirect
        golang.org/x/text v0.3.0 // indirect
        google.golang.org/appengine v1.1.0 // indirect
        gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
        gopkg.in/go-playground/validator.v8 v8.18.2 // indirect
        gopkg.in/gorp.v1 v1.7.1 // indirect
        gopkg.in/yaml.v2 v2.2.1
)

$ mkdir gopath
$ export GOPATH=${PWD}/gopath
$ go mod download github.com/davecgh/go-spew
go: finding github.com/rubenv/sql-migrate v0.0.0-20180704111356-3f452fc0ebeb
go: finding github.com/spf13/afero v1.1.1
go: finding github.com/go-sql-driver/mysql v1.4.0
go: finding github.com/google/uuid v1.0.0
go: finding github.com/spf13/viper v1.1.0
go: finding github.com/google/go-cmp v0.2.0
go: finding github.com/rs/zerolog v1.8.1-0.20180815022311-85255a5e26e0
go: finding github.com/golang/mock v1.1.1
go: finding github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce
go: finding golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac
go: finding github.com/pelletier/go-toml v1.2.0
go: finding github.com/lib/pq v0.0.0-20180523175426-90697d60dd84
go: finding github.com/spf13/jwalterweatherman v1.0.0
go: finding github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0
go: finding github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7
go: finding github.com/mattn/go-sqlite3 v1.9.0
go: finding gopkg.in/gorp.v1 v1.7.1
go: finding google.golang.org/appengine v1.1.0
go: finding cloud.google.com/go v0.26.0
go: finding github.com/json-iterator/go v0.0.0-20180806060727-1624edc4454b
go: finding github.com/bwmarrin/snowflake v0.0.0-20180412010544-68117e6bbede
go: finding github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
go: finding github.com/gin-gonic/gin v1.3.0
go: finding github.com/go-xorm/xorm v0.7.0
go: finding github.com/ziutek/mymysql v1.5.4
go: finding github.com/lann/builder v0.0.0-20180802200727-47ae307949d0
go: finding github.com/mattn/go-isatty v0.0.3
go: finding golang.org/x/text v0.3.0
go: finding gopkg.in/yaml.v2 v2.2.1
go: finding github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: finding github.com/magiconair/properties v1.8.0
go: finding github.com/ugorji/go v1.1.1
go: finding github.com/go-xorm/builder v0.0.0-20180322150003-a9b7ffcca3f0
go: finding github.com/go-xorm/core v0.6.0
go: finding golang.org/x/sys v0.0.0-20181005133103-4497e2df6f9e
go: finding github.com/davecgh/go-spew v1.1.1
go: finding gopkg.in/go-playground/validator.v8 v8.18.2
go: finding github.com/spf13/cast v1.2.0
go: finding github.com/stretchr/testify v1.2.2
go: finding gopkg.in/go-playground/assert.v1 v1.2.1
go: finding github.com/golang/protobuf v1.1.0
go: finding github.com/pkg/errors v0.8.0
go: finding github.com/BurntSushi/toml v0.3.0
go: finding github.com/denisenkom/go-mssqldb v0.0.0-20180707235734-242fa5aa1b45
go: finding github.com/mitchellh/mapstructure v0.0.0-20180715050151-f15292f7a699
go: finding github.com/go-xorm/core v0.0.0-20180322150003-0177c08cee88
go: finding github.com/Masterminds/squirrel v0.0.0-20180815162352-8a7e65843414
go: finding gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
go: finding github.com/gobuffalo/packr v1.13.3
go: finding github.com/fsnotify/fsnotify v1.4.7
go: finding github.com/spf13/cobra v0.0.3
go: finding github.com/markbates/grift v1.0.1
go: finding github.com/spf13/pflag v1.0.2
go: finding golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
go: finding golang.org/x/net v0.0.0-20180811021610-c39426892332
go: finding github.com/davecgh/go-spew v1.1.0
go: finding github.com/pmezard/go-difflib v1.0.0

$ cat gopath/pkg/mod/cache/download/github.com/davecgh/go-spew/@v/list
v1.1.0
v1.1.1

$ find gopath/pkg/mod/cache/download/github.com/davecgh/go-spew/ -name '*.mod'
gopath/pkg/mod/cache/download/github.com/davecgh/go-spew/@v/v1.1.1.mod
gopath/pkg/mod/cache/download/github.com/davecgh/go-spew/@v/v1.1.0.mod

$ find gopath/pkg/mod/cache/download/github.com/davecgh/go-spew/ -name *.zip
gopath/pkg/mod/cache/download/github.com/davecgh/go-spew/@v/v1.1.1.zip

$ go list -m github.com/davecgh/go-spew
github.com/davecgh/go-spew v1.1.1

$ go mod download github.com/davecgh/go-spew@v1.1.0

$ find gopath/pkg/mod/cache/download/github.com/davecgh/go-spew/ -name *.zip
gopath/pkg/mod/cache/download/github.com/davecgh/go-spew/@v/v1.1.1.zip
gopath/pkg/mod/cache/download/github.com/davecgh/go-spew/@v/v1.1.0.zip

@bcmills bcmills added this to the Go1.13 milestone Nov 13, 2018

@bcmills bcmills changed the title from go module download - dont download relevant artifacts version to cmd/go: 'go mod download' did not download expected artifacts Nov 13, 2018

@gopherbot

This comment has been minimized.

gopherbot commented Dec 13, 2018

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this Dec 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment