golang / dep

Go dependency management tool experiment (deprecated)
https://golang.github.io/dep/
BSD 3-Clause "New" or "Revised" License
12.87k stars 1.05k forks source link

gps/constraint.go:149:4: undefined: semver.Constraint #2223

Closed ghost closed 3 years ago

ghost commented 4 years ago

Hi,

Hope you are all well !

While trying to "go get -u github.com/golang/dep/cmd/dep" in an alpine based docker container, I have the following error (last line):

+ go get -u github.com/golang/dep/cmd/dep
go: finding github.com/golang/dep v0.5.4
go: downloading github.com/golang/dep v0.5.4
go: extracting github.com/golang/dep v0.5.4
go: downloading golang.org/x/sync v0.0.0-20190423024810-112230192c58
go: extracting golang.org/x/sync v0.0.0-20190423024810-112230192c58
go: downloading github.com/pkg/errors v0.8.0
go: downloading github.com/pelletier/go-toml v1.2.0
go: extracting github.com/pkg/errors v0.8.0
go: extracting github.com/pelletier/go-toml v1.2.0
go: finding github.com/Masterminds/semver v1.5.0
go: downloading github.com/Masterminds/semver v1.5.0
go: downloading github.com/golang/protobuf v1.2.0
go: downloading golang.org/x/sys v0.0.0-20190422165155-953cdadca894
go: finding github.com/jmank88/nuts v0.4.0
go: extracting github.com/Masterminds/semver v1.5.0
go: downloading github.com/jmank88/nuts v0.4.0
go: extracting github.com/golang/protobuf v1.2.0
go: finding github.com/Masterminds/vcs v1.13.1
go: finding github.com/armon/go-radix v1.0.0
go: finding github.com/sdboyer/constext latest
go: finding github.com/nightlyone/lockfile latest
go: downloading github.com/armon/go-radix v1.0.0
go: downloading github.com/Masterminds/vcs v1.13.1
go: downloading github.com/sdboyer/constext v0.0.0-20170321163424-836a14457353
go: downloading github.com/nightlyone/lockfile v0.0.0-20180618180623-0ad87eef1443
go: extracting github.com/jmank88/nuts v0.4.0
go: extracting github.com/nightlyone/lockfile v0.0.0-20180618180623-0ad87eef1443
go: extracting github.com/Masterminds/vcs v1.13.1
go: extracting github.com/armon/go-radix v1.0.0
go: extracting github.com/sdboyer/constext v0.0.0-20170321163424-836a14457353
go: downloading github.com/boltdb/bolt v1.3.1
go: extracting golang.org/x/sys v0.0.0-20190422165155-953cdadca894
go: downloading gopkg.in/yaml.v2 v2.2.1
go: extracting github.com/boltdb/bolt v1.3.1
go: extracting gopkg.in/yaml.v2 v2.2.1
go: downloading golang.org/x/sys v0.0.0-20191026070338-33540a1f6037
go: extracting golang.org/x/sys v0.0.0-20191026070338-33540a1f6037
go: finding github.com/boltdb/bolt v1.3.1
go: finding github.com/pkg/errors v0.8.1
go: finding gopkg.in/yaml.v2 v2.2.7
go: finding github.com/golang/protobuf v1.3.2
go: finding golang.org/x/sys latest
go: finding golang.org/x/sync latest
go: finding github.com/pelletier/go-toml v1.6.0
go: downloading golang.org/x/sys v0.0.0-20191210023423-ac6580df4449
go: downloading github.com/pkg/errors v0.8.1
go: downloading github.com/golang/protobuf v1.3.2
go: downloading golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
go: downloading github.com/pelletier/go-toml v1.6.0
go: downloading gopkg.in/yaml.v2 v2.2.7
go: extracting github.com/pkg/errors v0.8.1
go: extracting golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
go: extracting github.com/pelletier/go-toml v1.6.0
go: extracting gopkg.in/yaml.v2 v2.2.7
go: extracting github.com/golang/protobuf v1.3.2
go: extracting golang.org/x/sys v0.0.0-20191210023423-ac6580df4449
# github.com/golang/dep/gps
/go/pkg/mod/github.com/golang/dep@v0.5.4/gps/constraint.go:149:4: undefined: semver.Constraint

Is there any issue with the package ?

Cheers, X.

hxnan commented 4 years ago

Somthing may help: https://github.com/golang/dep/issues/2055

TzeHimSung commented 4 years ago

Here meet the same problem.

$ go get -u github.com/golang/dep/cmd/dep
go: finding golang.org/x/sync latest
go: finding github.com/sdboyer/constext latest
go: finding github.com/nightlyone/lockfile latest
go: finding golang.org/x/sys latest
# github.com/golang/dep/gps
../../pkg/mod/github.com/golang/dep@v0.5.4/gps/constraint.go:149:4: undefined: semver.Constraint
TzeHimSung commented 4 years ago

Here meet the same problem.

$ go get -u github.com/golang/dep/cmd/dep
go: finding golang.org/x/sync latest
go: finding github.com/sdboyer/constext latest
go: finding github.com/nightlyone/lockfile latest
go: finding golang.org/x/sys latest
# github.com/golang/dep/gps
../../pkg/mod/github.com/golang/dep@v0.5.4/gps/constraint.go:149:4: undefined: semver.Constraint

solve this problem with using proxychains

proxychains curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
michael-myers commented 4 years ago

I too was having the problem, so I did: $ go env -w GO111MODULE=off to turn off Go Modules, before installing dep: $ go get -u github.com/golang/dep

mvdan commented 3 years ago

Dep was officially deprecated earlier this year, and the proposal to archive this repository was accepted. As such, I'm closing outstanding issues before archiving the repository. For any further comments, please use the proposal thread on the Go issue tracker. Thanks!