Skip to content

Commit 6a9a2a2

Browse files
committed
Move OnPair default-feature flag up to the vortex umbrella crate
Wiring `default = ["onpair"]` directly on `vortex-btrblocks` and `vortex-file` meant any consumer that depended on those crates with default features on (including `wasm-test`, which sets `vortex = { default-features = false }` but cannot disable transitive default features on a hard dep of `vortex`) ended up pulling `vortex-onpair-sys` and its CMake / C++20 build, which fails on wasm32-wasip1. Move the default-on toggle to the umbrella `vortex` crate: * `vortex-btrblocks` and `vortex-file` now declare `onpair` as a feature with **no `default = [...]` line** — they're a la carte. * `vortex/Cargo.toml`: `default = ["files", "zstd", "onpair"]` plus a new `onpair = ["vortex-btrblocks/onpair", "vortex-file?/onpair"]` alias so `vortex` consumers still get OnPair out of the box but `default-features = false` callers (wasm-test) really do drop it. * `only_cuda_compatible` annotates its now-conditionally-mutated `excluded` list with `#[cfg_attr(not(feature = "onpair"), allow(unused_mut))]` so no-default-features builds stop warning. Verified: cargo build --target wasm32-wasip1 \ --manifest-path wasm-test/Cargo.toml # green, no C++ build Signed-off-by: Claude <noreply@anthropic.com>
1 parent 803bc4e commit 6a9a2a2

4 files changed

Lines changed: 10 additions & 3 deletions

File tree

vortex-btrblocks/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ vortex-array = { workspace = true, features = ["_test-harness"] }
4848
vortex-session = { workspace = true }
4949

5050
[features]
51-
default = ["onpair"]
5251
# This feature enabled unstable encodings for which we don't guarantee stability.
5352
unstable_encodings = ["dep:vortex-tensor", "vortex-zstd?/unstable_encodings"]
53+
# OnPair short-string compression. Pulls in a C++ build dependency (CMake +
54+
# C++20). Off by default so wasm / minimal-deps builds work; the umbrella
55+
# `vortex` crate enables it in its own defaults.
5456
onpair = ["dep:vortex-onpair"]
5557
pco = ["dep:pco", "dep:vortex-pco"]
5658
zstd = ["dep:vortex-zstd"]

vortex-btrblocks/src/builder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ impl BtrBlocksCompressorBuilder {
173173
// dictionary expansion at decode time, which is incompatible with
174174
// pure-GPU decompression paths. Strip whichever string-fragment
175175
// scheme is enabled by feature.
176+
#[cfg_attr(not(feature = "onpair"), allow(unused_mut))]
176177
let mut excluded: Vec<SchemeId> = vec![
177178
integer::SparseScheme.id(),
178179
integer::IntRLEScheme.id(),

vortex-file/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ vortex-scan = { workspace = true }
6969
workspace = true
7070

7171
[features]
72-
default = ["onpair"]
7372
object_store = ["dep:object_store", "vortex-io/object_store", "tokio"]
73+
# OnPair short-string compression (see vortex-btrblocks for build details).
7474
onpair = ["dep:vortex-onpair", "vortex-btrblocks/onpair"]
7575
tokio = [
7676
"dep:tokio",

vortex/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,14 @@ vortex-bench = { workspace = true, features = ["unstable_encodings"] }
6969
vortex-tensor = { workspace = true }
7070

7171
[features]
72-
default = ["files", "zstd"]
72+
default = ["files", "zstd", "onpair"]
7373
files = ["dep:vortex-file"]
7474
memmap2 = ["vortex-buffer/memmap2"]
7575
object_store = ["vortex-file/object_store", "vortex-io/object_store"]
76+
# OnPair short-string compression. Requires a C++ build toolchain
77+
# (CMake + C++20). Enabled by default but consumers can opt out via
78+
# `default-features = false`.
79+
onpair = ["vortex-btrblocks/onpair", "vortex-file?/onpair"]
7680
tokio = ["vortex-file/tokio"]
7781
zstd = ["dep:vortex-zstd", "vortex-file/zstd"]
7882
pretty = ["vortex-array/table-display"]

0 commit comments

Comments
 (0)