cmd/go: go get fails to create zip for package containing empty files #59057
Labels
FrozenDueToAge
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, the latest 19 version. I can't use go20, because linting is broken in that version, which then breaks my entire build chain.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have created a library extendio, which contains quite a lot of test files (.txt, .flac and .jpeg) and since the content of the fles is irrelevant, (only their presence matters for the test cases) they are all empty files. However, when a client tries to go get the module, a whole load of errors are generated whilst trying to create the zip file.
To reproduce this error, just run:
The really odd thing is that this doesnt fail in github actions, but that doesnt use go get, uses
actions/checkout
instead, which works fine.What did you expect to see?
Nothing
What did you see instead?
Now, I am aware there are a whole load of restrictions about files that can be contained within a zip file (from issue #41402), but none of the restrictions cover empty files. I don't know if the problem is because of empty files, I am just speculating, because it's not clear what the problem is. The message invalid char '\'' doesn't make sense because that char doesn't exist anywhere in the file content or within the path of any of the files. (I thought it might be that I had referenced a file via a path containing a '\'', which is invalid in linux, but this is not the case.)
If these empty files are the cause, then shouldn't there be a check when you add the file to a repo (or some other go specic step/cmd) to warning that an empty file in the repo will break the zip creation process invoked by go get?
All I need for now is a clear indication of why this is failing. Empty files may not be the cause and none of the other restrictions that I have read at constraints, fits the bill.
The text was updated successfully, but these errors were encountered: