forked from alexcrichton/xz2-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Further optimization #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 16 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
a57a504
Decouple liblzma-sys backend from bindgen
youknowone c6236a1
trim
youknowone 5142a3d
Refine xz internals and restore systest perf builds
youknowone 1f964de
Tidy trivial c2rust naming remnants
youknowone 3627f85
Tidy remaining low-risk c2rust naming
youknowone 1ebdc7b
Use ctest 0.5.1 raw identifier support
youknowone a93e21b
Reduce mutable statics and narrow unsafe helpers
youknowone d8d77f1
revert crc64
youknowone 2d7323e
ifix
youknowone 19e4fe3
cleanup
youknowone ce93d55
Reduce internal panic paths
youknowone 0314bc7
Refine LZMA hot paths and backend comparison tooling
youknowone 834e3fd
Tune performance probes and hot paths
youknowone c4b047d
Trim hot-path function-pointer checks
youknowone 2211802
remove redundant
youknowone dc080a9
edition 2024
youknowone 1c627e0
xz 5.8.3
youknowone 146611d
Optino<fn>
youknowone e8a96e6
Replace c2rust state hashes with named control flow
youknowone b36bdd0
Refine allocator defaults and optimum helper flow
youknowone d1ae9b8
refine
youknowone db7ed70
Revert top-level src changes to origin
youknowone 1a94603
1.88
youknowone 674511a
fix systest
youknowone e944c6f
let-else
youknowone 7a41ac9
Restore cold literal-after helpers in optimum encoder
youknowone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
In Cargo, when the same crate appears in[dependencies]and[dev-dependencies], are features unified for benches/examples/tests, and do default features from the dev-dependency stay enabled?💡 Result:
Yes, when the same crate appears in both [dependencies] and [dev-dependencies], Cargo unifies the features for builds that include dev-dependencies (benches, examples, tests). This uses the union of features specified in both sections. Default features from the dev-dependency declaration remain enabled unless explicitly disabled there (via default-features = false). For normal builds (cargo build on lib/bin), only [dependencies] features apply (dev-deps ignored). This behavior depends on the feature resolver version (default "2" for edition 2021+, controlled by top-level resolver field). Resolver v2 avoids unwanted unification but includes dev-dep features when building dev targets like tests/examples/benches. Example from docs: [dependencies] serde = {version = "1.0", default-features = false} [dev-dependencies] serde = {version = "1.0", features = ["std"]} - cargo build: serde without features (defaults off). - cargo test: serde with "std" (union, defaults from dev-dep enabled since not disabled).
Citations:
🏁 Script executed:
Repository: youknowone/xz-rs
Length of output: 1680
liblzma-sysstill enablesbindgenfor dev targets.Line 45 defines a target-specific dev-dependency
liblzma-sys = { path = "liblzma-sys" }withoutdefault-features = false. When benches/examples/tests are built with theliblzma-sysfeature, Cargo unifies features across dependencies and dev-dependencies, re-enabling the defaultbindgenfeature from the dev-dependency. This defeats the goal of disabling it at Line 25 and keeps the libclang requirement around for those builds.♻️ Proposed fix
[target.'cfg(not(target_family = "wasm"))'.dev-dependencies] xz-sys = { path = "xz-sys" } -liblzma-sys = { path = "liblzma-sys" } +liblzma-sys = { path = "liblzma-sys", default-features = false }🤖 Prompt for AI Agents