Repository navigation
ruff: link pkgs' libzstd instead of zstd-sys's vendored copy - #1739
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 ruff NEEDs libzstd.so.1 (the same pattern as codex). ruff's lock has zstd-sys 2.1.2+zstd.1.5.7, the same zstd as pkgs'. 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
ruff 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 unlessruffhasNEEDED libzstd.so.1.This is the same pattern as codex (#1713) and the uv PR.
Why
Evidence
Cargo.lock, read from the pinned tarball (sha2562c7f6831…), has zstd-sys2.1.2+zstd.1.5.7, zstd-safe 8.2.0 and zstd 0.14.3. pkgs zstd is 1.5.7, so the versions match.ruff -> ruff_db -> zip -> zstd -> zstd-safe -> zstd-sys. Thezstdfeature on zip comes fromty_vendored/zstd, whichty_projectenables.build.shruns a workspace-widecargo build --release, so feature unification turns it on for theruffbinary too.zstd-sys's pkg-config path panics whenlibzstdisn't found, 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).
Follow-up idea (not in this PR)
build.shbuilds the whole workspace: ty, ty_server, the wasm crates and the rest, none of which this package ships. Restricting the cargo build to-p ruffwould save much more build time than this PR does.The trade-off: it drops the feature unification that turns on
ty_vendored/zstd. The vendored typeshed zip would then be Stored instead of zstd-compressed, and ruff would no longer link libzstd at all. That is a separate decision.🤖 Generated with Claude Code