diff --git a/AGENTS.md b/AGENTS.md index 4765be596..f9897d61e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -86,9 +86,10 @@ cargo +1.86 check --ignore-rust-version -p ggsql There is deliberately **no root `rust-toolchain.toml`**: pinning to 1.86 would force local `cargo test` and rust-analyzer onto the oldest supported toolchain. CI's default toolchain is stable — which still guards the MSRV, because clippy reads `rust-version`, not the toolchain — with the 1.86 check as its own step. -One thing is exempt from the 1.86 MSRV: +Two packages set their own toolchain requirements: - **The wasm bindings (`ggsql-wasm`).** R doesn't use wasm, and some wasm-only dependencies require a newer rustc, so the crate has no `rust-version` and a nested `ggsql-wasm/rust-toolchain.toml` selects **stable** for builds run from that directory (`./build-wasm.sh`, Cargo, or `pkg/`). +- **The Jupyter kernel (`ggsql-jupyter`).** The standalone kernel requires Rust 1.93 for `omq-tokio`. CRAN builds the library without the kernel. ### Rendering plots on Linux diff --git a/Cargo.lock b/Cargo.lock index 3cdb9db58..0363d23ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -126,7 +126,7 @@ dependencies = [ "ndk-context", "ndk-sys", "num_enum", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -229,6 +229,15 @@ dependencies = [ "derive_arbitrary", ] +[[package]] +name = "arc-swap" +version = "1.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b5d51209f6de83d37a0b33d320acb8da88823e42a94c075140708f032a5" +dependencies = [ + "rustversion", +] + [[package]] name = "arrayref" version = "0.3.9" @@ -442,30 +451,6 @@ dependencies = [ "libloading", ] -[[package]] -name = "async-trait" -version = "0.1.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "asynchronous-codec" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a860072022177f903e59730004fb5dc13db9275b79bb2aef7ba8ce831956c233" -dependencies = [ - "bytes", - "futures-sink", - "futures-util", - "memchr", - "pin-project-lite", -] - [[package]] name = "atoi" version = "2.0.0" @@ -687,9 +672,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "bytes" -version = "1.11.1" +version = "1.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" +checksum = "776dfebd015e2d8732c684a2c71003674ccb49457b539b9e82151ba38e96dd7c" [[package]] name = "calloop" @@ -743,9 +728,20 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cfg_aliases" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" + +[[package]] +name = "chacha20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.1", + "rand_core 0.10.1", +] [[package]] name = "chrono" @@ -757,7 +753,7 @@ dependencies = [ "js-sys", "num-traits", "wasm-bindgen", - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -863,6 +859,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", + "loom", ] [[package]] @@ -992,6 +989,15 @@ dependencies = [ "libc", ] +[[package]] +name = "cpufeatures" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.5.0" @@ -1079,9 +1085,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.21" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" [[package]] name = "crossterm" @@ -1108,7 +1114,7 @@ dependencies = [ "document-features", "mio", "parking_lot", - "rustix 1.1.4", + "rustix 1.1.6", "signal-hook", "signal-hook-mio", "winapi", @@ -1157,19 +1163,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f" -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - [[package]] name = "data-encoding" version = "2.11.0" @@ -1369,6 +1362,19 @@ dependencies = [ "regex-syntax", ] +[[package]] +name = "fanring" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "822dd8c68f1f0b90a3c2d60a21f703f125cae4c7feecdb259ea8548b274667ad" +dependencies = [ + "arc-swap", + "atomic-waker", + "concurrent-queue", + "loom", + "yring", +] + [[package]] name = "fast-srgb8" version = "1.0.0" @@ -1504,7 +1510,7 @@ dependencies = [ "roxmltree", "smallvec", "windows", - "windows-core", + "windows-core 0.62.2", "yeslogic-fontconfig-sys", ] @@ -1560,11 +1566,25 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" +[[package]] +name = "futures" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + [[package]] name = "futures-channel" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" dependencies = [ "futures-core", "futures-sink", @@ -1572,9 +1592,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" [[package]] name = "futures-intrusive" @@ -1589,39 +1609,40 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" [[package]] name = "futures-macro" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 3.0.4", ] [[package]] name = "futures-sink" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" +checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" [[package]] name = "futures-task" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" [[package]] name = "futures-util" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" dependencies = [ + "futures-channel", "futures-core", "futures-io", "futures-macro", @@ -1632,6 +1653,20 @@ dependencies = [ "slab", ] +[[package]] +name = "generator" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6c6a73cd1aa4f4f00c02b109fa55d3a9d6ecc2fc4f53177b74ed6ee23b0c53" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "windows-core 0.100.0", + "windows-sys 0.61.2", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1662,7 +1697,7 @@ dependencies = [ "log", "serde", "serde_json", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -1685,8 +1720,8 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8" dependencies = [ - "rustix 1.1.4", - "windows-link", + "rustix 1.1.6", + "windows-link 0.2.1", ] [[package]] @@ -1725,6 +1760,7 @@ dependencies = [ "cfg-if", "libc", "r-efi 6.0.0", + "rand_core 0.10.1", "wasip2", "wasip3", ] @@ -1791,6 +1827,7 @@ dependencies = [ "ggsql", "hex", "hmac", + "omq-tokio", "serde", "serde_json", "sha2", @@ -1800,7 +1837,6 @@ dependencies = [ "tracing", "tracing-subscriber", "uuid", - "zeromq", ] [[package]] @@ -1878,7 +1914,7 @@ dependencies = [ "hashbrown 0.16.1", "log", "presser", - "thiserror 2.0.18", + "thiserror 2.0.21", "windows", ] @@ -1945,12 +1981,6 @@ dependencies = [ "ahash 0.7.8", ] -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - [[package]] name = "hashbrown" version = "0.15.5" @@ -2025,7 +2055,7 @@ dependencies = [ "pollster", "pulldown-cmark", "skrifa 0.44.0", - "thiserror 2.0.18", + "thiserror 2.0.21", "tiff", "vello_common", "vello_hybrid", @@ -2170,7 +2200,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core", + "windows-core 0.62.2", ] [[package]] @@ -2403,9 +2433,9 @@ dependencies = [ "jni-sys 0.4.1", "log", "simd_cesu8", - "thiserror 2.0.18", + "thiserror 2.0.21", "walkdir", - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -2516,7 +2546,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb26cec98cce3a3d96cbb7bced3c4b16e3d13f27ec56dbd62cbc8f39cfb9d653" dependencies = [ - "cpufeatures", + "cpufeatures 0.2.17", ] [[package]] @@ -2697,9 +2727,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.186" +version = "0.2.191" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" [[package]] name = "libduckdb-sys" @@ -2725,7 +2755,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" dependencies = [ "cfg-if", - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -2834,6 +2864,19 @@ dependencies = [ "logos-codegen", ] +[[package]] +name = "loom" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1611ddbf89dc6ae42cfbd51fc207836140130257646eab8d6d2fb16577db2d2" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", +] + [[package]] name = "lru-slab" version = "0.1.2" @@ -2917,7 +2960,7 @@ dependencies = [ "once_cell", "rustc-hash 1.1.0", "spirv", - "thiserror 2.0.18", + "thiserror 2.0.21", "unicode-ident", ] @@ -2957,6 +3000,18 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" +[[package]] +name = "nix" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77730ed34f01f4990cb2ea67fec715ecebc6fab9a6396cf83c5529b13f581bdc" +dependencies = [ + "bitflags 2.11.1", + "cfg-if", + "cfg_aliases", + "libc", +] + [[package]] name = "nu-ansi-term" version = "0.50.3" @@ -3337,6 +3392,64 @@ dependencies = [ "objc2-foundation 0.2.2", ] +[[package]] +name = "omq-proto" +version = "0.40.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6f0a9ef3a3a86a56522c00583524899d3f340933a1073b57ecbd3f86d8d3e4" +dependencies = [ + "bytes", + "concurrent-queue", + "loom", + "patricia_tree", + "rand 0.10.4", + "smallvec", + "socket2", + "thiserror 2.0.21", +] + +[[package]] +name = "omq-shm" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b9e5d88a7e53d9a2a50b55d544c853718dcebbfd6e0e982413d1d44f7caf160" +dependencies = [ + "arc-swap", + "bytes", + "concurrent-queue", + "omq-proto", + "rand 0.10.4", + "rustix 1.1.6", +] + +[[package]] +name = "omq-tokio" +version = "0.37.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f266cc8410301e20ea96c58c355db4e2bd8b2443dee5a40c0769822a1ddd2583" +dependencies = [ + "arc-swap", + "bytes", + "concurrent-queue", + "crossbeam-utils", + "fanring", + "futures", + "libc", + "nix", + "omq-proto", + "omq-shm", + "parking_lot", + "pin-project-lite", + "rand 0.10.4", + "rustc-hash 2.1.3", + "smallvec", + "socket2", + "thiserror 2.0.21", + "tokio", + "tokio-util", + "yring", +] + [[package]] name = "once_cell" version = "1.21.4" @@ -3435,7 +3548,7 @@ dependencies = [ "libc", "redox_syscall 0.5.18", "smallvec", - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -3511,6 +3624,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" +[[package]] +name = "patricia_tree" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fd106b8571932f2b8d961a296390c56f05d454ce95e2405f1d8703ca0119e8e" + [[package]] name = "peniko" version = "0.6.1" @@ -3655,7 +3774,7 @@ dependencies = [ "concurrent-queue", "hermit-abi", "pin-project-lite", - "rustix 1.1.4", + "rustix 1.1.6", "windows-sys 0.61.2", ] @@ -3812,10 +3931,10 @@ dependencies = [ "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash 2.1.2", + "rustc-hash 2.1.3", "rustls", "socket2", - "thiserror 2.0.18", + "thiserror 2.0.21", "tokio", "tracing", "web-time", @@ -3832,11 +3951,11 @@ dependencies = [ "lru-slab", "rand 0.9.4", "ring", - "rustc-hash 2.1.2", + "rustc-hash 2.1.3", "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.18", + "thiserror 2.0.21", "tinyvec", "tracing", "web-time", @@ -3904,6 +4023,17 @@ dependencies = [ "rand_core 0.9.5", ] +[[package]] +name = "rand" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f6fa277c67e6ea590466f04c3fe82cb509f0864fe470643e5570de9514a9b11" +dependencies = [ + "chacha20", + "getrandom 0.4.2", + "rand_core 0.10.1", +] + [[package]] name = "rand_chacha" version = "0.3.1" @@ -3942,6 +4072,12 @@ dependencies = [ "getrandom 0.3.4", ] +[[package]] +name = "rand_core" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" + [[package]] name = "range-alloc" version = "0.1.5" @@ -4192,7 +4328,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8a1f2315036ef6b1fbacd1972e8ee7688030b0a2121edfc2a6550febd41574d" dependencies = [ "hashbrown 0.16.1", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -4236,9 +4372,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc-hash" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" [[package]] name = "rustc_version" @@ -4264,9 +4400,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ "bitflags 2.11.1", "errno", @@ -4453,7 +4589,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "digest", ] @@ -4578,9 +4714,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.15.1" +version = "1.16.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +checksum = "3244542535d5de959d90ec55d1b5ff0fd2bb7b1310223907d5f11932847f7b59" [[package]] name = "smithay-client-toolkit" @@ -4647,7 +4783,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0e59842c3aac5c7901ea11bbb02e60e5d67263b43d4361dec9303cca8e764eb" dependencies = [ - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -4815,7 +4951,7 @@ dependencies = [ "fastrand", "getrandom 0.4.2", "once_cell", - "rustix 1.1.4", + "rustix 1.1.6", "windows-sys 0.61.2", ] @@ -4849,7 +4985,7 @@ dependencies = [ "lazy-regex", "minimad", "serde", - "thiserror 2.0.18", + "thiserror 2.0.21", "unicode-width 0.1.14", ] @@ -4864,11 +5000,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.18" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" dependencies = [ - "thiserror-impl 2.0.18", + "thiserror-impl 2.0.21", ] [[package]] @@ -4884,13 +5020,13 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.18" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 3.0.4", ] [[package]] @@ -4987,9 +5123,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.52.3" +version = "1.54.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" +checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3" dependencies = [ "bytes", "libc", @@ -5025,14 +5161,14 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.18" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +checksum = "e464cf451ba96ebfc6f9b6542f17ee8b8956e33f1e40d9690624e59d7a7f8a4b" dependencies = [ "bytes", "futures-core", - "futures-io", "futures-sink", + "futures-util", "pin-project-lite", "tokio", ] @@ -5429,7 +5565,7 @@ dependencies = [ "log", "peniko", "smallvec", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -5442,7 +5578,7 @@ dependencies = [ "glifo", "hashbrown 0.17.1", "log", - "thiserror 2.0.18", + "thiserror 2.0.21", "vello_common", "vello_sparse_shaders", "wgpu", @@ -5613,7 +5749,7 @@ checksum = "38a91b4eaddff87b1cd1074985e3713da4af2c49742d1b356b2c01670a67a078" dependencies = [ "cc", "downcast-rs", - "rustix 1.1.4", + "rustix 1.1.6", "scoped-tls", "smallvec", "wayland-sys", @@ -5626,7 +5762,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3c36a0f861ad76d0901f2800b46321410d9f73f2ea88aac0650d86c32688073" dependencies = [ "bitflags 2.11.1", - "rustix 1.1.4", + "rustix 1.1.6", "wayland-backend", "wayland-scanner", ] @@ -5648,7 +5784,7 @@ version = "0.31.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a52d18780be9b1314328a3de5f930b73d2200112e3849ca6cb11822793fb34d" dependencies = [ - "rustix 1.1.4", + "rustix 1.1.6", "wayland-client", "xcursor", ] @@ -5760,7 +5896,7 @@ dependencies = [ "half", "itertools", "num-traits", - "thiserror 2.0.18", + "thiserror 2.0.21", "wesl-macros", "wgsl-parse", "wgsl-types", @@ -5831,7 +5967,7 @@ dependencies = [ "raw-window-handle", "rustc-hash 1.1.0", "smallvec", - "thiserror 2.0.18", + "thiserror 2.0.21", "wgpu-core-deps-apple", "wgpu-core-deps-emscripten", "wgpu-core-deps-windows-linux-android", @@ -5910,15 +6046,15 @@ dependencies = [ "raw-window-metal", "renderdoc-sys", "smallvec", - "thiserror 2.0.18", + "thiserror 2.0.21", "wasm-bindgen", "wayland-sys", "web-sys", "wgpu-naga-bridge", "wgpu-types", "windows", - "windows-core", - "windows-result", + "windows-core 0.62.2", + "windows-result 0.4.1", ] [[package]] @@ -5958,7 +6094,7 @@ dependencies = [ "lalrpop-util", "lexical", "logos", - "thiserror 2.0.18", + "thiserror 2.0.21", "wgsl-types", ] @@ -6011,7 +6147,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" dependencies = [ "windows-collections", - "windows-core", + "windows-core 0.62.2", "windows-future", "windows-numerics", ] @@ -6022,7 +6158,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" dependencies = [ - "windows-core", + "windows-core 0.62.2", ] [[package]] @@ -6031,11 +6167,24 @@ version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" dependencies = [ - "windows-implement", - "windows-interface", - "windows-link", - "windows-result", - "windows-strings", + "windows-implement 0.60.2", + "windows-interface 0.59.3", + "windows-link 0.2.1", + "windows-result 0.4.1", + "windows-strings 0.5.1", +] + +[[package]] +name = "windows-core" +version = "0.100.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "803590c6856f51d15fa2e9fabe4f4703122c8737f72ef2741b4ac09d4c2192f5" +dependencies = [ + "windows-implement 0.100.0", + "windows-interface 0.100.0", + "windows-link 0.100.0", + "windows-result 0.100.0", + "windows-strings 0.100.0", ] [[package]] @@ -6044,8 +6193,8 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" dependencies = [ - "windows-core", - "windows-link", + "windows-core 0.62.2", + "windows-link 0.2.1", "windows-threading", ] @@ -6060,6 +6209,17 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "windows-implement" +version = "0.100.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc1bc82e5a1b1a4d7255861b07881a0407b552f50a4d8543c0c7276fa96f6e8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "windows-interface" version = "0.59.3" @@ -6071,20 +6231,37 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "windows-interface" +version = "0.100.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3f7005c3b757b9b82c2f40c0e71094ff1080adddaf3e8b6ce99b545d3c48796" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "windows-link" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +[[package]] +name = "windows-link" +version = "0.100.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b39de7c7fe78858b0144c50c3fc000bab3be17d5e9b85b1053871693c7f7415" + [[package]] name = "windows-numerics" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" dependencies = [ - "windows-core", - "windows-link", + "windows-core 0.62.2", + "windows-link 0.2.1", ] [[package]] @@ -6093,9 +6270,9 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" dependencies = [ - "windows-link", - "windows-result", - "windows-strings", + "windows-link 0.2.1", + "windows-result 0.4.1", + "windows-strings 0.5.1", ] [[package]] @@ -6104,7 +6281,16 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ - "windows-link", + "windows-link 0.2.1", +] + +[[package]] +name = "windows-result" +version = "0.100.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44873a1ef61c85d5e2991db91fe656cfcf0731097e00dff1ac860f1cb3b752a0" +dependencies = [ + "windows-link 0.100.0", ] [[package]] @@ -6113,7 +6299,16 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" dependencies = [ - "windows-link", + "windows-link 0.2.1", +] + +[[package]] +name = "windows-strings" +version = "0.100.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a70b590c684f1d2854f74999896f7c0558f1bdde62f599088599e20ea1d2f60" +dependencies = [ + "windows-link 0.100.0", ] [[package]] @@ -6149,7 +6344,7 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -6174,7 +6369,7 @@ version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ - "windows-link", + "windows-link 0.2.1", "windows_aarch64_gnullvm 0.53.1", "windows_aarch64_msvc 0.53.1", "windows_i686_gnu 0.53.1", @@ -6191,7 +6386,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" dependencies = [ - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -6514,7 +6709,7 @@ dependencies = [ "libc", "libloading", "once_cell", - "rustix 1.1.4", + "rustix 1.1.6", "x11rb-protocol", ] @@ -6531,7 +6726,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" dependencies = [ "libc", - "rustix 1.1.4", + "rustix 1.1.6", ] [[package]] @@ -6599,6 +6794,15 @@ dependencies = [ "synstructure", ] +[[package]] +name = "yring" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbf3b929ee32afe8b4f4c47e3647071775e59bcf67e0cbbbd360d30180bf1e91" +dependencies = [ + "loom", +] + [[package]] name = "zerocopy" version = "0.8.48" @@ -6646,33 +6850,6 @@ version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" -[[package]] -name = "zeromq" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a4528179201f6eecf211961a7d3276faa61554c82651ecc66387f68fc3004bd" -dependencies = [ - "async-trait", - "asynchronous-codec", - "bytes", - "crossbeam-queue", - "dashmap", - "futures-channel", - "futures-io", - "futures-task", - "futures-util", - "log", - "num-traits", - "once_cell", - "parking_lot", - "rand 0.8.6", - "regex", - "thiserror 1.0.69", - "tokio", - "tokio-util", - "uuid", -] - [[package]] name = "zerotrie" version = "0.2.4" diff --git a/ggsql-jupyter/Cargo.toml b/ggsql-jupyter/Cargo.toml index 47590aef3..dff5d9b42 100644 --- a/ggsql-jupyter/Cargo.toml +++ b/ggsql-jupyter/Cargo.toml @@ -2,7 +2,7 @@ name = "ggsql-jupyter" version.workspace = true edition.workspace = true -rust-version.workspace = true +rust-version = "1.93" authors.workspace = true license.workspace = true repository.workspace = true @@ -28,9 +28,8 @@ ggsql = { workspace = true, features = ["duckdb", "svg", "pdf"] } # Arrow for DataFrame array types arrow = { workspace = true } -# Async runtime. `sync` is named explicitly for the render thread's outcome -# channel rather than relying on another dependency to enable it. -tokio = { workspace = true, features = ["sync"] } +# Async runtime +tokio = { workspace = true, features = ["macros", "rt-multi-thread", "signal", "sync"] } # CLI clap = { workspace = true } @@ -50,8 +49,8 @@ chrono = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } -# Jupyter kernel - we'll try zeromq approach first since it's proven -zeromq = { version = "0.4", features = ["tokio-runtime", "tcp-transport"] } +# Jupyter transport +omq-tokio = "0.37.1" bytes = "1.0" # Message authentication diff --git a/ggsql-jupyter/src/kernel.rs b/ggsql-jupyter/src/kernel.rs index 9eb03f4ae..0bb44179d 100644 --- a/ggsql-jupyter/src/kernel.rs +++ b/ggsql-jupyter/src/kernel.rs @@ -11,23 +11,25 @@ use crate::message::{ConnectionInfo, JupyterMessage, MessageHeader}; use crate::plot::comm::{PlotMetadata, RenderParams, RpcError}; use crate::plot::{PlotBackend, RenderOutcome, RenderTicket}; use anyhow::Result; +use bytes::Bytes; use ggsql::reader::ResolvedPlot; use hmac::{Hmac, Mac}; +use omq_tokio::{Message, Options, Socket, SocketType}; use serde_json::{json, Value}; use sha2::Sha256; use std::collections::{HashMap, VecDeque}; -use zeromq::{PubSocket, RepSocket, RouterSocket, Socket, SocketRecv, SocketSend}; +use std::time::Duration; type HmacSha256 = Hmac; /// The ggsql Jupyter kernel server pub struct KernelServer { - shell: RouterSocket, - iopub: PubSocket, - control: RouterSocket, + shell: Socket, + iopub: Socket, + control: Socket, #[allow(dead_code)] - stdin: RouterSocket, - heartbeat: RepSocket, + stdin: Socket, + heartbeat: Socket, #[allow(dead_code)] connection: ConnectionInfo, executor: QueryExecutor, @@ -78,11 +80,12 @@ impl KernelServer { tracing::info!("Initializing kernel server"); // Initialize sockets - let mut shell = RouterSocket::new(); - let mut iopub = PubSocket::new(); - let mut control = RouterSocket::new(); - let mut stdin = RouterSocket::new(); - let mut heartbeat = RepSocket::new(); + // Jupyter clients can close a channel while a reply is pending. + let shell = Socket::new(SocketType::Router, Options::default()); + let iopub = Socket::new(SocketType::Pub, Options::default()); + let control = Socket::new(SocketType::Router, Options::default()); + let stdin = Socket::new(SocketType::Router, Options::default()); + let heartbeat = Socket::new(SocketType::Rep, Options::default()); // Bind sockets to ports let shell_addr = connection.socket_addr(connection.shell_port); @@ -92,19 +95,19 @@ impl KernelServer { let hb_addr = connection.socket_addr(connection.hb_port); tracing::info!("Binding shell socket to {}", shell_addr); - shell.bind(&shell_addr).await?; + shell.bind(shell_addr.as_str()).await?; tracing::info!("Binding iopub socket to {}", iopub_addr); - iopub.bind(&iopub_addr).await?; + iopub.bind(iopub_addr.as_str()).await?; tracing::info!("Binding control socket to {}", control_addr); - control.bind(&control_addr).await?; + control.bind(control_addr.as_str()).await?; tracing::info!("Binding stdin socket to {}", stdin_addr); - stdin.bind(&stdin_addr).await?; + stdin.bind(stdin_addr.as_str()).await?; tracing::info!("Binding heartbeat socket to {}", hb_addr); - heartbeat.bind(&hb_addr).await?; + heartbeat.bind(hb_addr.as_str()).await?; // Create executor with the specified reader let executor = QueryExecutor::new_with_uri(reader_uri)?; @@ -197,6 +200,8 @@ impl KernelServer { if let Ok(msg) = msg { if self.handle_control_message(msg).await? { tracing::info!("Shutdown requested, exiting"); + // Give the queued shutdown reply time to reach the client. + self.control.clone().close_with_linger(Some(Duration::from_secs(1))).await?; break; } } @@ -223,7 +228,7 @@ impl KernelServer { } /// Handle messages on the shell channel - async fn handle_shell_message(&mut self, msg: zeromq::ZmqMessage) -> Result<()> { + async fn handle_shell_message(&mut self, msg: Message) -> Result<()> { let (identities, jupyter_msg) = self.parse_message(msg)?; let msg_type = &jupyter_msg.header.msg_type; @@ -250,7 +255,7 @@ impl KernelServer { } /// Handle messages on the control channel - async fn handle_control_message(&mut self, msg: zeromq::ZmqMessage) -> Result { + async fn handle_control_message(&mut self, msg: Message) -> Result { let (identities, jupyter_msg) = self.parse_message(msg)?; let msg_type = &jupyter_msg.header.msg_type; @@ -1437,14 +1442,7 @@ impl KernelServer { identities: &[Vec], ) -> Result<()> { let msg = self.create_message(msg_type, content, Some(parent)); - let mut zmq_msg = self.serialize_message(&msg)?; - - // For router sockets, we need to prepend the identity frames - // Prepend identities in REVERSE order (ROUTER sockets expect this) - for identity in identities.iter().rev() { - zmq_msg.push_front(bytes::Bytes::from(identity.clone())); - } - + let zmq_msg = self.serialize_message(&msg, identities.iter().cloned().map(Bytes::from))?; self.shell.send(zmq_msg).await?; Ok(()) } @@ -1458,14 +1456,7 @@ impl KernelServer { identities: &[Vec], ) -> Result<()> { let msg = self.create_message(msg_type, content, Some(parent)); - let mut zmq_msg = self.serialize_message(&msg)?; - - // For router sockets, we need to prepend the identity frames - // Prepend identities in REVERSE order (ROUTER sockets expect this) - for identity in identities.iter().rev() { - zmq_msg.push_front(bytes::Bytes::from(identity.clone())); - } - + let zmq_msg = self.serialize_message(&msg, identities.iter().cloned().map(Bytes::from))?; self.control.send(zmq_msg).await?; Ok(()) } @@ -1511,9 +1502,9 @@ impl KernelServer { /// Parse a ZeroMQ message into a Jupyter message /// Returns (identities, jupyter_message) - fn parse_message(&self, msg: zeromq::ZmqMessage) -> Result<(Vec>, JupyterMessage)> { + fn parse_message(&self, msg: Message) -> Result<(Vec>, JupyterMessage)> { // Jupyter wire protocol: [identity, ..., delimiter, hmac, header, parent, metadata, content] - let frames: Vec<_> = msg.into_vec(); + let frames: Vec<_> = msg.iter().collect(); if frames.len() < 6 { anyhow::bail!("Invalid message: too few frames (got {})", frames.len()); @@ -1524,6 +1515,9 @@ impl KernelServer { .iter() .position(|f| f.as_ref() == b"") .ok_or_else(|| anyhow::anyhow!("Delimiter not found"))?; + if frames.len() - delim_pos < 6 { + anyhow::bail!("Invalid message: too few frames after delimiter"); + } // Extract identity frames (everything before delimiter) let identities: Vec> = frames[..delim_pos].iter().map(|b| b.to_vec()).collect(); @@ -1557,7 +1551,11 @@ impl KernelServer { } /// Serialize a Jupyter message to ZeroMQ format - fn serialize_message(&self, msg: &JupyterMessage) -> Result { + fn serialize_message( + &self, + msg: &JupyterMessage, + prefix: impl IntoIterator, + ) -> Result { let header = serde_json::to_string(&msg.header)?; let parent = serde_json::to_string(&msg.parent_header)?; let metadata = serde_json::to_string(&msg.metadata)?; @@ -1566,42 +1564,20 @@ impl KernelServer { // Calculate HMAC signature let signature = self.sign_message(&header, &parent, &metadata, &content); - // Build ZeroMQ message: [delimiter, hmac, header, parent, metadata, content] - let mut zmq_msg = zeromq::ZmqMessage::from(b"".to_vec()); - zmq_msg.push_back(signature.into()); - zmq_msg.push_back(header.into()); - zmq_msg.push_back(parent.into()); - zmq_msg.push_back(metadata.into()); - zmq_msg.push_back(content.into()); - - Ok(zmq_msg) + Ok(Message::multipart(prefix.into_iter().chain([ + Bytes::from_static(b""), + Bytes::from(signature), + Bytes::from(header), + Bytes::from(parent), + Bytes::from(metadata), + Bytes::from(content), + ]))) } /// Serialize a Jupyter message to ZeroMQ format with topic (for IOPub) /// According to Jupyter protocol: "there should be just one prefix component, which is the topic" - fn serialize_message_with_topic( - &self, - msg: &JupyterMessage, - topic: &str, - ) -> Result { - let header = serde_json::to_string(&msg.header)?; - let parent = serde_json::to_string(&msg.parent_header)?; - let metadata = serde_json::to_string(&msg.metadata)?; - let content = serde_json::to_string(&msg.content)?; - - // Calculate HMAC signature - let signature = self.sign_message(&header, &parent, &metadata, &content); - - // Build ZeroMQ message with topic: [topic, delimiter, hmac, header, parent, metadata, content] - let mut zmq_msg = zeromq::ZmqMessage::from(topic.as_bytes().to_vec()); - zmq_msg.push_back(b"".to_vec().into()); - zmq_msg.push_back(signature.into()); - zmq_msg.push_back(header.into()); - zmq_msg.push_back(parent.into()); - zmq_msg.push_back(metadata.into()); - zmq_msg.push_back(content.into()); - - Ok(zmq_msg) + fn serialize_message_with_topic(&self, msg: &JupyterMessage, topic: &str) -> Result { + self.serialize_message(msg, [Bytes::copy_from_slice(topic.as_bytes())]) } /// Sign a message using HMAC-SHA256