Skip to content

Commit 360bfca

Browse files
committed
common: share the lzma stream engine
Move the VM-independent liblzma stream owner, filter properties, and compression state into a target-gated rustpython-common module. Keep rustpython-stdlib as the Python object and exception adapter, and remove its direct xz dependencies and lzma-only generic compressor machinery. Assisted-by: Codex:GPT-5
1 parent c3dff8f commit 360bfca

8 files changed

Lines changed: 849 additions & 705 deletions

File tree

‎Cargo.lock‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎crates/common/Cargo.toml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ binascii = ["dep:base64", "dep:crc32fast"]
1414
cjk-codecs = []
1515
inet = ["std"]
1616
json = ["dep:memchr", "std"]
17+
lzma = ["std", "dep:xz", "dep:xz-sys"]
1718
std = []
1819
threading = ["parking_lot", "std"]
1920
wasm_js = ["getrandom/wasm_js"]
@@ -40,10 +41,15 @@ num-traits = { workspace = true }
4041
parking_lot = { workspace = true, optional = true }
4142
radium = { workspace = true }
4243
zlib-rs = { workspace = true, optional = true }
43-
4444
lock_api = { workspace = true }
4545
siphasher = { workspace = true }
4646
num-complex = { workspace = true }
4747

48+
[target.'cfg(not(any(target_os = "android", target_arch = "wasm32")))'.dependencies]
49+
# RustPython does not expose `_lzma` on these targets; keep the native engine's
50+
# dependency boundary with its common-module owner rather than in stdlib.
51+
xz = { workspace = true, optional = true }
52+
xz-sys = { workspace = true, optional = true }
53+
4854
[lints]
4955
workspace = true

0 commit comments

Comments
 (0)