From 7c8a7344eac59adb8e90615f0f66eac0b80b4d2a Mon Sep 17 00:00:00 2001 From: Alexander Koz Date: Thu, 18 Apr 2024 13:13:53 +0400 Subject: [PATCH 1/2] Fix use async `tokio-serial` in incorrect context (#314) --- Cargo.lock | 3 ++- cargo/Cargo.toml | 3 ++- cargo/src/main.rs | 7 +++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a3ed1c93..a0e2a111 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -709,10 +709,11 @@ dependencies = [ [[package]] name = "cargo-playdate" -version = "0.4.3" +version = "0.4.4" dependencies = [ "anstyle", "anyhow", + "async-std", "byteorder", "cargo", "cargo-platform", diff --git a/cargo/Cargo.toml b/cargo/Cargo.toml index f3ea1bf7..725567cf 100644 --- a/cargo/Cargo.toml +++ b/cargo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-playdate" -version = "0.4.3" +version = "0.4.4" readme = "README.md" description = "Build tool for neat yellow console." keywords = ["playdate", "build", "cargo", "plugin", "cargo-subcommand"] @@ -53,6 +53,7 @@ env_logger.workspace = true log.workspace = true futures-lite.workspace = true +async-std = "1.12" [dependencies.build] diff --git a/cargo/src/main.rs b/cargo/src/main.rs index cbd6222c..3a553b41 100644 --- a/cargo/src/main.rs +++ b/cargo/src/main.rs @@ -203,7 +203,6 @@ fn execute(config: &Config) -> CargoResult<()> { // run: { - use futures_lite::future::block_on; use device::run::run as run_dev; use simulator::run::run as run_sim; @@ -212,12 +211,12 @@ fn execute(config: &Config) -> CargoResult<()> { let pdx = package.path.to_owned(); let no_install = false; let no_read = config.no_read; - let force = false; + let force = true; let fut = run_dev(query, pdx, no_install, no_read, force); - block_on(fut)?; + async_std::task::block_on(fut)?; } else { let fut = run_sim(&package.path, config.sdk_path.as_deref()); - block_on(fut)?; + futures_lite::future::block_on(fut)?; }; } From a3159951a7549c71ff75b9059ca5932573eda8db Mon Sep 17 00:00:00 2001 From: Alexander Koz Date: Thu, 18 Apr 2024 13:23:09 +0400 Subject: [PATCH 2/2] Ensure that `async-std` tokio-compat feature is enabled. --- cargo/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cargo/Cargo.toml b/cargo/Cargo.toml index 725567cf..a535e39b 100644 --- a/cargo/Cargo.toml +++ b/cargo/Cargo.toml @@ -53,7 +53,7 @@ env_logger.workspace = true log.workspace = true futures-lite.workspace = true -async-std = "1.12" +async-std = { version = "1.12", features = ["tokio1"] } [dependencies.build]