Repository navigation
uv: link pkgs' libzstd instead of zstd-sys's vendored copy - #1738
Draft
bryan-minimal wants to merge 1 commit into
Draft
bryan-minimal wants to merge 1 commit into
bryan-minimal wants to merge 1 commit into
Conversation
ZSTD_SYS_USE_PKG_CONFIG=1 with pkgconf + zstd as build deps, libzstd as a runtime dep, and a readelf check that uv NEEDs libzstd.so.1 (the same pattern as codex). A fix to pkgs' zstd then reaches uv without waiting for a zstd-sys release, and the C library is no longer compiled in every uv build. The generated lock-patch block, including its zstd-sys floor, is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
uv links pkgs'
libzstdinstead of the copy vendored inzstd-sys:ZSTD_SYS_USE_PKG_CONFIG=1.pkgconfandzstdas build deps, andsubsetOf zstd ["libzstd"]as a runtime dep.readelfcheck fails the build unlessuvhasNEEDED libzstd.so.1.This is the same pattern as codex (#1713,
packages/codex/build.sh).The generated
pkgmgr lock-patchblock is untouched, and so is its zstd-sys floor (RUSTSEC-2026-0410). That advisory concerns the wasm32 allocator shim only, so it doesn't apply on our targets either way.Why
Evidence and one caveat
Cargo.lockat 0.13.10 has zstd-sys2.1.0+zstd.1.5.7. However, the effective lock is different:security-floors-lock.patchmoves zstd-sys to2.2.0+zstd.1.6.0as a companion of the zstd-safe floors. Its pregenerated bindings are for zstd 1.6.0, while pkgs zstd is 1.5.7. So for uv this is not "same version": the C library effectively goes from the bundled 1.6.0 to the system 1.5.7.ZSTD_CCtx_loadDictionary_advanced,ZSTD_DCtx_loadDictionary_advanced,ZSTD_createDDict_byReferenceandZSTD_getFrameHeader.ZSTDLIB_STATIC_APIin zstd 1.5.7'szstd.h, which means visible and exported fromlibzstd.so. pkgs' zstd build doesn't hide them.ZSTD_FrameHeaderhas the same layout, and the enum values are unchanged.zstd-sys'spkg_config()panics whenlibzstdisn't found (.expect), so there is no silent fallback. The NEEDED check is belt-and-braces.minimal buildcheck is the verifier. Nothing was built locally.Expected saving: small per build (one C library, about a minute). uv rebuilds often, though: 0.13.4 → 0.13.10 was 7 bumps.
🤖 Generated with Claude Code