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: 'go mod vendor' does not fail on case-insensitive import collision #38571

Closed
carnott-snap opened this issue Apr 21, 2020 · 6 comments
Closed
Assignees
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted. modules Vendoring
Milestone

Comments

@carnott-snap
Copy link

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

$ go version
go version go1.14.2 linux/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

During the investigation of #38342, I discovered the following ux quirk:

On a case insensitive filesystem: (I am using vfat)

package main

import (
	_ "example.com/Foo"
	_ "example.com/foo"
)

func main() {}
-- go.mod --
module play.ground

go 1.14

require (
	example.com/foo v0.1.0
	example.com/Foo v0.1.0
)

replace (
	example.com/foo => ./foo
	example.com/Foo => ./!foo
)
-- foo/go.mod --
module example.com/foo
-- foo/foo.go --
package foo
-- !foo/go.mod --
module example.com/Foo
-- !foo/foo.go --
package Foo
go mod vendor

What did you expect to see?

main.go:5:2: case-insensitive import collision: "example.com/foo" and "example.com/FOO"

What did you see instead?

go mod vendor succeeds, but go build fails, and one must flush vendor to fix things:

go build
main.go:5:2: case-insensitive import collision: "example.com/foo" and "example.com/FOO"
@jayconrod jayconrod added modules NeedsFix The path to resolution is known, but the work has not been done. Vendoring labels Apr 21, 2020
@jayconrod jayconrod added this to the Backlog milestone Apr 21, 2020
@anton-kuklin
Copy link
Contributor

I will work on this

anton-kuklin added a commit to anton-kuklin/go that referenced this issue May 2, 2020
The existing implementation of go mod vendor allows having
case-insensitive imports, which will anyway fail during go build.
This improvement validates such collisions during any mod pkg
loads ('tidy', 'why', 'vendor').

Fixes golang#38571
anton-kuklin added a commit to anton-kuklin/go that referenced this issue May 2, 2020
The existing implementation of go mod vendor allows having
case-insensitive imports, which will anyway fail during go build.
This improvement validates such collisions during any mod pkg
loads ('tidy', 'why', 'vendor').

Fixes golang#38571
@gopherbot
Copy link

Change https://golang.org/cl/231679 mentions this issue: cmd: fail go mod vendor on case-insensitive import collisions

@anton-kuklin
Copy link
Contributor

@jayconrod any chance to get a review? 😟

@jayconrod
Copy link
Contributor

@justplesh I think @bcmills would be a better reviewer for this. I haven't read through the full discussion in #38342 or thought about all the implications.

@anton-kuklin
Copy link
Contributor

@bcmills would appreciate

anton-kuklin added a commit to anton-kuklin/go that referenced this issue Sep 10, 2020
The existing implementation of go mod vendor allows having
case-insensitive imports, which will anyway fail during go build.
This improvement validates such collisions during any mod pkg
loads ('tidy', 'why', 'vendor').

Fixes golang#38571
anton-kuklin added a commit to anton-kuklin/go that referenced this issue Sep 10, 2020
The existing implementation of go mod vendor allows having
case-insensitive imports, which will anyway fail during go build.
This improvement validates such collisions during go mod vendor command.

Fixes golang#38571
anton-kuklin added a commit to anton-kuklin/go that referenced this issue Sep 27, 2020
The existing implementation of go mod vendor allows having
case-insensitive imports, which will anyway fail during go build.
This improvement validates such collisions during go mod vendor command.

Fixes golang#38571
@gopherbot
Copy link

Change https://go.dev/cl/570775 mentions this issue: cmd/go: check case-insensitive path collisions for go mod vendor.

@samthanawalla samthanawalla self-assigned this Mar 11, 2024
@samthanawalla samthanawalla added FixPending Issues that have a fix which has not yet been reviewed or submitted. and removed NeedsFix The path to resolution is known, but the work has not been done. labels Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted. modules Vendoring
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants