ColorCookie-dev / porsmo

Pomodoro cli app in rust with timer and countdown
MIT License
65 stars 10 forks source link

Missing crate `sys` error #4

Closed AadumKhor closed 1 year ago

AadumKhor commented 1 year ago

Steps taken

I have Nu shell installed on Windows 10 machine running on the Windows Terminal app. Use the following command to install cargo install porsmo

Logs after running the above command

❯ cargo install porsmo
    Updating crates.io index
  Downloaded porsmo v0.1.3
  Downloaded 1 crate (439.0 KB) in 2.27s
  Installing porsmo v0.1.3
  Downloaded parking_lot v0.9.0
  Downloaded ogg v0.8.0
  Downloaded termion v1.5.6
  Downloaded tauri-winrt-notification v0.1.0
  Downloaded semver v0.9.0
  Downloaded minimp3 v0.5.1
  Downloaded claxon v0.4.3
  Downloaded smallvec v0.6.14
  Downloaded minimp3-sys v0.3.2
  Downloaded numtoa v0.1.0
  Downloaded lewton v0.10.2
  Downloaded windows_x86_64_msvc v0.39.0
  Downloaded strum v0.22.0
  Downloaded rustc_version v0.2.3
  Downloaded notify-rust v4.8.0
  Downloaded maybe-uninit v2.0.0
  Downloaded hound v3.5.0
  Downloaded slice-deque v0.3.0
  Downloaded lock_api v0.3.4
  Downloaded strum_macros v0.22.0
  Downloaded quick-xml v0.23.1
  Downloaded parking_lot_core v0.6.3
  Downloaded semver-parser v0.7.0
  Downloaded windows v0.39.0
  Downloaded cpal v0.12.1
  Downloaded rodio v0.12.0
  Downloaded 26 crates (21.5 MB) in 20.01s (largest was `windows` at 12.8 MB)
   Compiling proc-macro2 v1.0.53
   Compiling unicode-ident v1.0.8
   Compiling quote v1.0.26
   Compiling winapi v0.3.9
   Compiling semver-parser v0.7.0
   Compiling syn v1.0.109
   Compiling version_check v0.9.4
   Compiling maybe-uninit v2.0.0
   Compiling memchr v2.5.0
   Compiling unicode-segmentation v1.10.1
   Compiling thiserror v1.0.40
   Compiling cc v1.0.79
   Compiling windows_x86_64_msvc v0.39.0
   Compiling semver v0.9.0
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling minimp3-sys v0.3.2
   Compiling heck v0.3.3
   Compiling rustc_version v0.2.3
   Compiling autocfg v1.1.0
   Compiling scopeguard v1.1.0
   Compiling cfg-if v0.1.10
   Compiling smallvec v0.6.14
   Compiling lock_api v0.3.4
   Compiling parking_lot_core v0.6.3
   Compiling parking_lot v0.9.0
   Compiling indexmap v1.9.2
   Compiling byteorder v1.4.3
   Compiling cpal v0.12.1
   Compiling tinyvec_macros v0.1.1
   Compiling libc v0.2.140
   Compiling windows v0.39.0
   Compiling quick-xml v0.23.1
   Compiling tinyvec v1.6.0
   Compiling syn v2.0.9
   Compiling ogg v0.8.0
   Compiling slice-deque v0.3.0
   Compiling winapi-util v0.1.5
   Compiling heck v0.4.1
   Compiling os_str_bytes v6.5.0
   Compiling anyhow v1.0.70
   Compiling thiserror-impl v1.0.40
   Compiling strum_macros v0.22.0
   Compiling lazy_static v1.4.0
   Compiling hashbrown v0.12.3
   Compiling clap_lex v0.2.4
   Compiling termcolor v1.2.0
   Compiling lewton v0.10.2
   Compiling atty v0.2.14
   Compiling claxon v0.4.3
   Compiling numtoa v0.1.0
   Compiling strsim v0.10.0
   Compiling bitflags v1.3.2
   Compiling textwrap v0.16.0
   Compiling minimp3 v0.5.1
   Compiling hound v3.5.0
   Compiling once_cell v1.17.1
   Compiling termion v1.5.6
error[E0433]: failed to resolve: maybe a missing crate `sys`?
  --> C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\termion-1.5.6\src\lib.rs:24:9
   |
24 | pub use sys::size::terminal_size;
   |         ^^^ maybe a missing crate `sys`?
   |
   = help: consider adding `extern crate sys` to use the `sys` crate

   |
27 | pub use sys::tty::{is_tty, get_tty};
   |         ^^^ maybe a missing crate `sys`?
   |
   = help: consider adding `extern crate sys` to use the `sys` crate

error[E0433]: failed to resolve: maybe a missing crate `sys`?
 --> C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\termion-1.5.6\src\async.rs:5:5
  |
5 | use sys::tty::get_tty;
  |     ^^^ maybe a missing crate `sys`?
  |
  = help: consider adding `extern crate sys` to use the `sys` crate

error[E0433]: failed to resolve: maybe a missing crate `sys`?
  --> C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\termion-1.5.6\src\raw.rs:28:5
   |
28 | use sys::attr::{get_terminal_attr, raw_terminal_attr, set_terminal_attr};
   |     ^^^ maybe a missing crate `sys`?
   |
   = help: consider adding `extern crate sys` to use the `sys` crate

error[E0432]: unresolved import `sys`
  --> C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\termion-1.5.6\src\raw.rs:29:5
   |
29 | use sys::Termios;
   |     ^^^ maybe a missing crate `sys`?
   |
   = help: consider adding `extern crate sys` to use the `sys` crate

   Compiling clap_derive v3.2.18
   Compiling rodio v0.12.0
   Compiling strum v0.22.0
Some errors have detailed explanations: E0432, E0433.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `termion` due to 5 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `porsmo v0.1.3`, intermediate artifacts can be found at `C:\Users\user\AppData\Local\Temp\cargo-install0dfZd5`

Question

  1. Is this crate supposed to work only on Unix based systems?
  2. If not, how do I resolve this? Would love to use this on my Windows machine
linkion commented 1 year ago

I'm also having this issue on Windows 11

linkion commented 1 year ago

looks like termion just doesn't have windows support https://gitlab.redox-os.org/redox-os/termion/-/issues/167

Here's a MR for it, but looks like Termion won't be developing it any time soon as it's deemed "stable" https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/151

linkion commented 1 year ago

Looks like crossterm may be a better terminal backend than Termion since:

ColorCookie-dev commented 1 year ago

I agree, crossterm maybe better. I will be switching to that, as I have gotten to learn it in my other projects.

ColorCookie-dev commented 1 year ago

This project has been migrated to Crossterm. So, I'm closing this issue because of 7bd7b69bee15784eeee8da3fe384a583cd3ca68f