-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
spec: clarify legality of non-ASCII graphic characters in import paths #44970
Comments
The spec deals with the language. Modules isn't part of the language, it's part of the toolchain. |
CC @jayconrod, @bcmills. |
Hey Alan, hope all is well. We miss you over here. I think it would be reasonable to note within the spec that clarify the build tool (cmd/go, Bazel, Blaze) is responsible for interpreting import paths and may impose additional restrictions. The restrictions for module paths are documented in Module paths and versions. Incidentally, in 1.16.2, we rolled back some of the changes in 1.16 because they were affecting more users than we anticipated. Import paths are now validated separately from module paths, and import paths may begin with a leading dot and may contain |
The spec is wrong. At the least, an implementation needs to be able to insist on Unicode normalization that would exclude some of those code points. But further restrictions should be allowed as well, along with name-specific restrictions (we don't allow a package named "com1" for example). |
@rsc It's a pity that Go will do normalization since package ʕʘϖʘʔ is fine with spec and go tool now. https://pkg.go.dev/github.com/mengzhuo/moe
|
This is in the Go1.18 milestone. Is it likely to happen for 1.18? Thanks. @rsc You assigned this to yourself back in April. |
@griesemer This is in the 1.18 milestone; time to move to 1.19? Thanks. |
Not urgent. Moving to 1.19. |
As a case study for this, #53954 was an issue relating to macOS's handling of Unicode file names. The test involved the character However, on macOS, the file names are rewritten to use the decomposed characters ( Then when compiling the second package, cmd/compile saw |
About import paths, the spec (https://golang.org/ref/spec#Import_declarations) says:
but the Go 1.16 release notes (https://golang.org/doc/go1.16#go-command) say
The latter wording appears to be a stronger restriction than allowed by the spec. Does the spec need to be changed?
The text was updated successfully, but these errors were encountered: