Skip to content

cmd/go: case-insensitive import collision with vgo build ./... #26208

Closed

Description

@adam-hanna

Please answer these questions before submitting your issue. Thanks!

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

$ go version
go version go1.10.3 linux/amd64

$ vgo version
go version go1.10.3 linux/amd64 vgo:2018-02-20.1

Does this issue reproduce with the latest release?

Have not tried 1.11beta1

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

$ go env
GOARCH="amd64"
GOBIN="/home/adam/go/bin"
GOCACHE="/home/adam/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/adam/go"
GORACE=""
GOROOT="/home/adam/.gvm/gos/go1.10.3"
GOTMPDIR=""
GOTOOLDIR="/home/adam/.gvm/gos/go1.10.3/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build321160569=/tmp/go-build -gno-record-gcc-switches"

What did you do?

$ vgo build ./...
...
...
../../../mod/github.com/docker/go-events@v0.0.0-20170721190031-9461782956ad/broadcast.go:7:2: case-insensitive import collision: "github.com/sirupsen/logrus" and "github.com/Sirupsen/logrus"

A simple, demo repo to reproduce can be found, here.

Stackoverflow, here.

I've also tried modifying my go.mod file with

exclude github.com/Sirupsen/logrus v1.0.5

require (
    ...
    github.com/sirupsen/logrus v1.0.5
    ...
)

AND

replace github.com/Sirupsen/logrus v1.0.5 => github.com/sirupsen/logrus v1.0.5

What did you expect to see?

Successful build

What did you see instead?

../../../mod/github.com/docker/go-events@v0.0.0-20170721190031-9461782956ad/broadcast.go:7:2: case-insensitive import collision: "github.com/sirupsen/logrus" and "github.com/Sirupsen/logrus"

Activity

  1. added this to the vgo milestone on Jul 3, 2018
  2. bcmills commented on Jul 4, 2018

    @bcmills
    Contributor

    vgo tends to choose an old version of docker/docker due to the vgo requirement for semantic import versioning. (The latest docker tags are for v17, but without a versioned import path vgo stops at v1.)

    That's probably giving you some transitive dependency that uses a bad import path for logrus.

    What happens if you explicitly vgo get github.com/docker/docker@v17.05.0-ce?

  3. added
    WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.
    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
    on Jul 4, 2018
  4. adam-hanna commented on Jul 5, 2018

    @adam-hanna
    Author

    Hi @bcmills, thanks for the suggestion, but I got the same error

    EDIT - to be clear, I first $ vgo get github.com/docker/docker@v17.05.0-ce and then $ vgo build ./...

  5. pwaller commented on Jul 10, 2018

    @pwaller
    Contributor

    I'm also hitting this in another project @bcmills - one with a very long list of dependencies, including docker and some other large things. It's unclear where the problem comes from, or how to determine it.

    I have also reproduced @adam's experience.

  6. bcmills commented on Jul 10, 2018

    @bcmills
    Contributor

    When we stop automatically picking old versions of things (#26238) it should pretty much go away. Let's revisit once that is fixed.

  7. removed
    WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.
    on Jul 10, 2018
  8. adam-hanna commented on Jul 10, 2018

    @adam-hanna
    Author

    Thanks @bcmills! I'll keep an eye on that issue and try again once closed.

  9. modified the milestones: vgo, Go1.11 on Jul 12, 2018
  10. changed the title [-]x/vgo: case-insensitive import collision with vgo build ./...[/-] [+]cmd/go: case-insensitive import collision with vgo build ./...[/+] on Jul 12, 2018
  11. filewalkwithme commented on Aug 1, 2018

    @filewalkwithme
    Contributor

    #26238 was merged. Is this issue still happening?

  12. adam-hanna commented on Aug 1, 2018

    @adam-hanna
    Author

    @filewalkwithme trying to install from source to check, now. Having some issues but will update you with progress, soon.

  13. 3 remaining items

  14. added this to the Go1.12 milestone on Aug 10, 2018
  15. adam-hanna commented on Aug 10, 2018

    @adam-hanna
    Author

    @rsc Thanks for the help!

    Unless I'm mistaken, the example repo is using the most recent release of docker (v17.03.2-ce). The git hash of which is f5ec1e2936dcbe7b5001c2b817188b095c700c27

    In go.mod, line #15:

    require(
    ...
    github.com/docker/docker v0.0.0-20170601211448-f5ec1e2936dc
    ...
    )

    You can see that that is in fact the latest git hash.

    EDIT - Scratch the first part of my comment...

    Would it be possible to consider adding support for:

    replace github.com/Sirupsen/logrus v1.0.5 => github.com/sirupsen/logrus v1.0.5
    

    ??

    Thanks!

    EDIT 2 -
    I can confirm that using v17.05.0 works.

  16. voutasaurus commented on Aug 22, 2018

    @voutasaurus

    It may be worth looking at the corpus to see which major packages vendor an old docker version (pre July 2017). If the responsibility lies with the package maintainers themselves then starting the outreach sooner rather than later will give those package maintainers more time to anticipate the issue.

    Also maybe I'm reading this wrong but is there any temporary workaround for those project maintainers who themselves are depending on a package that in turn depends on an old version of docker except for "don't use go mod for dependency management"?

  17. voutasaurus commented on Aug 23, 2018

    @voutasaurus

    FYI I did this in a repo which depends on github.com/hyperledger/fabric which depends on an old version of docker as a workaround and the error went away:

    go mod init
    go get github.com/docker/docker@v0.0.0-20180422163414-57142e89befe
    go test ./...
    

    No manual editing of go.mod required. Tested in fresh golang:rc container.

    I'm not sure if github.com/hyperledger/fabric will actually work with docker@v0.0.0-20180422163414-57142e89befe but at least the go tooling will work.

  18. modified the milestones: Go1.12, Go1.13 on Oct 25, 2018
  19. bcmills commented on Jan 18, 2019

    @bcmills
    Contributor

    Would it be possible to consider adding support for:

    replace github.com/Sirupsen/logrus v1.0.5 => github.com/sirupsen/logrus v1.0.5
    

    That will likely be allowed once #26904 is addressed. Closing this issue as subsumed by that one.

  20. locked and limited conversation to collaborators on Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.modules

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址