bazel: Truncated TAR archive error during decompressing tar file
Description of the bug:
Context: https://github.com/bazelbuild/bazel/issues/20090#issuecomment-1819279500
Which category does this issue belong to?
External Dependency
What’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Can be reproduced on macOS with the same repo as https://github.com/bazelbuild/bazel/issues/20090#issue-1982707352
Which operating system are you running Bazel on?
macOS
What is the output of bazel info release?
No response
If bazel info release returns development version or (@non-git), tell us how you built Bazel.
No response
What’s the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?
No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (14 by maintainers)
Commits related to this issue
- Update commons-compress to 1.26.1 Fixes #20269. Update commons-compress to 1.26.1 and swap use of GZIPInputStream to commons-compress' GzipCompressorInputStream, which [deals correctly with concaten... — committed to bazel-io/bazel by mark-thm 3 years ago
- Update commons-compress to 1.26.1 Fixes #20269. Update commons-compress to 1.26.1 and swap use of GZIPInputStream to commons-compress' GzipCompressorInputStream, which [deals correctly with concaten... — committed to bazelbuild/bazel by mark-thm 3 years ago
- Update commons-compress to 1.26.1 Fixes #20269. Update commons-compress to 1.26.1 and swap use of GZIPInputStream to commons-compress' GzipCompressorInputStream, which [deals correctly with concaten... — committed to Kila2/bazel by mark-thm 3 years ago
- Fix: bazelbuild/bazel#20269 for mac arm — committed to matsubara0507/rules_elm by matsubara0507 2 years ago
A fix for this issue has been included in Bazel 7.2.0 RC1. Please test out the release candidate and report any issues as soon as possible. If you’re using Bazelisk, you can point to the latest RC by setting USE_BAZEL_VERSION=7.2.0rc1. Thanks!
Thanks Keith, I should have commented here that I worked around it in rules_lint in that way: https://github.com/aspect-build/rules_lint/pull/66/files#diff-88872655967d360b7907682cbc2461f815c86c2940469330183be99e6f1b3ec2R129-R137
As a workaround you can do:
and then:
since macOS tar handles this fine
@FrancoisPoinsot since the root cause lies in commons-compress, there is little we can do in Bazel without a upstream fix. I’ll have to downgrade this to P2 and remove it as a release blocker for 7.0
I can confirm this is an issue, but having spent a fair chunk of time trying to understand the TAR format, I can only deduce that the issue stems from somewhere within the Apache Commons compress library. In any case, this wouldn’t be a 7.0.0 regression; I’m pretty sure that we never supported sparse TARs. So I’m inclined to treat this as a “soft blocker” – that is, if all non-soft blockers are resolved, we should release 7.0.0 and look to maybe resolve this in a patch release.
GNU tar extracts the file just fine, so I’d say this is some feature disparity in the Java library.
@bazel-io fork 7.0.0