tauri-apps / tauri-apps/plugins-workspace
[log] process hang and never open the window if add dep `tokio` with `signal` feature
- Dominant language
- Rust
- Stars
- 1.8k
- Forks
- 602
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 9
Description
### platform
Linux / macOS, but not Windows
### reproduction
https://github.com/meowtec/bug-reproductions/tree/tauri-log the branch is `tauri-log`
1. use`tauri-plugin-log`
2. add dependence `tokio` with the `signal` feature
3. add some `log` in `setup()` hook
4. npm run tauri dev
main.rs
```rs
fn main() {
tauri::Builder::default()
.plugin(
tauri_plugin_log::Builder::default()
.targets([LogTarget::LogDir, LogTarget::Stdout, LogTarget::Webview])
.build(),
)
.setup(move |_app| {
// NOTICE: use log here!!!
log::info!("setup app");
Ok(())
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
```
Cargo.toml
```toml
[dependencies]
tauri = { version = "1.2", features = ["shell-open"] }
log = "0.4"
tauri-plugin-log = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" }
# NOTICE: add tokio!!!!
tokio = { version = "1", features = ["signal"] }
```
**The window will never show.**
The output:
```
> tauri-app-demo@0.0.0 tauri
> tauri dev
Info Watching /bugs-report/src-tauri for changes...
Finished dev [unoptimized + debuginfo] target(s) in 0.13s
Could not determine the accessibility bus address
[2023-04-15][14:21:50][tauri_app][INFO] setup app
[2023-04-15][14:21:50][mio::poll][TRACE] registering event source with poller: token=Token(2147483649), interests=READABLE
```
Contributor guide
Assessment
This issue has not been assessed yet.