From 518d7ff1dd7aec79fb408df4e59ce01abd44b7fd Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Tue, 22 Sep 2026 15:13:51 +0800 Subject: [PATCH] fix: keep REST server adapter out of production dependencies (#4240) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The production `remote` client talks to an existing namespace over HTTP. It needs `lance-namespace-impls/rest`, not the REST *server* adapter. `RestAdapter` is only used by `cfg(test)` integration tests that stand up an in-process server. Enabling `rest-adapter` on the production `remote` feature pulled that server stack, including Axum 0.7, into default Python wheels. This keeps `rest` on `remote` and moves `rest-adapter` to a `lance-namespace-impls` dev-dependency so those tests still compile and run. Cargo resolver=2 does not leak the extra feature into `lancedb-python`. ## Measurement Paired `maturin build --release --strip --target aarch64-apple-darwin --features fp16kernels` wheels. Source was `3be29228` plus this Cargo.toml change, which is this PR's tree (`878b2ae5` on `3be29228`). Same toolchain, profile, and packaging flags; only `rest-adapter` moved. | Artifact | Before | After | Delta | | --- | ---: | ---: | ---: | | Compressed wheel | 64,685,664 | 63,824,281 | −861,383 (−1.33%) | | `_lancedb.abi3.so` uncompressed | 148,255,440 | 146,275,936 | −1,979,504 (−1.34%) | This is macOS arm64, not Windows. It does not resolve the Windows wheel upload limit. Tonic still pulls Axum 0.8; the change only removes the adapter's Axum 0.7 stack from the production graph. --- rust/lancedb/Cargo.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rust/lancedb/Cargo.toml b/rust/lancedb/Cargo.toml index ebec41318..94857a124 100644 --- a/rust/lancedb/Cargo.toml +++ b/rust/lancedb/Cargo.toml @@ -106,6 +106,9 @@ sha2 = "0.10" [dev-dependencies] anyhow = "1" lance-testing = { workspace = true } +# RestAdapter is only used by cfg(test) code. Keep rest-adapter off the +# production remote feature so Python wheels do not resolve its Axum 0.7 stack. +lance-namespace-impls = { workspace = true, features = ["rest-adapter"] } tempfile = { workspace = true } random_word = { version = "0.4.3", features = ["en"] } tokio = { workspace = true, features = ["io-util", "macros", "net", "test-util"] } @@ -169,7 +172,6 @@ remote = [ "dep:webbrowser", "dep:fs4", "lance-namespace-impls/rest", - "lance-namespace-impls/rest-adapter", ] # Publish LanceDB's internal metrics (currently object store request counts, # bytes, latency, errors, and throttles) through the `metrics` crate facade,