Skip to content

Add Lzma library files to the repository#124003

Open
rzikm wants to merge 24 commits intodotnet:mainfrom
rzikm:lzma
Open

Add Lzma library files to the repository#124003
rzikm wants to merge 24 commits intodotnet:mainfrom
rzikm:lzma

Conversation

@rzikm
Copy link
Member

@rzikm rzikm commented Feb 4, 2026

Preparatory PR for #1542

libSystem.IO.Compression.Native.so size (Release)

Size Diff
Before 1 747 040 B -
After 1 810 704 B +3.64%

Copilot AI review requested due to automatic review settings February 4, 2026 13:22
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 adds the XZ Utils library (version 5.8.2) to the dotnet/runtime repository as preparatory work for issue #1542. The addition includes the complete LZMA compression library source code, build configurations, documentation, and integration scripts.

Changes:

  • Adds XZ Utils 5.8.2 library files from the tukaani-project/xz repository
  • Includes CMake and Autotools build system configurations
  • Adds documentation, examples, and internationalization support files
  • Configures the library for static linking with multithreading disabled

Reviewed changes

Copilot reviewed 75 out of 497 changed files in this pull request and generated no comments.

File Description
src/native/external/xz/* Complete XZ Utils 5.8.2 library source code including build scripts, documentation, examples, and localization files
src/native/external/xz.cmake CMake configuration to integrate XZ Utils into dotnet/runtime build system with specific feature flags
src/native/external/xz.version Version tracking file indicating XZ Utils v5.8.2 from tukaani-project
src/native/external/cgmanifest.json Component governance manifest entry for XZ Utils dependency

@rzikm rzikm marked this pull request as draft February 4, 2026 13:23
@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.

Copilot AI review requested due to automatic review settings February 9, 2026 12:14
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 79 out of 284 changed files in this pull request and generated 7 comments.

@rzikm
Copy link
Member Author

rzikm commented Feb 9, 2026

I am getting compile errors on linux:

  ERROR: /source/dotnet/runtime/src/native/libs/System.IO.Compression.Native/entrypoints.c file did not match entries exported from /source/dotnet/runtime/artifacts/obj/native/net11.0-linux-Debug-x64/System.IO.Compression.Native/libSystem.IO.Compression.Native.so
  DIFFERENCES FOUND: 
  lzma_stream_decoder

Seems like there is something wrong with the exports specification:

System.IO.Compression.Native$ nm libSystem.IO.Compression.Native.so | grep " lzma_stream_decoder"
00000000003c51c0 t lzma_stream_decoder
00000000003c4410 t lzma_stream_decoder_init

All the other exported entries have T in the nm output, e.g.

000000000019dd90 T BrotliDecoderDecompress

But the exports file seems to be generated correctly:

        ZSTD_CCtx_setPledgedSrcSize;
        ZDICT_trainFromBuffer;
        lzma_stream_decoder;
    local: *;
};

I am not sure what is going on here, maybe there is a problem because the library functions are declared as extern?

extern LZMA_API(lzma_ret) lzma_alone_decoder(
lzma_stream *strm, uint64_t memlimit)
lzma_nothrow lzma_attr_warn_unused_result;

I will need to investigate a bit more

Copilot AI review requested due to automatic review settings February 10, 2026 17:24
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 79 out of 284 changed files in this pull request and generated 2 comments.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 10, 2026 17:38
@rzikm
Copy link
Member Author

rzikm commented Feb 10, 2026

I will need to investigate a bit more

Should be working now

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 79 out of 284 changed files in this pull request and generated 3 comments.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 10, 2026 17:49
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 79 out of 284 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings February 12, 2026 14:58
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 82 out of 288 changed files in this pull request and generated 2 comments.

@rzikm
Copy link
Member Author

rzikm commented Feb 18, 2026

Build is passing, but no new functionality was introduced yet, so the build failures are not related

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 81 out of 288 changed files in this pull request and generated 5 comments.

…e.Unix.targets

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 18, 2026 08:23
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 81 out of 288 changed files in this pull request and generated 1 comment.

@@ -0,0 +1,70 @@

XZ Utils Licensing
==================
Copy link
Member

Choose a reason for hiding this comment

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

This is a non-traditional license. We should make sure to review this with our OSS team and understand what's required to use this. I didn't see an update to our repo's third-party-notices.

I see we are subsetting what we copy - does that mean we've omitted all the things under GPL? If so, can those licenses be omitted? IANAL but this makes me a little nervous and is the sort of thing we want to make doubly sure we have correct so that we understand that our usage / copying is permitted by the license and we are meeting all the requirements set out by that license.

Copy link
Member Author

@rzikm rzikm Feb 19, 2026

Choose a reason for hiding this comment

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

I removed all the code that we don't use, the parts that are left (liblzma, common) are under 0BSD license. I also added third party notice

Copilot AI review requested due to automatic review settings February 19, 2026 18:16
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 79 out of 230 changed files in this pull request and generated no new comments.

@ericstj
Copy link
Member

ericstj commented Feb 19, 2026

What sort of size increase do we see to our system.io.compression.native with this, across different platforms? Have you confirmed we are linking correctly and getting the minimal set of things we need?

@rzikm
Copy link
Member Author

rzikm commented Feb 20, 2026

What sort of size increase do we see to our system.io.compression.native with this, across different platforms? Have you confirmed we are linking correctly and getting the minimal set of things we need?

the PR as-is increases the native .so by about 60 kB in release on my desktop, there is a reference to lzma_stream_decoder_init in the entryponts.c to validate if it links properly. I don't think we can whittle down any more of the compiled source without manual modifications to the build scripts.

@@ -0,0 +1,302 @@
#!@POSIX_SHELL@
# SPDX-License-Identifier: GPL-2.0-or-later
Copy link
Member

@jkotas jkotas Feb 20, 2026

Choose a reason for hiding this comment

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

Do we really need these GPL licensed sources?

@jkotas
Copy link
Member

jkotas commented Feb 20, 2026

the PR as-is increases the native .so by about 60 kB in release on my desktop, there is a reference to lzma_stream_decoder_init in the entryponts.c to validate if it links properly

Does lzma_stream_decoder_init bring the full compression / decompression implementation into the binary?

FWIW, I do not see a problem with the extra code that this brings. We add several megabytes of code to netcoreapp every release. The problem I see is that the overall compression design is not trimming friendly. The moment you enable compression for your HttpClient, you get all compression algorithms in our portfolio in your (AOT compiled) binary - discussed at #123531 (comment) .

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.

4 participants

Comments