Skip to content

Move Zstandard APIs from System.IO.Compression.Zstandard to System.IO.Compression#124634

Merged
rzikm merged 2 commits intodotnet:mainfrom
rzikm:move-zstandard-to-compression
Feb 24, 2026
Merged

Move Zstandard APIs from System.IO.Compression.Zstandard to System.IO.Compression#124634
rzikm merged 2 commits intodotnet:mainfrom
rzikm:move-zstandard-to-compression

Conversation

@rzikm
Copy link
Member

@rzikm rzikm commented Feb 20, 2026

There is no real benefit from having the APIs in separate assembly because:

….Compression

Move Zstandard compression/decompression APIs from the separate
System.IO.Compression.Zstandard assembly into the main
System.IO.Compression assembly for better organization.

Changes:
- Move source files to src/System/IO/Compression/Zstandard/ subdirectory
- Move test files to tests/Zstandard/ subdirectory
- Add PNSE stubs for browser/wasi platforms
- Update ref API with [UnsupportedOSPlatform] attributes
- Merge resource strings into System.IO.Compression Strings.resx
- Remove System.IO.Compression.Zstandard project reference from System.Net.Http
- Remove System.IO.Compression.Zstandard from NetCoreAppLibrary.props and sfx.slnx
- Delete the old System.IO.Compression.Zstandard directory

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @karelz, @dotnet/area-system-io-compression
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates Zstandard compression APIs into the main System.IO.Compression library, removing the separate System.IO.Compression.Zstandard assembly and updating build/test infrastructure accordingly.

Changes:

  • Move Zstandard implementation and tests under System.IO.Compression (including ref API surface updates).
  • Add browser/WASI PlatformNotSupportedException stubs while keeping full implementations on Windows/Unix TFMs.
  • Remove the old System.IO.Compression.Zstandard project artifacts and references (solutions, props, project references).

Reviewed changes

Copilot reviewed 23 out of 31 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/libraries/sfx.slnx Removes System.IO.Compression.Zstandard ref project from the libraries solution.
src/libraries/System.Net.Http/src/System.Net.Http.csproj Drops project reference to the removed System.IO.Compression.Zstandard project.
src/libraries/System.IO.Compression/tests/Zstandard/ZstandardTestUtils.cs Adds shared helpers for Zstandard tests in the consolidated test project.
src/libraries/System.IO.Compression/tests/Zstandard/ZstandardEncoderDecoderTests.cs Adds encoder/decoder coverage to System.IO.Compression tests.
src/libraries/System.IO.Compression/tests/Zstandard/ZstandardDictionaryTests.cs Adds dictionary creation/training tests under System.IO.Compression.
src/libraries/System.IO.Compression/tests/Zstandard/ZstandardCompressionOptionsTests.cs Adds validation tests for ZstandardCompressionOptions.
src/libraries/System.IO.Compression/tests/Zstandard/CompressionStreamUnitTests.Zstandard.cs Adds ZstandardStream coverage integrated with existing stream test base.
src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj Integrates Zstandard test sources conditionally (excluding browser/WASI).
src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardUtils.cs Adds shared internal helpers for Zstandard implementation.
src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardStream.cs Adds platform attributes on ZstandardStream.
src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardStream.Decompress.cs Adds decompression-side stream implementation under the consolidated assembly.
src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardStream.Compress.cs Adds compression-side stream implementation under the consolidated assembly.
src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardEncoder.cs Adds platform attributes on ZstandardEncoder.
src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardDictionary.cs Adds platform attributes on ZstandardDictionary.
src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardDecoder.cs Adds platform attributes on ZstandardDecoder.
src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardCompressionOptions.cs Adds platform attributes on ZstandardCompressionOptions.
src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/Zstandard.PlatformNotSupported.cs Adds browser/WASI stubs throwing PlatformNotSupportedException.
src/libraries/System.IO.Compression/src/System.IO.Compression.csproj Multi-target integration for Zstandard sources + stubs under System.IO.Compression.
src/libraries/System.IO.Compression/src/Resources/Strings.resx Merges Zstandard resource strings into System.IO.Compression resources.
src/libraries/System.IO.Compression/ref/System.IO.Compression.cs Adds Zstandard APIs to the System.IO.Compression reference surface with platform attributes.
src/libraries/System.IO.Compression/README.md Updates README to reflect Zstandard support in System.IO.Compression.
src/libraries/System.IO.Compression/Directory.Build.props Removes BOM/normalizes file header.
src/libraries/System.IO.Compression.Zstandard/tests/System.IO.Compression.Zstandard.Tests.csproj Deletes old Zstandard test project (now integrated into System.IO.Compression tests).
src/libraries/System.IO.Compression.Zstandard/src/System.IO.Compression.Zstandard.csproj Deletes old Zstandard implementation project (now merged into System.IO.Compression).
src/libraries/System.IO.Compression.Zstandard/src/Resources/Strings.resx Deletes old resource file (strings moved to System.IO.Compression).
src/libraries/System.IO.Compression.Zstandard/ref/System.IO.Compression.Zstandard.csproj Deletes old ref project.
src/libraries/System.IO.Compression.Zstandard/ref/System.IO.Compression.Zstandard.cs Deletes old ref surface file (moved into System.IO.Compression).
src/libraries/System.IO.Compression.Zstandard/System.IO.Compression.Zstandard.slnx Deletes old solution for the removed library.
src/libraries/System.IO.Compression.Zstandard/README.md Deletes old library README (functionality now documented under System.IO.Compression).
src/libraries/System.IO.Compression.Zstandard/Directory.Build.props Deletes old build props (no longer needed after consolidation).
src/libraries/NetCoreAppLibrary.props Removes System.IO.Compression.Zstandard from the NetCoreApp library list.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 23, 2026 07:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 31 changed files in this pull request and generated 1 comment.

Copy link
Contributor

@iremyux iremyux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rzikm rzikm merged commit 904ecbb into dotnet:main Feb 24, 2026
94 of 96 checks passed
iremyux pushed a commit to iremyux/dotnet-runtime that referenced this pull request Mar 2, 2026
….Compression (dotnet#124634)

There is no real benefit from having the APIs in separate assembly
because:
- the Managed code size is rather small
- it P/Invokes System.IO.Compression.Native just like
System.IO.Compression managed assembly does
- It would lead to circular dependency if we decide to implement
dotnet#123532

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants