Skip to content

Commit 2d6ca2b

Browse files
rustyconoverclaude
andcommitted
sabtable: take vgi-rpc through vgi's re-export, never a direct dependency
The fixture no longer compiled: 32 errors, every one E0053/E0277 of the form `expected vgi::RpcError, found vgi_rpc::RpcError`. Nothing in the trait API had moved; the crate graph held two vgi-rpcs. sabtable required vgi-rpc 0.23.0 directly and patched crates.io to the sibling vgi-rpc-rust checkout, while vgi-rust v0.35.0 wants 0.25.0 from crates.io. 0.x minors never unify, so Cargo resolved 0.23.3 beside vgi's 0.25.0 and no trait impl could match. The same failure was fixed by a version bump in c8247f7 and came back at the next SDK minor. vgi re-exports the crate (`vgi::vgi_rpc`, `vgi::{Result, RpcError}`) precisely so a worker never names its version, so the fixture now imports from there and drops both the direct dependency and the [patch.crates-io]. vgi-rust itself resolves vgi-rpc from crates.io (its workspace keeps any local-checkout patch uncommitted), and the patch made this crate build against whatever branch a sibling vgi-rpc-rust happened to be on — or, on a 0.26.0 checkout, not apply at all. vgi-rpc now resolves exactly once, to the registry 0.25.0 that vgi-rust's own lockfile pins. Also gates the BooleanArray/Float64Array import on emscripten, where the browser fixtures that use it live, which clears the native build's only warning. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 97518e8 commit 2d6ca2b

3 files changed

Lines changed: 26 additions & 20 deletions

File tree

‎test/support/sabtable/Cargo.lock‎

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

‎test/support/sabtable/Cargo.toml‎

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,20 @@ path = "src/lib.rs"
2020
# (tokio); the worker falls back to the zero-dep FsStorage backend, so the native
2121
# staticlib builds with no heavy/C deps.
2222
vgi = { path = "../../../../vgi-rust/vgi", default-features = false }
23-
# Must match the exact vgi-rpc that `vgi` resolves to (the local checkout via
24-
# the [patch.crates-io] below) so the `OutputCollector` /
25-
# `Result` / `RpcError` types are one crate instance, not two. A stale version
26-
# requirement here silently resolves a SECOND vgi-rpc from crates.io and the
27-
# build fails on mismatched `RpcError`/`TableProducer` types.
28-
# Still default-features = false: no `http`, so no axum/tokio/zstd. `vgi` pulls
29-
# in `crypto` (AEAD split tokens, server-stack-free) via feature unification.
30-
vgi-rpc = { version = "0.23.0", default-features = false, features = ["macros", "stream-codec"] }
23+
# No direct `vgi-rpc` dependency: the trait signatures name vgi-rpc's
24+
# `Result`/`RpcError`/`OutputCollector`, and `vgi` re-exports that crate
25+
# (`vgi::vgi_rpc`, `vgi::{Result, RpcError}`) so a worker never names its
26+
# version. A direct requirement here is how this fixture broke twice: whenever it
27+
# lagged the SDK's vgi-rpc minor (0.x minors never unify), Cargo resolved a
28+
# SECOND vgi-rpc beside vgi's and every trait impl failed with E0053
29+
# (`expected vgi::RpcError, found vgi_rpc::RpcError`).
3130
arrow-array = "59"
3231
arrow-schema = "59"
3332
serde = { version = "1", features = ["derive"] }
3433

3534
[profile.release]
3635
opt-level = 2
3736

38-
# vgi (via ../../../../vgi-rust) resolves vgi-rpc to the local checkout;
39-
# point this standalone crate at the same source so both unify to ONE vgi-rpc
40-
# instance.
41-
[patch.crates-io]
42-
vgi-rpc = { path = "../../../../vgi-rpc-rust/vgi-rpc" }
37+
# No [patch.crates-io]: vgi-rust resolves vgi-rpc from crates.io (its workspace
38+
# keeps any local-checkout patch uncommitted), so this crate resolves it the same
39+
# way rather than against whatever branch a sibling vgi-rpc-rust checkout is on.

‎test/support/sabtable/src/lib.rs‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,21 @@ use std::time::Duration;
1313

1414
use arrow_array::cast::AsArray;
1515
use arrow_array::types::Int64Type;
16-
use arrow_array::{Array, ArrayRef, BooleanArray, Float64Array, Int64Array, RecordBatch, StringArray};
16+
use arrow_array::{Array, ArrayRef, Int64Array, RecordBatch, StringArray};
17+
// Only the emscripten-only browser fixtures build these column types.
18+
#[cfg(target_os = "emscripten")]
19+
use arrow_array::{BooleanArray, Float64Array};
1720
use arrow_schema::{DataType, Field, Schema, SchemaRef};
1821

1922
use vgi::aggregate::{AggregateBindParams, AggregateFunction};
2023
use vgi::cache_control::CacheControl;
2124
use vgi::function::{ArgSpec, BindParams, BindResponse, FunctionMetadata, ProcessParams, ScalarFunction};
2225
use vgi::table_function::{TableFunction, TableProducer};
2326
use vgi::table_in_out::{project_batch, TableInOutFunction};
24-
use vgi_rpc::{OutputCollector, Result, RpcError};
27+
// Through vgi's re-export, never a direct vgi-rpc dependency: this is always
28+
// the vgi-rpc the traits were compiled against (see Cargo.toml).
29+
use vgi::vgi_rpc::OutputCollector;
30+
use vgi::{Result, RpcError};
2531

2632
// Worker-side ring ops, implemented in C++ (test/support/vgi_sab_native_ring.cpp)
2733
// natively, or in the browser worker module's --js-library (vgi_worker_lib.js).

0 commit comments

Comments
 (0)