Repository navigation
Conversation
TerminalResult::decode matched on Error::Http unconditionally, but that variant is #[cfg(feature = "remote")]-gated in error.rs while job.rs's `pub mod job;` declaration in lib.rs is not. Building the crate with default-features = false and without `remote` fails to compile with two E0599s. request_id is only ever Some via TerminalResult::remote, which is itself only constructed from remote-gated code, so the Some arms are gated the same way, with an Error::Runtime fallback for the (unreachable without remote) case. Fixes #4096
|
@lancedb-gatekeeper addressed the request: added a package-scoped This closes the gap you flagged — the workspace-wide "without remote" lint still built Verified locally: (only the pre-existing, unrelated Pushed as d91a3f8. |
The workspace-wide "without remote feature" clippy step still builds `lancedb` with `remote` enabled, since `python/Cargo.toml` and `nodejs/Cargo.toml` both default that feature on and workspace feature unification re-enables it for the shared `lancedb` build unit. That let the `Error::Http`/`Error::Retry` regression this PR fixes slip through CI undetected. Add a package-scoped `cargo check -p lancedb --tests --no-default-features` step so remote-gated code (rust/lancedb/src/job.rs) is actually compiled without the feature.
2deb212 to
d91a3f8
Compare
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The author’s update adds the package-scoped no-default-features check, and the exact workflow command succeeds on this head. That closes the only prior finding. The cfg guards restore non-remote compilation while preserving remote HTTP error classification and request IDs.
What is the bug?
Fixes #4096.
Building
lancedbwithdefault-features = falseand without theremotefeature failsto compile:
TerminalResult::decode(added by the recent job-handle work, e.g. #3742, #3755, #3939,#4013) matches on
Error::Http { .. }unconditionally in two places.Error::Http(andError::Retry) are#[cfg(feature = "remote")]-gated inerror.rs, butlib.rs'spub mod job;is not itself feature-gated, sojob.rsis compiled for every featurecombination — including any downstream consumer that doesn't enable
remote(our owncase pins
default-features = false, features = ["metrics-otel"]).How does this PR fix the problem?
request_id: Option<String>onTerminalResultis only everSomeviaTerminalResult::remote(..), which is itself only constructed fromremote-gated code(
crate::remote::job). So the twoSome(request_id) => Error::Http { .. }arms are gatedbehind
#[cfg(feature = "remote")], with a#[cfg(not(feature = "remote"))]fallback armproducing
Error::Runtimefor the (unreachable withoutremote) case — matching theexisting
None => Error::Runtime { .. }arm's message.Why did CI not catch this?
Worth flagging separately: the "Run clippy (without remote feature)" step in
.github/workflows/rust.ymlrunscargo clippy --workspace --tests(no--all-features),but
python/Cargo.tomlandnodejs/Cargo.tomlboth declaredefault = ["remote", ...]on theirlancedbdependency. Workspace-wide featureunification means that default re-enables
remoteon the sharedlancedbbuild unit evenin this step, so it never actually builds
lancedbwithoutremote. Scoping that step to-p lancedbdoes catch this class of bug (confirmed locally), but it also currently tripson ~10 pre-existing, unrelated
dead_codewarnings elsewhere in the crate (job.rs's ownTerminalResult::remote/value,query.rs,table/computed_columns.rs,table/lsm_stats.rs,utils/mod.rs) once it gets far enough to run clippy's lints — soI've left that CI change out of this PR to keep it scoped to the actual bug. Happy to open
a follow-up for that if it's useful.
Validation
All run against this branch, from
rust/:No existing tests needed changes;
job.rs's own unit tests don't exercise theremotepath (nothing in that file constructs
TerminalResult::remote), so this is purely acompile-time fix.