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

cmd/go: inconsistent vendor on different case-sense systems #71740

Closed
psydvl opened this issue Feb 14, 2025 · 0 comments
Closed

cmd/go: inconsistent vendor on different case-sense systems #71740

psydvl opened this issue Feb 14, 2025 · 0 comments

Comments

@psydvl
Copy link

psydvl commented Feb 14, 2025

Go version

go version go1.23.6 linux/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/psydvl/.cache/go-build'
GOENV='/home/psydvl/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/psydvl/go/pkg/mod'
GONOPROXY='*.yandex-team.ru'
GONOSUMDB='*.yandex-team.ru'
GOOS='linux'
GOPATH='/home/psydvl/go'
GOPRIVATE='*.yandex-team.ru'
GOPROXY='http://goproxy.yandex.net,direct'
GOROOT='/home/psydvl/sdk/go1.23.6'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/psydvl/sdk/go1.23.6/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.23.6'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/psydvl/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/psydvl/work/Projects/github.com/psydvl/goVendorRepro/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3629729758=/tmp/go-build -gno-record-gcc-switches'

What did you do?

Now vendoring use repository naming as-is for names with uppercase, while module cache in $GOMODCACHE use exclamation mark for uppercase
This vendor behavior cause inconsistent behavior on different case systems

Idea: new flag for go mod vendor that change produced folder names from AbCd to !ab!cd

Let's imagine two packages
example.com/organization/project1
example.com/Organization/project2

Current go modules cache behavior

~/go/mod/cache/
└── example.com/
    ├── organization/
    │   └── project1
    └── !organization/
        └── project2

Reproduce: https://github.com/psydvl/goVendorRepro

What did you see happen?

Current go mod vendor behavior on case-sensitive system

./vendor/
└── example.com/
    ├── organization/
    │   └── project1
    └── Organization/
        └── project2

Current go mod vendor behavior on case-insensitive system

./vendor/
└── example.com/
    └── Organization/
        ├── project1
        └── project2

What did you expect to see?

./vendor/
└── example.com/
    ├── organization/
    │   └── project1
    └── !organization/
        └── project2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants