[PR #1174] merge release to master #1614

Open
opened 2026-01-29 22:21:24 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/1174
Author: @adamhathcock
Created: 1/28/2026
Status: 🔄 Open

Base: masterHead: adam/merge-release-to-master


📝 Commits (10+)

  • 0a50386 Using Constants class differently
  • d52facd Remove change
  • 014bbc3 Initial plan
  • a114155 Initial plan
  • 6c86632 Fix grammatical errors in ArcFactory comments
  • 53f12d7 Add [Obsolete] attribute to ReaderOptions.DefaultBufferSize
  • 010a38b Add clarifying comment about buffer size value difference
  • d11f6ae Merge pull request #1166 from adamhathcock/copilot/sub-pr-1165
  • 3c88c7f Merge pull request #1167 from adamhathcock/copilot/sub-pr-1165-again
  • d6156f0 release branch builds increment patch versions and master builds increment minor versions

📊 Changes

23 files changed (+626 additions, -288 deletions)

View changed files

📝 build/Program.cs (+39 -3)
📝 src/SharpCompress/Archives/ArchiveFactory.cs (+3 -13)
📝 src/SharpCompress/Archives/IArchiveEntryExtensions.cs (+2 -4)
📝 src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs (+80 -7)
📝 src/SharpCompress/Archives/Tar/TarArchive.cs (+1 -1)
📝 src/SharpCompress/Archives/Zip/ZipArchive.Factory.cs (+10 -27)
📝 src/SharpCompress/Archives/Zip/ZipArchive.cs (+1 -5)
src/SharpCompress/Common/Constants.cs (+10 -0)
📝 src/SharpCompress/Factories/ZipFactory.cs (+6 -20)
📝 src/SharpCompress/IO/SharpCompressStream.Async.cs (+77 -26)
📝 src/SharpCompress/IO/SharpCompressStream.cs (+28 -9)
📝 src/SharpCompress/Readers/AbstractReader.Async.cs (+6 -2)
📝 src/SharpCompress/Readers/AbstractReader.cs (+1 -1)
📝 src/SharpCompress/Readers/ReaderOptions.cs (+9 -1)
📝 src/SharpCompress/Utility.Async.cs (+96 -29)
📝 src/SharpCompress/Utility.cs (+31 -98)
📝 src/SharpCompress/Writers/GZip/GZipWriter.cs (+1 -1)
📝 src/SharpCompress/Writers/Zip/ZipWriter.cs (+2 -1)
📝 src/SharpCompress/packages.lock.json (+6 -6)
📝 tests/SharpCompress.Test/Mocks/ForwardOnlyStream.cs (+3 -3)

...and 3 more files

📄 Description

This pull request introduces several improvements and refactorings across the codebase, focusing on streamlining buffer size management, enhancing the SevenZip archive implementation, and improving versioning logic in the build process. The key changes include centralizing the buffer size constant, significant enhancements to the SevenZipArchive class (including new constructors and solid archive handling), and smarter version incrementing based on the current Git branch.

Buffer Size Management

  • Introduced a new Constants.BufferSize in SharpCompress.Common to standardize the buffer size used for stream operations across the codebase, replacing hardcoded values and previous buffer size constants. (src/SharpCompress/Common/Constants.cs [1] src/SharpCompress/Archives/IArchiveEntryExtensions.cs [2] [3] [4] src/SharpCompress/Archives/Tar/TarArchive.cs [5] src/SharpCompress/Factories/ZipFactory.cs [6]

SevenZip Archive Improvements

  • Refactored and expanded the SevenZipArchive class with new static Open methods supporting various sources (file path, FileInfo, streams, and multi-part archives), and added static methods to detect 7z files by signature. (src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs [1] [2]
  • Improved solid archive support by maintaining and reusing a shared decompression stream for entries in the same folder, preventing state corruption and improving performance. (src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs src/SharpCompress/Archives/SevenZip/SevenZipArchive.csL134-R319)
  • Added a SyncOnlyStream workaround to force synchronous reads due to known LZMA decoder async bugs, and provided internal diagnostics for testing. (src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs [1] [2]

Build and Versioning Logic

  • Enhanced the build script to increment the version number based on the current Git branch: patch increment for the release branch, minor increment for others, and added logic to detect the current branch in both CI and local environments. (build/Program.cs [1] [2] [3]

API and Signature Consistency

  • Simplified and unified archive detection method signatures by removing redundant buffer size parameters, relying instead on the new centralized buffer size constant. (src/SharpCompress/Archives/ArchiveFactory.cs [1] src/SharpCompress/Factories/ZipFactory.cs [2] [3]

Stream Buffering Robustness


���� This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/adamhathcock/sharpcompress/pull/1174 **Author:** [@adamhathcock](https://github.com/adamhathcock) **Created:** 1/28/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `adam/merge-release-to-master` --- ### 📝 Commits (10+) - [`0a50386`](https://github.com/adamhathcock/sharpcompress/commit/0a50386ada4833b37a05e259e628795cc27893aa) Using Constants class differently - [`d52facd`](https://github.com/adamhathcock/sharpcompress/commit/d52facd4ab139b0b9de8eb95e54b9facf2284ac8) Remove change - [`014bbc3`](https://github.com/adamhathcock/sharpcompress/commit/014bbc3ea480e7cdcf07b0842c398ca42b49952e) Initial plan - [`a114155`](https://github.com/adamhathcock/sharpcompress/commit/a11415518911db25c5a7810dbd2e9599a933c4ba) Initial plan - [`6c86632`](https://github.com/adamhathcock/sharpcompress/commit/6c866324b2d1d61c2aed78e189adb479e6a8d3a0) Fix grammatical errors in ArcFactory comments - [`53f12d7`](https://github.com/adamhathcock/sharpcompress/commit/53f12d75db91be1d1c38773cea93a516c18e916b) Add [Obsolete] attribute to ReaderOptions.DefaultBufferSize - [`010a38b`](https://github.com/adamhathcock/sharpcompress/commit/010a38bb7369ccb646479dd638262a2082522575) Add clarifying comment about buffer size value difference - [`d11f6ae`](https://github.com/adamhathcock/sharpcompress/commit/d11f6aefb041ce3fb0f6baa77676503cd626c72f) Merge pull request #1166 from adamhathcock/copilot/sub-pr-1165 - [`3c88c7f`](https://github.com/adamhathcock/sharpcompress/commit/3c88c7fdd509f5c0cff7d0e66bdb2ce31380c447) Merge pull request #1167 from adamhathcock/copilot/sub-pr-1165-again - [`d6156f0`](https://github.com/adamhathcock/sharpcompress/commit/d6156f0f1e617ef1757629aa3f2e1b0669b87d83) release branch builds increment patch versions and master builds increment minor versions ### 📊 Changes **23 files changed** (+626 additions, -288 deletions) <details> <summary>View changed files</summary> 📝 `build/Program.cs` (+39 -3) 📝 `src/SharpCompress/Archives/ArchiveFactory.cs` (+3 -13) 📝 `src/SharpCompress/Archives/IArchiveEntryExtensions.cs` (+2 -4) 📝 `src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs` (+80 -7) 📝 `src/SharpCompress/Archives/Tar/TarArchive.cs` (+1 -1) 📝 `src/SharpCompress/Archives/Zip/ZipArchive.Factory.cs` (+10 -27) 📝 `src/SharpCompress/Archives/Zip/ZipArchive.cs` (+1 -5) ➕ `src/SharpCompress/Common/Constants.cs` (+10 -0) 📝 `src/SharpCompress/Factories/ZipFactory.cs` (+6 -20) 📝 `src/SharpCompress/IO/SharpCompressStream.Async.cs` (+77 -26) 📝 `src/SharpCompress/IO/SharpCompressStream.cs` (+28 -9) 📝 `src/SharpCompress/Readers/AbstractReader.Async.cs` (+6 -2) 📝 `src/SharpCompress/Readers/AbstractReader.cs` (+1 -1) 📝 `src/SharpCompress/Readers/ReaderOptions.cs` (+9 -1) 📝 `src/SharpCompress/Utility.Async.cs` (+96 -29) 📝 `src/SharpCompress/Utility.cs` (+31 -98) 📝 `src/SharpCompress/Writers/GZip/GZipWriter.cs` (+1 -1) 📝 `src/SharpCompress/Writers/Zip/ZipWriter.cs` (+2 -1) 📝 `src/SharpCompress/packages.lock.json` (+6 -6) 📝 `tests/SharpCompress.Test/Mocks/ForwardOnlyStream.cs` (+3 -3) _...and 3 more files_ </details> ### 📄 Description This pull request introduces several improvements and refactorings across the codebase, focusing on streamlining buffer size management, enhancing the SevenZip archive implementation, and improving versioning logic in the build process. The key changes include centralizing the buffer size constant, significant enhancements to the `SevenZipArchive` class (including new constructors and solid archive handling), and smarter version incrementing based on the current Git branch. **Buffer Size Management** - Introduced a new `Constants.BufferSize` in `SharpCompress.Common` to standardize the buffer size used for stream operations across the codebase, replacing hardcoded values and previous buffer size constants. (`src/SharpCompress/Common/Constants.cs` [[1]](diffhunk://#diff-9a2d32ebe994000400662591541c56c9196c9291ddd1021bf5936e2bc0a394fdR1-R10) `src/SharpCompress/Archives/IArchiveEntryExtensions.cs` [[2]](diffhunk://#diff-61084e55d70b594ef97e944a0bc645b95f63a1854f75f17a038ab224850cfa0cL12-L13) [[3]](diffhunk://#diff-61084e55d70b594ef97e944a0bc645b95f63a1854f75f17a038ab224850cfa0cL31-R29) [[4]](diffhunk://#diff-61084e55d70b594ef97e944a0bc645b95f63a1854f75f17a038ab224850cfa0cL54-R52) `src/SharpCompress/Archives/Tar/TarArchive.cs` [[5]](diffhunk://#diff-7f2eb9160ad6da95a3247f13cfb74c5556ae75ba12daaf9eeeab0edd8cd965d0L69-R69) `src/SharpCompress/Factories/ZipFactory.cs` [[6]](diffhunk://#diff-5dcd6c58655a0efb67027c2f36dfbf0bc885cf015998f07a658aaea87944a0d4L52-R55) **SevenZip Archive Improvements** - Refactored and expanded the `SevenZipArchive` class with new static `Open` methods supporting various sources (file path, `FileInfo`, streams, and multi-part archives), and added static methods to detect 7z files by signature. (`src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs` [[1]](diffhunk://#diff-3bff366ad6cec841d5ddb40063f7cc21bf58b166996e77a52a8b223220b833d3L15-R165) [[2]](diffhunk://#diff-3bff366ad6cec841d5ddb40063f7cc21bf58b166996e77a52a8b223220b833d3R179-R200) - Improved solid archive support by maintaining and reusing a shared decompression stream for entries in the same folder, preventing state corruption and improving performance. (`src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs` [src/SharpCompress/Archives/SevenZip/SevenZipArchive.csL134-R319](diffhunk://#diff-3bff366ad6cec841d5ddb40063f7cc21bf58b166996e77a52a8b223220b833d3L134-R319)) - Added a `SyncOnlyStream` workaround to force synchronous reads due to known LZMA decoder async bugs, and provided internal diagnostics for testing. (`src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs` [[1]](diffhunk://#diff-3bff366ad6cec841d5ddb40063f7cc21bf58b166996e77a52a8b223220b833d3L101-R239) [[2]](diffhunk://#diff-3bff366ad6cec841d5ddb40063f7cc21bf58b166996e77a52a8b223220b833d3R349) **Build and Versioning Logic** - Enhanced the build script to increment the version number based on the current Git branch: patch increment for the `release` branch, minor increment for others, and added logic to detect the current branch in both CI and local environments. (`build/Program.cs` [[1]](diffhunk://#diff-5f44977b35aaf0b949b3e4ca9d6af26b6fb5ffd52f2c8fd9a5cf60e4a1080b5cL233-R233) [[2]](diffhunk://#diff-5f44977b35aaf0b949b3e4ca9d6af26b6fb5ffd52f2c8fd9a5cf60e4a1080b5cL243-R258) [[3]](diffhunk://#diff-5f44977b35aaf0b949b3e4ca9d6af26b6fb5ffd52f2c8fd9a5cf60e4a1080b5cR270-R291) **API and Signature Consistency** - Simplified and unified archive detection method signatures by removing redundant buffer size parameters, relying instead on the new centralized buffer size constant. (`src/SharpCompress/Archives/ArchiveFactory.cs` [[1]](diffhunk://#diff-22b8bc5a3d713f2404d058a5fddfba4cec7f175d67a00be88fe4f96da36f7d18L153-R160) `src/SharpCompress/Factories/ZipFactory.cs` [[2]](diffhunk://#diff-5dcd6c58655a0efb67027c2f36dfbf0bc885cf015998f07a658aaea87944a0d4L52-R55) [[3]](diffhunk://#diff-5dcd6c58655a0efb67027c2f36dfbf0bc885cf015998f07a658aaea87944a0d4L70-R70) **Stream Buffering Robustness** - Improved buffer fill logic in `SharpCompressStream.Async.cs` to handle short reads more robustly, ensuring the buffer is filled as expected. (`src/SharpCompress/IO/SharpCompressStream.Async.cs` [src/SharpCompress/IO/SharpCompressStream.Async.csL27-R32](diffhunk://#diff-a82e557ab9ba3407ba03481949a10b2b23442e54649e87871a4c068ddd83a53bL27-R32)) --- <sub>���� This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 22:21:24 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1614