From e185b8ca52e83ca04efe790393afebce49771571 Mon Sep 17 00:00:00 2001 From: Miyoshi-Ryota Date: Sat, 17 Aug 2024 21:57:36 +0900 Subject: [PATCH 1/2] chore: replace docker-compose to docker compose On the CI image, ubuntu-latest uses the latest version of Docker, which no longer supports the old-style docker-compose command. --- README.md | 2 +- tests/run_unit_tests.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 56ed356..13cc169 100644 --- a/README.md +++ b/README.md @@ -54,5 +54,5 @@ async fn main() -> Result<(), async_ssh2_tokio::Error> { ``` ## Running Tests -1. install docker and docker-compose +1. install docker and docker compose 2. run shell script `./tests/run_unit_tests.sh` diff --git a/tests/run_unit_tests.sh b/tests/run_unit_tests.sh index 8262e2a..f8370fc 100755 --- a/tests/run_unit_tests.sh +++ b/tests/run_unit_tests.sh @@ -7,13 +7,13 @@ cd "${0%/*}" || exit 1 cd .. -docker-compose -f ./tests/docker-compose.yml build --no-cache || exit 1 +docker compose -f ./tests/docker-compose.yml build --no-cache || exit 1 -docker-compose -f ./tests/docker-compose.yml up -d || exit 1 +docker compose -f ./tests/docker-compose.yml up -d || exit 1 -docker-compose -f ./tests/docker-compose.yml exec -T async-ssh2-tokio cargo test -- --test-threads=2 +docker compose -f ./tests/docker-compose.yml exec -T async-ssh2-tokio cargo test -- --test-threads=2 RET=$? -docker-compose -f ./tests/docker-compose.yml down +docker compose -f ./tests/docker-compose.yml down exit $RET From 97044dc90b3386ee2328a2aef91d7bd3a5b8fa36 Mon Sep 17 00:00:00 2001 From: Miyoshi-Ryota Date: Sat, 17 Aug 2024 22:08:39 +0900 Subject: [PATCH 2/2] chore: Update rust version to fix complie error a following error happens if we use v1.71.0 to compile: error[E0659]: `cbc` is ambiguous --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/russh-0.45.0/src/cipher/mod.rs:26:5 | 26 | use cbc::CbcWrapper; | ^^^ ambiguous name | = note: ambiguous because of multiple potential import sources = note: `cbc` could refer to a crate passed with `--extern` = help: use `::cbc` to refer to this crate unambiguously note: `cbc` could also refer to the module defined here --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/russh-0.45.0/src/cipher/mod.rs:38:1 | 38 | pub(crate) mod cbc; | ^^^^^^^^^^^^^^^^^^^ = help: use `self::cbc` to refer to this module unambiguously error: future cannot be sent between threads safely --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/russh-0.45.0/src/server/mod.rs:683:29 | 683 | let join = tokio::spawn(session.run(stream, handler)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `run` is not `Send` | = help: the trait `for<'a> std::marker::Sync` is not implemented for `(dyn cipher::OpeningKey + std::marker::Send + 'a)` note: future is not `Send` as this value is used across an await --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/russh-0.45.0/src/cipher/mod.rs:265:10 | 264 | .read_exact(&mut buffer.buffer[cipher.packet_length_to_read_for_block_length()..]) | ------ has type `&(dyn cipher::OpeningKey + std::marker::Send + 'a)` which is not `Send` 265 | .await?; | ^^^^^ - `cipher` is later dropped here | | | await occurs here, with `cipher` maybe used later help: consider moving this into a `let` binding to create a shorter lived borrow --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/russh-0.45.0/src/cipher/mod.rs:264:40 | 264 | .read_exact(&mut buffer.buffer[cipher.packet_length_to_read_for_block_length()..]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: required by a bound in `tokio::spawn` --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.39.2/src/task/spawn.rs:167:21 | 165 | pub fn spawn(future: F) -> JoinHandle | ----- required by a bound in this function 166 | where 167 | F: Future + Send + 'static, | ^^^^ required by this bound in `spawn` error: future cannot be sent between threads safely --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/russh-0.45.0/src/client/mod.rs:723:29 | 723 | let join = tokio::spawn(session.run(stream, handler, Some(encrypted_signal))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `run` is not `Send` | = help: the trait `for<'a> std::marker::Sync` is not implemented for `(dyn cipher::OpeningKey + std::marker::Send + 'a)` note: future is not `Send` as this value is used across an await --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/russh-0.45.0/src/cipher/mod.rs:265:10 | 264 | .read_exact(&mut buffer.buffer[cipher.packet_length_to_read_for_block_length()..]) | ------ has type `&(dyn cipher::OpeningKey + std::marker::Send + 'a)` which is not `Send` 265 | .await?; | ^^^^^ - `cipher` is later dropped here | | | await occurs here, with `cipher` maybe used later help: consider moving this into a `let` binding to create a shorter lived borrow --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/russh-0.45.0/src/cipher/mod.rs:264:40 | 264 | .read_exact(&mut buffer.buffer[cipher.packet_length_to_read_for_block_length()..]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: required by a bound in `tokio::spawn` --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.39.2/src/task/spawn.rs:167:21 | 165 | pub fn spawn(future: F) -> JoinHandle | ----- required by a bound in this function 166 | where 167 | F: Future + Send + 'static, | ^^^^ required by this bound in `spawn` For more information about this error, try `rustc --explain E0659`. error: could not compile `russh` (lib) due to 3 previous errors warning: build failed, waiting for other jobs to finish... --- tests/async-ssh2-tokio/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/async-ssh2-tokio/Dockerfile b/tests/async-ssh2-tokio/Dockerfile index e43b9c9..6c40e02 100644 --- a/tests/async-ssh2-tokio/Dockerfile +++ b/tests/async-ssh2-tokio/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.71.0 +FROM rust:1.80.0 ENV ASYNC_SSH2_TEST_HOST_IP=10.10.10.2 ENV ASYNC_SSH2_TEST_HOST_USER=root