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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: install "malformed file path" for source code filenames outside the Unicode BMP #50396

Closed
nigeltao opened this issue Dec 30, 2021 · 3 comments

Comments

@nigeltao
Copy link
Contributor

As reported at google/wuffs#62 (comment)

$ go install github.com/google/wuffs@v0.3.0-beta.12
go: downloading github.com/google/wuffs v0.3.0-beta.12
go install: github.com/google/wuffs@v0.3.0-beta.12: create zip: test/data/non-ascii/馃樆.txt: malformed file path "test/data/non-ascii/馃樆.txt": invalid char '馃樆'

The github.com/google/wuffs repository indeed has a file named test/data/non-ascii/馃樆.txt and e.g. git clone seems OK with it.

馃樆 is U+1F63B SMILING CAT FACE WITH HEART-SHAPED EYES (in UTF-8: [F0 9F 98 BB]), outside of the Unicode Basic Multilingual Plane (BMP).

If I'm reading the ZIP specification correctly, section "4.6.9 -Info-ZIP Unicode Path Extra Field (0x7075)" suggests that it's possible for ZIP files to contain (UTF-8 encoded) Unicode file names.

@ALTree
Copy link
Member

ALTree commented Dec 30, 2021

I think the names of files in modules have additional restrictions, not everything that is permitted by the zip specification is allowed.

https://go.dev/ref/mod#zip-path-size-constraints

File and directory names within a module may consist of Unicode letters, ASCII digits, the ASCII space character (U+0020), and the ASCII punctuation characters !#$%&()+,-.=@[]^_{}~.

@seankhliao
Copy link
Member

Duplicate of #45549

@seankhliao seankhliao marked this as a duplicate of #45549 Dec 30, 2021
MawKKe added a commit to MawKKe/audiobook-split-ffmpeg-go that referenced this issue Mar 31, 2022
The file in question is not a Go file, but a file for testing. The
filename has quotes in it, causing error during install:

$ go install github.com/MawKKe/audiobook-split-ffmpeg-go/cmd/audiobook-split-ffmpeg@latest
go: github.com/MawKKe/audiobook-split-ffmpeg-go/cmd/audiobook-split-ffmpeg@latest:
create zip: test/beep with spaces and some' quotes" in name.m4a:
malformed file path "test/beep with spaces and some' quotes\" in
name.m4a": invalid char '\''

Perhaps these are related?
- golang/go#50396
- golang/go#45549

Idk, life is too short for dealing with shitty tooling...
@catundercar
Copy link
Contributor

I think the names of files in modules have additional restrictions, not everything that is permitted by the zip specification is allowed.

https://go.dev/ref/mod#zip-path-size-constraints

File and directory names within a module may consist of Unicode letters, ASCII digits, the ASCII space character (U+0020), and the ASCII punctuation characters !#$%&()+,-.=@[]^_{}~.

Hello, I have a small question: If we do not check other files which do not affect compilation in the module, would it affect we get and use the module?

@golang golang locked and limited conversation to collaborators Sep 5, 2023
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