lotabout / tuikit

Tool kit for writing TUI applications in Rust.
MIT License
104 stars 28 forks source link

doesn't compile on windows? #27

Closed ghost closed 4 years ago

ghost commented 4 years ago

lots of errors, don't know what's up. looks like it needs a unix-like environment. here's the full error:


error[E0433]: failed to resolve: could not find `unix` in `os`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\input.rs:14:14
   |
14 | use std::os::unix::io::AsRawFd;
   |              ^^^^ could not find `unix` in `os`

error[E0433]: failed to resolve: could not find `unix` in `os`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\input.rs:15:14
   |
15 | use std::os::unix::io::FromRawFd;
   |              ^^^^ could not find `unix` in `os`

error[E0433]: failed to resolve: could not find `unix` in `os`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\output.rs:18:14
   |
18 | use std::os::unix::io::AsRawFd;
   |              ^^^^ could not find `unix` in `os`

error[E0433]: failed to resolve: could not find `sys` in `nix`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:26:10
   |
26 | use nix::sys::termios::{cfmakeraw, tcgetattr, tcsetattr, SetArg, Termios};
   |          ^^^ could not find `sys` in `nix`

error[E0432]: unresolved import `nix::fcntl`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\input.rs:19:10
   |
19 | use nix::fcntl::{fcntl, FcntlArg, OFlag};
   |          ^^^^^ could not find `fcntl` in `nix`

error[E0432]: unresolved import `nix::unistd`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:27:10
   |
27 | use nix::unistd::isatty;
   |          ^^^^^^ could not find `unistd` in `nix`

error[E0433]: failed to resolve: could not find `unix` in `os`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:31:14
   |
31 | use std::os::unix::io::{AsRawFd, RawFd};
   |              ^^^^ could not find `unix` in `os`

error[E0433]: failed to resolve: could not find `errno` in `nix`
   --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:108:18
    |
108 |         use nix::errno::Errno::ENOTTY;
    |                  ^^^^^ could not find `errno` in `nix`

error[E0433]: failed to resolve: could not find `sys` in `nix`
   --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:109:18
    |
109 |         use nix::sys::termios::OutputFlags;
    |                  ^^^ could not find `sys` in `nix`

error[E0433]: failed to resolve: could not find `unix` in `os`
 --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\file.rs:2:14
  |
2 | use std::os::unix::io::RawFd;
  |              ^^^^ could not find `unix` in `os`

error[E0432]: unresolved import `nix::Error`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:28:10
   |
28 | use nix::Error::Sys;
   |          ^^^^^ could not find `Error` in `nix`

error[E0433]: failed to resolve: could not find `sys` in `nix`
 --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\file.rs:6:10
  |
6 | use nix::sys::time::{TimeVal, TimeValLike};
  |          ^^^ could not find `sys` in `nix`

error[E0433]: failed to resolve: could not find `sys` in `nix`
 --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\signal.rs:2:10
  |
2 | use nix::sys::signal::{pthread_sigmask, sigaction};
  |          ^^^ could not find `sys` in `nix`

error[E0433]: failed to resolve: could not find `sys` in `nix`
 --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\signal.rs:3:10
  |
3 | use nix::sys::signal::{SaFlags, SigAction, SigHandler, SigSet, SigmaskHow, Signal};
  |          ^^^ could not find `sys` in `nix`

error[E0432]: unresolved import `nix::sys`
 --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\file.rs:5:10
  |
5 | use nix::sys::select;
  |          ^^^ could not find `sys` in `nix`

error[E0432]: unresolved import `nix::libc`
 --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\size.rs:4:10
  |
4 | use nix::libc::{c_int, c_ushort, ioctl, TIOCGWINSZ};
  |          ^^^^ could not find `libc` in `nix`

error[E0433]: failed to resolve: could not find `unistd` in `nix`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\input.rs:48:29
   |
48 |         let (rx, tx) = nix::unistd::pipe().expect("failed to set pipe");
   |                             ^^^^^^ could not find `unistd` in `nix`

error[E0433]: failed to resolve: use of undeclared type or module `SetArg`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:55:52
   |
55 |         let _ = tcsetattr(self.output.as_raw_fd(), SetArg::TCSANOW, &self.prev_ios);
   |                                                    ^^^^^^ use of undeclared type or module `SetArg`

error[E0433]: failed to resolve: could not find `Error` in `nix`
   --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:113:40
    |
113 |             Err(nix_err_to_io_err(nix::Error::from_errno(ENOTTY)))?
    |                                        ^^^^^ could not find `Error` in `nix`

error[E0433]: failed to resolve: use of undeclared type or module `OutputFlags`
   --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:121:29
    |
121 |         ios.output_flags |= OutputFlags::OPOST;
    |                             ^^^^^^^^^^^ use of undeclared type or module `OutputFlags`

error[E0433]: failed to resolve: use of undeclared type or module `SetArg`
   --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:123:37
    |
123 |         tcsetattr(self.as_raw_fd(), SetArg::TCSANOW, &ios).map_err(nix_err_to_io_err)?;
    |                                     ^^^^^^ use of undeclared type or module `SetArg`

error[E0433]: failed to resolve: use of undeclared type or module `TimeVal`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\file.rs:12:5
   |
12 |     TimeVal::milliseconds(sec as i64)
   |     ^^^^^^^ use of undeclared type or module `TimeVal`

error[E0433]: failed to resolve: use of undeclared type or module `SigSet`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\signal.rs:41:22
   |
41 |     let mut sigset = SigSet::empty();
   |                      ^^^^^^ use of undeclared type or module `SigSet`

error[E0433]: failed to resolve: use of undeclared type or module `Signal`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\signal.rs:42:16
   |
42 |     sigset.add(Signal::SIGWINCH);
   |                ^^^^^^ use of undeclared type or module `Signal`

error[E0433]: failed to resolve: use of undeclared type or module `SigmaskHow`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\signal.rs:43:29
   |
43 |     let _ = pthread_sigmask(SigmaskHow::SIG_BLOCK, Some(&sigset), None);
   |                             ^^^^^^^^^^ use of undeclared type or module `SigmaskHow`

error[E0433]: failed to resolve: use of undeclared type or module `SigAction`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\signal.rs:46:18
   |
46 |     let action = SigAction::new(
   |                  ^^^^^^^^^ use of undeclared type or module `SigAction`

error[E0433]: failed to resolve: use of undeclared type or module `SigHandler`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\signal.rs:47:9
   |
47 |         SigHandler::Handler(handle_sigwiwnch),
   |         ^^^^^^^^^^ use of undeclared type or module `SigHandler`

error[E0433]: failed to resolve: use of undeclared type or module `SaFlags`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\signal.rs:48:9
   |
48 |         SaFlags::empty(),
   |         ^^^^^^^ use of undeclared type or module `SaFlags`

error[E0433]: failed to resolve: use of undeclared type or module `SigSet`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\signal.rs:49:9
   |
49 |         SigSet::empty(),
   |         ^^^^^^ use of undeclared type or module `SigSet`

error[E0433]: failed to resolve: use of undeclared type or module `Signal`
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\signal.rs:53:27
   |
53 |         let _ = sigaction(Signal::SIGWINCH, &action);
   |                           ^^^^^^ use of undeclared type or module `Signal`

error[E0405]: cannot find trait `AsRawFd` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\input.rs:27:34
   |
27 | pub trait ReadAndAsRawFd: Read + AsRawFd + Send {}
   |                                  ^^^^^^^ not found in this scope

error[E0405]: cannot find trait `AsRawFd` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\input.rs:31:46
   |
31 | impl<T> ReadAndAsRawFd for T where T: Read + AsRawFd + Send {}
   |                                              ^^^^^^^ not found in this scope

error[E0405]: cannot find trait `AsRawFd` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\output.rs:40:43
   |
40 | pub trait WriteAndAsRawFdAndSend: Write + AsRawFd + Send {}
   |                                           ^^^^^^^ not found in this scope

error[E0405]: cannot find trait `AsRawFd` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\output.rs:42:55
   |
42 | impl<T> WriteAndAsRawFdAndSend for T where T: Write + AsRawFd + Send {}
   |                                                       ^^^^^^^ not found in this scope

error[E0405]: cannot find trait `AsRawFd` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:48:35
   |
48 | pub struct RawTerminal<W: Write + AsRawFd> {
   |                                   ^^^^^^^ not found in this scope

error[E0412]: cannot find type `Termios` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:49:15
   |
49 |     prev_ios: Termios,
   |               ^^^^^^^ not found in this scope

error[E0405]: cannot find trait `AsRawFd` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:53:17
   |
53 | impl<W: Write + AsRawFd> Drop for RawTerminal<W> {
   |                 ^^^^^^^ not found in this scope

error[E0425]: cannot find function `tcsetattr` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:55:17
   |
55 |         let _ = tcsetattr(self.output.as_raw_fd(), SetArg::TCSANOW, &self.prev_ios);
   |                 ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `AsRawFd` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:59:17
   |
59 | impl<W: Write + AsRawFd> ops::Deref for RawTerminal<W> {
   |                 ^^^^^^^ not found in this scope

error[E0405]: cannot find trait `AsRawFd` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:67:17
   |
67 | impl<W: Write + AsRawFd> ops::DerefMut for RawTerminal<W> {
   |                 ^^^^^^^ not found in this scope

error[E0405]: cannot find trait `AsRawFd` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:73:17
   |
73 | impl<W: Write + AsRawFd> Write for RawTerminal<W> {
   |                 ^^^^^^^ not found in this scope

error[E0405]: cannot find trait `AsRawFd` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:83:26
   |
83 | impl<W: Write + AsRawFd> AsRawFd for RawTerminal<W> {
   |                          ^^^^^^^ not found in this scope

error[E0405]: cannot find trait `AsRawFd` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:83:17
   |
83 | impl<W: Write + AsRawFd> AsRawFd for RawTerminal<W> {
   |                 ^^^^^^^ not found in this scope

error[E0412]: cannot find type `RawFd` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:84:28
   |
84 |     fn as_raw_fd(&self) -> RawFd {
   |                            ^^^^^ not found in this scope

error[E0405]: cannot find trait `AsRawFd` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:95:32
   |
95 | pub trait IntoRawMode: Write + AsRawFd + Sized {
   |                                ^^^^^^^ not found in this scope

error[E0405]: cannot find trait `AsRawFd` in this scope
   --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:104:17
    |
104 | impl<W: Write + AsRawFd> IntoRawMode for W {
    |                 ^^^^^^^ not found in this scope

error[E0425]: cannot find value `ENOTTY` in this scope
   --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:113:58
    |
113 |             Err(nix_err_to_io_err(nix::Error::from_errno(ENOTTY)))?
    |                                                          ^^^^^^ not found in this scope

error[E0425]: cannot find function `tcgetattr` in this scope
   --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:116:24
    |
116 |         let prev_ios = tcgetattr(self.as_raw_fd()).map_err(nix_err_to_io_err)?;
    |                        ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `cfmakeraw` in this scope
   --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:119:9
    |
119 |         cfmakeraw(&mut ios);
    |         ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `tcsetattr` in this scope
   --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:123:9
    |
123 |         tcsetattr(self.as_raw_fd(), SetArg::TCSANOW, &ios).map_err(nix_err_to_io_err)?;
    |         ^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `Error` in crate `nix`
   --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\raw.rs:132:32
    |
132 | fn nix_err_to_io_err(err: nix::Error) -> io::Error {
    |                                ^^^^^ not found in `nix`
    |
help: consider importing one of these items
    |
23  | use core::fmt::Error;
    |
23  | use std::error::Error;
    |
23  | use std::fmt::Error;
    |
23  | use std::io::Error;
    |
      and 3 other candidates

error[E0412]: cannot find type `TimeVal` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\file.rs:10:47
   |
10 | fn duration_to_timeval(duration: Duration) -> TimeVal {
   |                                               ^^^^^^^ not found in this scope

error[E0412]: cannot find type `RawFd` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\file.rs:15:29
   |
15 | pub fn wait_until_ready(fd: RawFd, signal_fd: Option<RawFd>, timeout: Duration) -> Result<()> {
   |                             ^^^^^ not found in this scope

error[E0412]: cannot find type `RawFd` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\file.rs:15:54
   |
15 | pub fn wait_until_ready(fd: RawFd, signal_fd: Option<RawFd>, timeout: Duration) -> Result<()> {
   |                        -                             ^^^^^ not found in this scope
   |                        |
   |                        help: you might be missing a type parameter: `<RawFd>`

error[E0425]: cannot find function `pthread_sigmask` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\signal.rs:43:13
   |
43 |     let _ = pthread_sigmask(SigmaskHow::SIG_BLOCK, Some(&sigset), None);
   |             ^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `sigaction` in this scope
  --> C:\Users\yesclip\.cargo\registry\src\github.com-1ecc6299db9ec823\tuikit-0.3.3\src\sys\signal.rs:53:17
   |
53 |         let _ = sigaction(Signal::SIGWINCH, &action);
   |                 ^^^^^^^^^ help: a local variable with a similar name exists: `action`

error: aborting due to 56 previous errors```
lotabout commented 4 years ago

@wozniak No it won't.

Jedzia commented 9 months ago

Nope, this does not work under Windoze! (Which I assume is what you wanted to say???)

   Compiling tuikit v0.5.0 (E:\Projects\Rust\Console\tuikit)
error[E0433]: failed to resolve: could not find `unix` in `os`

In https://github.com/lotabout/tuikit/issues/13#issuecomment-578475441 you state that this library is not designed, tested or targeted ("Unfortunately I'm not familiar with Windows's API. Sorry that I'll not add the support myself. PRs are welcome though.") for Windows.

@wozniak No it won't.

(In response to the issue author asking: "looks like it needs a unix-like environment." ... which in fact means you said that it DOES NOT need an unix-like environment = double negation, which is WRONG!)

So ..."it" ... WHAT??? Hehehe. This is not even a full sentence. It can mean anything. Can you please clarify ... because if someone sees this ... he or she is even more irritated, because the project description or the Readme gives no hint that this is platform dependent.

Oh and thank you for your great work on the project. This is just a side-note about my confusion. Such minimalist statements from above always lead to maximum confusion. And I love it, because I had a good laugh about it. Thank you!:)

Kreijstal commented 3 weeks ago

Nope, this does not work under Windoze! (Which I assume is what you wanted to say???)

   Compiling tuikit v0.5.0 (E:\Projects\Rust\Console\tuikit)
error[E0433]: failed to resolve: could not find `unix` in `os`

In #13 (comment) you state that this library is not designed, tested or targeted ("Unfortunately I'm not familiar with Windows's API. Sorry that I'll not add the support myself. PRs are welcome though.") for Windows.

@wozniak No it won't.

(In response to the issue author asking: "looks like it needs a unix-like environment." ... which in fact means you said that it DOES NOT need an unix-like environment = double negation, which is WRONG!)

So ..."it" ... WHAT??? Hehehe. This is not even a full sentence. It can mean anything. Can you please clarify ... because if someone sees this ... he or she is even more irritated, because the project description or the Readme gives no hint that this is platform dependent.

Oh and thank you for your great work on the project. This is just a side-note about my confusion. Such minimalist statements from above always lead to maximum confusion. And I love it, because I had a good laugh about it. Thank you!:)

tuikit wont compile on windows, unless someone ports the unix stuff so it uses other rust libraries, claude3.5 is not smart enough to do it yet, readme.md could be clearer about it, maybe do a pr on readme.md lol