Open
Description
Initial PR changes were introduced here: #67883
The following is pending feedback I need to address (not urgent, for 8.0, mostly just additional testing coverage):
Perf improvements:
- Address stackalloc and stream-related suggestions by @stephentoub .
- Improve code that retrieves the extended attributes from the data section. Use IndexOf and related APIs suggested by Stephen.
- After IndexOfAnyExcept gets merged, consider using it: Add initial version of {Last}IndexOfAnyExcept #67941
- Improve the code from Archiving.Utils.Windows.cs Implement Tar APIs #67883 (comment)
Additional test coverage:
- Make sure that when archiving an executable, then extracting it, the executable mode bit gets properly preserved.
- Add test that reads an archive containing an unsupported entry type (no writing).
- Add test that ensures a hidden file can be used to create an entry from file.
- Verify these GNU fields are written in the data stream: AllGnuUnused = Offset + LongNames + Unused + Sparse + IsExtended + RealSize.
- Add test that ensures that a GNU archive (generated with tar tool) containing unused GNU bytes (sparse, etc) get preserved when written to another GNU archive.
- Add test to extract entries to disk one by one.
- Add test with entries containing relative segments that would cause extraction to happen outside of destination directory.
- Add test that opens one file concurrently, to prevent Allow sharing of input tar file for read #68361 from happening again.
- Add test that verifies that adding a Windows path with '' separators changes them to '/'.
- Consider enabling CA1305: Implement Tar APIs #67883 (comment)
- Add to the runtime-assets script an unarchived test with both a longlink and a longpath.
- Find out how (if possible) to add a file as a hardlink, because otherwise, it can only be created directly as an entry, not by reading it from the filesystem.
- Share WrappedStream in Common as suggested by @danmoseley .
Done:
- Address documentation suggestions, make sure all exceptions and remarks are properly filled out.
- Make sure I have full tests for individual extraction of all data types.
- Add test that advances DataStream a bit before extracting into filesystem, verify data was written starting from that position.
- Add Ustar checksum test.
- Add Pax checksum test.
- Add Gnu checksum test.
- Think of a better way to verify DateTimeOffsets in tests.
- Ensure extended attribute timestamps atime and ctime are converted to/from decimal, not double.
- Implement async APIs: Implement Tar async APIs #70574
- Add test that reads an archive from a file with both a longlink and a longpath.
- Address chmod suggestions by @tmds : Tar, Zip: respect umask when creating files. #71647 Tar: for directories, use a default mask that has the 'x' bit. #71760
- Archives created in MacOS fail to get extracted if entries start with
.\
. Tar entries should be able to handle paths that begin with "./", including the root path itself #70516 - Fix failing tests around timestamps (most likely due to access time being modified, and expected value is now different). Fix Tar timestamp conversion from/to string and DateTimeOffset #71038
- File tests: #69474, #70060, test disabled with Disable TarWriter_WriteEntry_File_Tests.Add_File in Linux #69997
- Symbolic link tests might also have the same issue.
- Verify extended attributes in all PAX tests.
- Investigate why retrieving the devmajor and devminor with syscalls are not matching the expected values. https://github.com/dotnet/runtime/pull/67883/files#r852463720
- Re-enable the tests that verify the values Add TAR tests that verify ExtractToFile works with special files #71988
- Add tests that verify readerOfOrigin still works as expected when using the new conversion constructor to transform an entry from one format to another. Add TarEntry conversion constructors #70325
- Allow multiple Global Extended Attributes entries.
- Follow up on
Format
detection in the reader when an archive has entries of multiple formats. SharpCompress and 7-zip handle this, we should too. - Add Tar conversion constructors Add TarEntry conversion constructors #70325
- Add simple tests to verify uncompressing a tar.gz works. PR: Do not read position when tar archive stream is unseekable #70178
- Fix hardlink test failure on Android/iOS/tvOS due to possible elevation requirement. Issue: Extract_HardLinkEntry_TargetInsideDirectory test from System.Formats.Tar.Tests fails on Android/iOS/tvOS #68360 - Fix: [Draft] Fix hard link creation in tar tests in Android, iOS, tvOS #69416
- Find all the stream.Read calls and make sure we read all that was expected (use similar logic to what's being done in ReadOrThrow). - This was addressed by @eerhardt in Add Stream ReadAtLeast and ReadExactly #69272
- Discuss if the TarFile extraction methods should extract something and throw at the end. - It was decided that we should throw immediately. We don't know if the archive is malformed after the error happens.
- Remove src csproj nullable enable after @eerhardt merges his PR.
- Implement p/invokes that retrieve UName and GName from uid and gid.
- Enable csproj in $(NetCoreAppCurrent)-Browser.
- Need to add the assembly to NetCoreAppLibrary.props to ensure it gets shipped as part of shared framework.
- Add a symlink test that has a link with an absolute path to a target.
- Remove errno from makedev, major and minor syscalls. They don't set it.
- Discuss if we want to merge DevMajor and DevMinor into a single public API. [API Proposal]: Merge TarEntry's DeviceMajor and DeviceMinor into a single API #68974