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

go.mod: regression: go mod init cannot create module with some unicode charcters if package path is provided on the command line #33698

Closed
SamWhited opened this issue Aug 17, 2019 · 2 comments

Comments

@SamWhited
Copy link
Member

SamWhited commented Aug 17, 2019

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

$ go version
go version devel +c485506b0aae 20190816195457 linux/amd64

Does this issue reproduce with the latest release?

No (1.12.9 works as expected)

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN="/home/sam/bin"
GOCACHE="/home/sam/.cache/go-build"
GOENV="/home/sam/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY="*"
GONOSUMDB="*"
GOOS="linux"
GOPATH="/home/sam/go"
GOPRIVATE="*"
GOPROXY="127.0.0.1"
GOROOT="/home/sam/Projects/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/home/sam/Projects/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/sam/go/src/mellium.im/communiqué-shiny/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-build510054645=/tmp/go-build -gno-record-gcc-switches"

What did you do?

$ cd $GOPATH
$ mkdir -p mellium.im/communiqué
$ cd mellium.im/communiqué
$ # This works
$ go mod init
go: creating new go.mod: module mellium.im/communiqué
$ cat go.mod 
module mellium.im/communiqué

go 1.13
$ rm go.mod

$ # This does not work
$ go mod init mellium.im/communiqué
go: malformed import path "mellium.im/communiqué": invalid char 'é'
$ go1.12.9 mod init mellium.im/communiqué
go: creating new go.mod: module mellium.im/communiqué

What did you expect to see?

Running go mod init and go mod init mellium.im/communiqué should both produce a valid go.mod file with some form of Unicode normalization applied.

What did you see instead?

They both behave the same in Go 1.12.9, but do not behave the same in Go 1.13.

@SamWhited SamWhited changed the title go.mod: go mod init cannot create module with some unicode charcters go.mod: regression: go mod init cannot create module with some unicode charcters if package path is provided on the command line Aug 17, 2019
@bcmills
Copy link
Contributor

bcmills commented Aug 19, 2019

This appears to be a (correct) side effect of https://golang.org/cl/182560, which fixed #32644.

The Go module proxy protocol does not provide an encoding for Unicode characters, and the Go language spec does not define a normalization algorithm for import paths. As a result, a module path containing Unicode characters cannot be fetched or cached: it can only exist as a top-level module, in which case the module path doesn't make much difference anyway.

@bcmills
Copy link
Contributor

bcmills commented Aug 19, 2019

Duplicate of #29101

@bcmills bcmills marked this as a duplicate of #29101 Aug 19, 2019
@bcmills bcmills closed this as completed Aug 19, 2019
@golang golang locked and limited conversation to collaborators Aug 18, 2020
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