Skip to content

Commit

Permalink
Remove 2nd Tokio Runtime in Auto Splitting Runtime (#854)
Browse files Browse the repository at this point in the history
Wasmtime's WASI implementation nowadays internally has its own Tokio
runtime. You can only ever run a single Tokio runtime on a thread at the
same time. Wasmtime provides async support, so this likely would have
also solved the issue. However, this probably would've made it harder to
use the runtime in other situations. So instead we just remove our own
runtime, which was not really necessary anyway.
  • Loading branch information
CryZe authored Nov 16, 2024
1 parent fff8df0 commit 47a2b51
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 118 deletions.
8 changes: 2 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,7 @@ splits-io-api = { version = "0.4.0", optional = true }

# Auto Splitting
livesplit-auto-splitting = { path = "crates/livesplit-auto-splitting", version = "0.1.0", optional = true }
tokio = { version = "1.24.2", default-features = false, features = [
"rt",
"sync",
"time",
], optional = true }
arc-swap = { version = "1.7.1", optional = true }
log = { version = "0.4.14", default-features = false, optional = true }

[target.'cfg(all(target_family = "wasm", target_os = "unknown"))'.dependencies]
Expand Down Expand Up @@ -191,7 +187,7 @@ wasm-web = [
"web-sys",
]
networking = ["std", "splits-io-api"]
auto-splitting = ["std", "livesplit-auto-splitting", "tokio", "log"]
auto-splitting = ["std", "livesplit-auto-splitting", "arc-swap", "log"]

[lib]
bench = false
Expand Down
6 changes: 3 additions & 3 deletions crates/livesplit-auto-splitting/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,16 @@ fn single_process() -> ProcessRefreshKind {
#[non_exhaustive]
pub struct Config {
/// This enables debug information for the WebAssembly module. This is
/// useful for debugging purposes. By default this `true` if the feature
/// useful for debugging purposes. By default this is `true` if the feature
/// `debugger-support` is enabled.
pub debug_info: bool,
/// This enables optimizations for the WebAssembly module. This is enabled
/// by default. You may want to disable this when debugging the auto
/// splitter.
pub optimize: bool,
/// This enables backtrace details for the WebAssembly module. If a trap
/// occurs more details are printed in the backtrace. By default this `true`
/// if the feature `enhanced-backtrace` is enabled.
/// occurs more details are printed in the backtrace. By default this is
/// `true` if the feature `enhanced-backtrace` is enabled.
pub backtrace_details: bool,
}

Expand Down
Loading

0 comments on commit 47a2b51

Please sign in to comment.