Closed tamalsaha closed 5 years ago
I agree with you @tamalsaha. Package name should be written in lowercase. Otherwise, it will cause compilation failures for projects that vendor their dependencies:
case-insensitive import collision: ...
There is also a similar case in docker-machine-driver-scaleway repo: https://github.com/scaleway/docker-machine-driver-scaleway/blob/master/driver/scaleway.go#L12
In case anyone is listening, may be fork the mflag library in your own repo and update the dependencies to point to that. This should be ok, since Docker uses Apache 2 license. Then update logrus. This unblocks most people. Later you can replace mflag with something else.
This is a real pain in the ass to vendorize. I forked scaleway-cli
smashed golang/dep
against it. Pointing docker dependency to master:
(1) try github.com/docker/docker@master
(2) ✗ github.com/docker/docker at master has problem subpkg(s):
(2) github.com/docker/docker has err (*build.NoGoError); required by (root). github.com/docker/docker/pkg/mflag is missing; required by (root).
This basicly means because the github.com/scaleway/scaleway-cli
is using the old mflag
package from the docker dependency which is gone since Aug 25, 2016.
This issue has been automatically closed because it has not had recent activity. Feel free to reopen it if you think that it is necessary. Note that we are working on a totally new version of the CLI to support all the new coming products. Thank you for your contributions and stay tuned! :wink:
I just did a go get
of the scw
command today and still get this error:
$ go get -u github.com/scaleway/scaleway-cli/cmd/scw
go: found github.com/scaleway/scaleway-cli/cmd/scw in github.com/scaleway/scaleway-cli v1.11.1
go: found github.com/Sirupsen/logrus in github.com/Sirupsen/logrus v1.4.2
go: found github.com/docker/go-units in github.com/docker/go-units v0.4.0
go: found github.com/dustin/go-humanize in github.com/dustin/go-humanize v1.0.0
go: found github.com/hashicorp/go-version in github.com/hashicorp/go-version v1.2.0
go: found github.com/docker/docker/pkg/namesgenerator in github.com/docker/docker v1.13.1
go: found github.com/moul/anonuuid in github.com/moul/anonuuid v1.2.0
go: found github.com/renstrom/fuzzysearch/fuzzy in github.com/renstrom/fuzzysearch v1.0.2
go: found golang.org/x/sync/errgroup in golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
go: found github.com/moul/http2curl in github.com/moul/http2curl v1.0.0
go: found github.com/kardianos/osext in github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0
go: found github.com/skratchdot/open-golang/open in github.com/skratchdot/open-golang v0.0.0-20190402232053-79abb63cd66e
go: found golang.org/x/crypto/ssh/terminal in golang.org/x/crypto v0.0.0-20191105034135-c7e5f84aec59
go: found github.com/mattn/go-isatty in github.com/mattn/go-isatty v0.0.10
go: found github.com/moul/gotty-client in github.com/moul/gotty-client v1.7.0
go: github.com/scaleway/scaleway-cli/cmd/scw imports
github.com/Sirupsen/logrus: github.com/Sirupsen/logrus@v1.4.2: parsing go.mod:
module declares its path as: github.com/sirupsen/logrus
but was required as: github.com/Sirupsen/logrus
Hi @bradfitz,
What is your Go version?
I cannot reproduce your error with a golang container:
$ go version
go version go1.13.4 linux/amd64
$ go get -v -u github.com/scaleway/scaleway-cli/cmd/scw
github.com/scaleway/scaleway-cli (download)
github.com/scaleway/scaleway-cli/vendor/github.com/renstrom/fuzzysearch/fuzzy
github.com/scaleway/scaleway-cli/vendor/golang.org/x/crypto/curve25519
github.com/scaleway/scaleway-cli/vendor/golang.org/x/crypto/ed25519/internal/edwards25519
github.com/scaleway/scaleway-cli/vendor/github.com/opencontainers/runc/libcontainer/user
github.com/scaleway/scaleway-cli/vendor/github.com/docker/go-units
github.com/scaleway/scaleway-cli/vendor/github.com/dustin/go-humanize
github.com/scaleway/scaleway-cli/vendor/github.com/hashicorp/go-version
github.com/scaleway/scaleway-cli/vendor/github.com/docker/docker/pkg/homedir
github.com/scaleway/scaleway-cli/vendor/github.com/docker/docker/pkg/mflag
github.com/scaleway/scaleway-cli/vendor/github.com/docker/docker/pkg/random
github.com/scaleway/scaleway-cli/vendor/github.com/mattn/go-isatty
github.com/scaleway/scaleway-cli/vendor/github.com/docker/docker/pkg/namesgenerator
github.com/scaleway/scaleway-cli/vendor/golang.org/x/sys/unix
github.com/scaleway/scaleway-cli/vendor/github.com/creack/goselect
github.com/scaleway/scaleway-cli/vendor/github.com/gorilla/websocket
github.com/scaleway/scaleway-cli/vendor/golang.org/x/crypto/ssh/terminal
github.com/scaleway/scaleway-cli/pkg/sshcommand
github.com/scaleway/scaleway-cli/vendor/golang.org/x/crypto/ed25519
github.com/scaleway/scaleway-cli/vendor/golang.org/x/net/context
github.com/scaleway/scaleway-cli/vendor/golang.org/x/crypto/ssh
github.com/scaleway/scaleway-cli/vendor/moul.io/anonuuid
github.com/scaleway/scaleway-cli/vendor/golang.org/x/sync/errgroup
github.com/scaleway/scaleway-cli/vendor/moul.io/http2curl
github.com/scaleway/scaleway-cli/vendor/github.com/docker/docker/pkg/system
github.com/scaleway/scaleway-cli/vendor/github.com/docker/docker/pkg/ioutils
github.com/scaleway/scaleway-cli/vendor/github.com/containerd/console
github.com/scaleway/scaleway-cli/vendor/github.com/sirupsen/logrus
github.com/scaleway/scaleway-cli/vendor/github.com/docker/docker/pkg/idtools
github.com/scaleway/scaleway-cli/vendor/github.com/docker/docker/pkg/pools
github.com/scaleway/scaleway-cli/vendor/github.com/moul/gotty-client
github.com/scaleway/scaleway-cli/vendor/github.com/docker/docker/pkg/fileutils
github.com/scaleway/scaleway-cli/vendor/github.com/docker/docker/pkg/promise
github.com/scaleway/scaleway-cli/vendor/github.com/kardianos/osext
github.com/scaleway/scaleway-cli/vendor/github.com/docker/docker/pkg/archive
github.com/scaleway/scaleway-cli/pkg/scwversion
github.com/scaleway/scaleway-cli/pkg/config
github.com/scaleway/scaleway-cli/vendor/github.com/skratchdot/open-golang/open
github.com/scaleway/scaleway-cli/pkg/pricing
github.com/scaleway/scaleway-cli/pkg/utils
github.com/scaleway/scaleway-cli/pkg/api
github.com/scaleway/scaleway-cli/pkg/clilogger
github.com/scaleway/scaleway-cli/pkg/commands
github.com/scaleway/scaleway-cli/pkg/cli
github.com/scaleway/scaleway-cli/cmd/scw
$ scw
Usage: scw [OPTIONS] COMMAND [arg...]
[...]
Note: if you use this package to consume our API, like @tamalsaha does, you should use our new scaleway-sdk-go instead. :)
The issue is addressed in https://github.com/scaleway/scaleway-cli/pull/584
set GO111MODULE=off before go get -v -u github.com/scaleway/scaleway-cli/cmd/scw
Hi,
The issue seems to still be present (Go 1.16, sclaway-cli v1.11.1) :
% go install github.com/scaleway/scaleway-cli/cmd/scw@latest
go: github.com/scaleway/scaleway-cli/cmd/scw imports
github.com/Sirupsen/logrus: github.com/Sirupsen/logrus@v1.8.1: parsing go.mod:
module declares its path as: github.com/sirupsen/logrus
but was required as: github.com/Sirupsen/logrus
The correct import path is github.com/sirupsen/logrus
(https://github.com/sirupsen/logrus). Not sure why scaleway-cli
is importing github.com/Sirupsen/logrus
(the S is capitalized).
Workaround: it seems to be fixed on master. The following works:
go install github.com/scaleway/scaleway-cli/cmd/scw@master
We use this library as a dependency to use scaleway api. Sometime ago
github.com/sirupsen/logrus
changed their package name from upper caseSirupsen
to lower casesirupsen
. This cases compilation failure for projects that vendor their dependencies. https://github.com/sirupsen/logrus/issues/543I have tried to update this repo to
github.com/sirupsen/logrus
v1.0.3. But I face a number of issues:github.com/moul/gotty-client
uses the upper case form. I have a pr for this https://github.com/moul/gotty-client/pull/53 .github.com/docker/docker
has changed from upper case to lower case at commit4f3616fb1c112e206b88cb7a9922bf49067a7756
. But before that docker repo also removed their mflag library and replaced that with spf13/pflag https://github.com/moby/moby/pull/25354 . This makes it really difficult to fix my original issue.I am hoping that this issue is fixed.