cocool97 / adb_client

Rust ADB (Android Debug Bridge) client library
95 stars 19 forks source link

Error on windows #9

Closed wdcodecn closed 2 days ago

wdcodecn commented 1 year ago

cargo.exe build

error[E0433]: failed to resolve: could not find unix in os --> C:\Users\12289.cargo\registry\src\mirrors.ustc.edu.cn-61ef6e0cd06fb9b8\termios-0.3.3\src\lib.rs:132:14 | 132 | use std::os::unix::io::RawFd; | ^^^^ could not find unix in os

error[E0432]: unresolved import libc::pid_t --> C:\Users\12289.cargo\registry\src\mirrors.ustc.edu.cn-61ef6e0cd06fb9b8\termios-0.3.3\src\lib.rs:134:18 | 134 | use libc::{c_int,pid_t}; | ^^^^^ no pid_t in the root

error[E0432]: unresolved import os::target --> C:\Users\12289.cargo\registry\src\mirrors.ustc.edu.cn-61ef6e0cd06fb9b8\termios-0.3.3\src\lib.rs:136:15 | 136 | pub use ::os::target::{cc_t,speed_t,tcflag_t}; // types | ^^^^^^ could not find target in os

error[E0432]: unresolved import os::target --> C:\Users\12289.cargo\registry\src\mirrors.ustc.edu.cn-61ef6e0cd06fb9b8\termios-0.3.3\src\lib.rs:137:15 | 137 | pub use ::os::target::{VEOF,VEOL,VERASE,VINTR,VKILL,VMIN,VQUIT,VSTART,VSTOP,VSUSP,VTIME}; // c_cc subscripts | ^^^^^^ could not find target in os

cocool97 commented 1 year ago

This issue occurs as this crate uses termios under the hood, which is only posix-compatible. A thing could be to use something other than this crate to set terminal attributes, I'm not expert on Windows, maybe we do not need it at all for this platform...

I do not have any Windows yet to test a fix, but I'd be happy to review a PR !

kdar commented 10 months ago

Maybe the shell() function should be gated by platform (e.g. disabled on windows so the rest of the adb_client can be used).

cocool97 commented 2 days ago

Should now be fixed in main