From d3b9e174802a3b34db1a422b19ab232c2afaddf5 Mon Sep 17 00:00:00 2001 From: Jeongkyu Shin Date: Tue, 19 May 2026 01:12:43 +0900 Subject: [PATCH] fix: add missing dev-dependencies to bssh-russh fork MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fork's inline test modules (src/client/test.rs, src/keys/mod.rs, src/tests.rs) were imported from upstream russh during the initial sync (commit 508aa3f0, "Sync bssh-russh fork with upstream russh 0.60.0") but the matching [dev-dependencies] block was never copied across, so every `cargo test -p bssh-russh` since the fork's inception has failed with E0433 on `env_logger`, `tempfile`, and cascading E0282 type-inference errors where helper functions return `tempfile::TempDir`. The test target compiled exactly zero times under our manifest until now. Adds a minimal [dev-dependencies] block covering only what the imported tests actually reference: `env_logger = "0.11"` for `env_logger::try_init()` in `src/client/test.rs`, `tempfile = "3"` for `tempfile::tempdir()` / `tempfile::TempDir` in `src/keys/mod.rs` and `src/tests.rs`, and `tokio = { version = "1.52.1", features = ["process", "macros"] }` as an additive entry that merges with the main tokio dep to add the `process` feature (needed by the spawn-ssh-agent helpers that call `tokio::process::Command::new("ssh-agent").spawn()`) and the `macros` feature (needed by `#[tokio::test]`). Other tokio surfaces the tests use — `tokio::net::{TcpStream, UnixListener, UnixStream}`, `tokio::sync::oneshot`, `tokio::time::sleep` — were already covered by the main dep's `net`/`sync`/`time` features. Verification: `cargo test -p bssh-russh --lib` now runs 75 tests (0 failed, 0 ignored) covering the agent client/server roundtrip (test_agent, test_client_agent_{ed25519,rsa,openssh_rsa}, test_request_identities_full_with_keys_and_certs, test_sign_request_{,cert,cert_rsa,cert_rsa_sha512,cert_missing_key_returns_agent_failure,missing_key_returns_agent_failure}), PKCS#8 / OpenSSH key decoding (test_decode_pkcs8_p{256,384,521}_secret_key, test_decode_ed25519_{,aesctr}_secret_key, test_pkcs8_encrypted, format::test_ec_private_key), channel lifecycle (channels::test_{channel_objects,channel_streams,server_channels,channel_window_size,server_receives_close_on_client_close}), and protocol-level paths (gex::peer_request_accepts_rfc4419_minimum_when_server_can_choose_stronger_group, gex::local_client_config_still_rejects_minimum_below_2048, compress::compress_local_test, future_certificate::test_future_certificate_auth_full_flow, server_kex_junk::server_kex_junk_test). Full workspace aggregate is now 1871 passed / 0 failed / 10 ignored, up from 1796 on PR #203 because the 75 newly-runnable bssh-russh tests are now contributing. Note: `cargo clippy --workspace --tests -- -D warnings` does report ~250 warnings on the newly-reachable test code (mostly `clippy::panic` on `panic!("Unexpected message ...")` arms and similar idioms that upstream russh writes routinely in their test scaffolding). They are inherited verbatim from upstream and don't affect runtime behavior; cleaning them up is a separate follow-up so this PR can stay focused on unblocking the test target. --- Cargo.lock | 58 ++++++++++++++++++++++++++++++++++++ crates/bssh-russh/Cargo.toml | 10 +++++++ 2 files changed, 68 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 27e1d0f9..cf2882f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -494,6 +494,7 @@ dependencies = [ "ed25519-dalek", "elliptic-curve 0.14.0-rc.31", "enum_dispatch", + "env_logger", "flate2", "futures", "generic-array 1.4.1", @@ -528,6 +529,7 @@ dependencies = [ "spki 0.8.0", "ssh-encoding", "subtle", + "tempfile", "thiserror 2.0.18", "tokio", "typenum", @@ -1482,6 +1484,29 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "env_filter" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e90c2accc4b07a8456ea0debdc2e7587bdd890680d71173a15d4ae604f6eef" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0621c04f2196ac3f488dd583365b9c09be011a4ab8b9f37248ffcc8f6198b56a" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "jiff", + "log", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -2350,6 +2375,30 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +[[package]] +name = "jiff" +version = "0.2.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f00b5dbd620d61dfdcb6007c9c1f6054ebd75319f163d886a9055cec1155073d" +dependencies = [ + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", +] + +[[package]] +name = "jiff-static" +version = "0.2.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e000de030ff8022ea1da3f466fbb0f3a809f5e51ed31f6dd931c35181ad8e6d7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "jobserver" version = "0.1.34" @@ -3352,6 +3401,15 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" +[[package]] +name = "portable-atomic-util" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618" +dependencies = [ + "portable-atomic", +] + [[package]] name = "potential_utf" version = "0.1.5" diff --git a/crates/bssh-russh/Cargo.toml b/crates/bssh-russh/Cargo.toml index cf5c9bda..9e72a202 100644 --- a/crates/bssh-russh/Cargo.toml +++ b/crates/bssh-russh/Cargo.toml @@ -101,3 +101,13 @@ ssh-key = { version = "=0.6.18", features = [ "ppk", "hazmat-allow-insecure-rsa-keys", ], package = "internal-russh-forked-ssh-key" } + +[dev-dependencies] +# Dev-deps required by the inline test modules imported from upstream russh +# (src/client/test.rs, src/keys/mod.rs, src/tests.rs). Without these, the fork's +# test target never compiles. +env_logger = "0.11" +tempfile = "3" +# Additive: merges with the main tokio dep to add the `process` and `macros` +# features needed by the spawn-ssh-agent helpers and #[tokio::test]. +tokio = { version = "1.52.1", features = ["process", "macros"] }