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
x/build/pargzip: Writer should output single-stream gzip files #19052
Comments
@dsnet, can you take a look? |
Of interested, this appears to have been affecting darwin builds even earlier than this. go1.4.2.darwin-amd64-osx10.8.tar.gz and earlier appears to be fine, while go1.4.3.darwin-amd64.tar.gz is not. |
@nvx just to set expectations, any fix here will only take place going forward. The existing binaries will not be modified, as doing so causes a lot of pain for distro managers who hardcode expected hashes. |
Yeah that's understood and expected. The additional information about the darwin builds was only to assist in tracking down the source of the issue if there was a particular change at that time that may have been the culprit. It would be nice if once fixed a new build could be made (even if no changes since 1.7.5 other than the fixed gzip archive) unless 1.8 is due to come out not long after. Not really concerned about old versions as long as the latest works. :) |
This is working as intending. I believe the file is generated by This is an entirely valid use of gzip as specified according to RFC 1952, section 2.2:
|
That being said, it may be worth changing @bradfitz, do you want me to make the suggested change to |
@nvx, I should also note that this is clearly a bug in |
While I understand we use pargzip to speed up distribution to buildlet
workers, do we need speed up generating binary distribution files?
I'd weight compatibility with existing (buggy) software higher than
speeding up the compression (which is hardly justifiable because we only do
so when generating a new binary distribution).
|
@dsnet, chunking in DEFLATE has its subtleties too. You're going to need some way to synchronize the blocks to byte offsets. The obvious way is a Z_SYNC_FLUSH but those don't usually appear in gzipped files either, so it will still look a little odd. I tend to agree with Minux: the risk of incompatibility seems much higher here than the benefit. Even Go hasn't always handled these kinds of details correctly. |
I agree with @minux too. It was never my intention that pargzip files would make it to end users. It was just meant to speed up builds. |
CL https://golang.org/cl/36910 mentions this issue. |
CL https://golang.org/cl/36913 mentions this issue. |
Updates golang/go#19052 Change-Id: I453dd1cc6016bf137f25f4e5b7a772b2c1888279 Reviewed-on: https://go-review.googlesource.com/36913 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
@josharian : I understand not updating existing binaries in place, but would it be possible for there to be updated binaries hosted somewhere official so that applications that encountered this issue can use them, if they need older binaries? |
@MicahLC, is this a real issue or hypothetical? The latest Go1.8 release does not have this problem. So there's only an issue if someone must use an older version and their package manager can't handle multistream gzip files. |
@dsnet, since Go1.8 doesn't have the issue, most likely hypothetical. There were numerous users of the Jenkins Go plugin that were blocked by this issue when trying to use the previous binaries, but assuming they can all move forwards to Go1.8 (which, given Go's good backwards compatibility, they should be able to do), they will be unblocked. |
The last 4 bytes of a gzipped file (the file footer) contain the uncompressed data size in bytes.
Until "go1.7.2.linux-amd64.tar.gz", this value was correct for the golang distributed linux binaries, for example:
Notice 1.7.1 the header size agrees with the actual decompressed size, while all versions after that the value does not match.
The issue also seems to affect 1.6.4 release, but not 1.6.3
The files sha256 hashes have been verified to eliminate download corruption (except for 1.7.2 which is not listed on the download page?)
While some gzip tools do not rely on this value (for example GNU gzip), other tools do (for example JZlib) resulting in failure to decompress these gzipped files (as per https://issues.jenkins-ci.org/browse/JENKINS-39515).
Looking at the hexed values for 1.7.2 for example, the header value is 0x0007CA00, while the actual value is 0x0ED7CA00, this looks like the most significant 3 nibbles (12 bits) are being incorrectly set to 0.
The text was updated successfully, but these errors were encountered: