Skip to content
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

replace not working with vendor in indirect dependency, yet still gives error at compile time #54121

Closed
AgustinRamiroDiaz opened this issue Jul 28, 2022 · 2 comments

Comments

@AgustinRamiroDiaz
Copy link

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

$ go version
go version go1.17.7 linux/amd64

Does this issue reproduce with the latest release?

I don't know

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/az/.cache/go-build"
GOENV="/home/az/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/az/go/pkg/mod"
GONOPROXY="github.com/okteto/*"
GONOSUMDB="github.com/okteto/*"
GOOS="linux"
GOPATH="/home/az/go"
GOPRIVATE="github.com/okteto/*"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.17.7"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/az/okteto/okteto/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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build613263886=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I tried to build my program with go build, and got the error posted below.

I think that the issue is this:

  • in my go.mod, i have the indirect dependency of github.com/docker/[email protected]
  • github.com/docker/[email protected] has its dependencies vendored, in particular github.com/Sirupsen/logrus
  • I also have github.com/sirupsen/logrus from another place

The problem is that I've added this line to the go.mod and doesn't fix the issue:

github.com/Sirupsen/logrus => github.com/sirupsen/logrus v1.8.0

What did you expect to see?

A well built binary

What did you see instead?

../../go/pkg/mod/github.com/docker/[email protected]/osl/namespace_linux.go:13:2: case-insensitive import collision: "github.com/Sirupsen/logrus" and "github.com/sirupsen/logrus"
@seankhliao
Copy link
Member

Duplicate of #26904

@seankhliao seankhliao marked this as a duplicate of #26904 Jul 29, 2022
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Jul 29, 2022
@AgustinRamiroDiaz
Copy link
Author

Hey @seankhliao! Thanks for pointing out this is a duplicate, but I couldn't find a workaround for this in #26904. Is there a known workaround for this?

@golang golang locked and limited conversation to collaborators Jul 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants