Fix erl_tar compatibility with compressed archives
In OTP 24, erl_tar cannot read compressed tar files that have zero padding after the compressed data.
Examples of such tar files are those from tapes (yes, even in 2022) or created by bsdtar
Prior to commit e95f648 this data was correctly handled at least for binaries.
This commit introduces a new option to file:open Modes to handle this case: compressed_one
CT Test Results
3 files 139 suites 1h 29m 23s :stopwatch: 2 912 tests 2 733 :heavy_check_mark: 178 :zzz: 1 :x: 3 379 runs 3 167 :heavy_check_mark: 211 :zzz: 1 :x:
For more details on these failures, see this check.
Results for commit a5892472.
:recycle: This comment has been updated with latest results.
To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.
See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.
Artifacts
// Erlang/OTP Github Action Bot
Pretty sure dialyzer is wrong about that. And also that the test failures (peer and global) are problems with the tests and not this PR.
the test failures (peer and global) are problems with the tests and not this PR.
Yes.
Pretty sure dialyzer is wrong about that.
Running the test with cover, I notice that true clause in lines 366-367 are never executed.
Looking further, I see that the Opts variable originates from a call to open_mode/2. According to typer, the spec is:
-spec open_mode(maybe_improper_list()) ->
{'error','einval'} | {'ok','false' | 'read' | 'write',['raw'],['compressed' | 'read_ahead']}.
Opts comes from the last element in the ok tuple, which is:
['compressed' | 'read_ahead']
Please add a test case to verify that your fix fixes the bug.
I added a test case and fixed the conditional. Thanks for your comments.
Thanks! Added to our daily builds.
Thanks!