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: malformed import path app/系统模块/后台/内部模块/逻辑 invalid char '系' #45507

Closed
xushushun opened this issue Apr 11, 2021 · 6 comments

Comments

@xushushun
Copy link

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

$ go version
go version go1.16.3 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env

What did you do?

go run

What did you expect to see?

By compiling

What did you see instead?

malformed import path app/系统模块/后台/内部模块/逻辑 invalid char '系'

Notes:

This issue should be similar to the #43985

Since my system language is Chinese, Chinese often appears in the path. After upgrading version 1.16, many projects cannot be compiled

@seankhliao seankhliao changed the title CMD/GO:malformed import path app/系统模块/后台/内部模块/逻辑 invalid char '系' cmd/go:malformed import path app/系统模块/后台/内部模块/逻辑 invalid char '系' Apr 11, 2021
@seankhliao seankhliao changed the title cmd/go:malformed import path app/系统模块/后台/内部模块/逻辑 invalid char '系' cmd/go: malformed import path app/系统模块/后台/内部模块/逻辑 invalid char '系' Apr 11, 2021
@seankhliao
Copy link
Member

Seems unfortunate, see also #44970 #43052

cc @bcmills @jayconrod

@seankhliao seankhliao added the GoCommand cmd/go label Apr 11, 2021
@jayconrod
Copy link
Contributor

cc @matloob as well on cmd/go issues.

Sorry, but for now at least, this is working as expected in 1.16. module.CheckImportPath lists the character restrictions on import paths. Those restrictions didn't technically change in 1.16, but the go command started checking them for packages in the main module, in order to avoid surprising failures when publishing a module for the first time.

Unicode restrictions gives the rationale for the restrictions. Essentially, we're concerned that files will get different names on different file systems, and may end up overlapping or being compiled differently. As stated there, this may be relaxed in the future.

@xushushun
Copy link
Author

Unicode restrictions gives the rationale for the restrictions. Essentially, we're concerned that files will get different names on different file systems, and may end up overlapping or being compiled differently. As stated there, this may be relaxed in the future.

I understand, but at present, this limitation has a great probability of causing trouble to non English operating system developers. Can I change the error into a warning, or add the relevant configuration switch here

@jayconrod
Copy link
Contributor

We generally avoid reporting warnings or adding configuration options if we can avoid it.

I do think we should expand the set of allowed characters though. I've opened #45549 to come up with a broader set of allowed characters that won't cause compatibility problems.

@xushushun
Copy link
Author

xushushun commented Apr 14, 2021

I do think we should expand the set of allowed characters though. I've opened #45549 to come up with a broader set of allowed characters that won't cause compatibility problems.

It would be great if we could expand the allowed character set. Thank you

@konglong87
Copy link

also do this error,now back to 1.15,,,cry

@golang golang locked and limited conversation to collaborators Apr 21, 2022
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

5 participants