X Tutup
Skip to content

Replace usage of Zstandard advanced API#113234

Merged
akien-mga merged 1 commit intogodotengine:masterfrom
mihe:no-advanced-zstd
Nov 27, 2025
Merged

Replace usage of Zstandard advanced API#113234
akien-mga merged 1 commit intogodotengine:masterfrom
mihe:no-advanced-zstd

Conversation

@mihe
Copy link
Contributor

@mihe mihe commented Nov 27, 2025

Fixes #113216.

#112011 apparently broke builtin_zstd=no, because I had used parts of the Zstandard API that are considered "advanced", which are liable to have their signature changed at some point in the future. This means you need to build Zstandard with ZSTD_STATIC_LINKING_ONLY, which the built-in one does, but which you obviously can't do with a system-provided libzstd.

This fixes that by replacing ZSTD_findDecompressedSize with ZSTD_getFrameContentSize, which should work just as well. It might perhaps cause issues if we ever switch to using streaming compression instead, but I believe ZSTD_CCtx_setPledgedSrcSize should mitigate that (which I threw in already for good measure).

I also had to replace ZSTD_getParams and ZSTD_CCtx_setParams with individually setting the parameters using ZSTD_CCtx_setParameter. When stepping through the compression in a debugger it seems Zstandard effectively ends up calling ZSTD_getParams under the hood anyway, using whatever overrides you've provided through ZSTD_CCtx_setParameter, so this made no functional difference at all.

I've confirmed that this builds with builtin_zstd=no on Fedora 42.

@akien-mga akien-mga merged commit 4bb9ef7 into godotengine:master Nov 27, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@mihe mihe deleted the no-advanced-zstd branch November 27, 2025 22:40
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.

builtin_zstd=no build on Fedora 43 fails following delta encoding PCK merge

3 participants

X Tutup