Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Windows and cross-compile binaries #7

Open
1 of 2 tasks
yuvadm opened this issue Oct 5, 2019 · 3 comments
Open
1 of 2 tasks

Support Windows and cross-compile binaries #7

yuvadm opened this issue Oct 5, 2019 · 3 comments
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed
Milestone

Comments

@yuvadm
Copy link
Member

yuvadm commented Oct 5, 2019

Support for Windows is required for releasing a v1.0 version. There shouldn't be anything specific in the code that isn't supported on Windows.

  • Build streamlib on Windows and make sure everything works
  • Find a nice way to cross-compile macOS binaries on 64-bit Linux
@yuvadm yuvadm added enhancement New feature or request help wanted Extra attention is needed labels Oct 5, 2019
@yuvadm yuvadm added this to the v1.0 milestone Oct 5, 2019
@zohar-yzgiaev
Copy link
Contributor

zohar-yzgiaev commented Oct 6, 2019

@yuvadm I just tried to build streamlib on windows but failed because of termion, which is not supported in windows. From termion's readme:

Supports Redox, Mac OS X, BSD, and Linux (or, in general, ANSI terminals).

Output of running with backtrace:

cargo run -- groove
   Compiling termion v1.5.3
   Compiling syn v1.0.5
   Compiling clap v2.33.0
   Compiling directories v2.0.2
error[E0433]: failed to resolve: maybe a missing crate `sys`?
  --> ~\github.com-1ecc6299db9ec823\termion-1.5.3\src\lib.rs:24:9
   |
24 | pub use sys::size::terminal_size;
   |         ^^^ maybe a missing crate `sys`?
 
error[E0433]: failed to resolve: maybe a missing crate `sys`?
  --> ~\github.com-1ecc6299db9ec823\termion-1.5.3\src\lib.rs:25:9
   |
25 | pub use sys::tty::{is_tty, get_tty};
   |         ^^^ maybe a missing crate `sys`?
 
error[E0433]: failed to resolve: maybe a missing crate `sys`?
 --> ~\github.com-1ecc6299db9ec823\termion-1.5.3\src\async.rs:5:5
  |
5 | use sys::tty::get_tty;
  |     ^^^ maybe a missing crate `sys`?
 
error[E0433]: failed to resolve: maybe a missing crate `sys`?
  --> ~\github.com-1ecc6299db9ec823\termion-1.5.3\src\raw.rs:29:5
   |
29 | use sys::attr::{get_terminal_attr, raw_terminal_attr, set_terminal_attr};
   |     ^^^ maybe a missing crate `sys`?
 
error[E0432]: unresolved import `sys`
  --> ~\github.com-1ecc6299db9ec823\termion-1.5.3\src\raw.rs:28:5
   |
28 | use sys::Termios;
   |     ^^^ maybe a missing crate `sys`?
 
error[E0425]: cannot find function `get_tty` in this scope
  --> ~\github.com-1ecc6299db9ec823\termion-1.5.3\src\async.rs:14:36
   |
14 |     thread::spawn(move || for i in get_tty().unwrap().bytes() {
   |                                    ^^^^^^^ not found in this scope
 
error[E0425]: cannot find function `get_tty` in this scope
  --> ~\github.com-1ecc6299db9ec823\termion-1.5.3\src\async.rs:43:36
   |
43 |     thread::spawn(move || for i in get_tty().unwrap().bytes() {
   |                                    ^^^^^^^ not found in this scope
 
error[E0425]: cannot find function `set_terminal_attr` in this scope
  --> ~\github.com-1ecc6299db9ec823\termion-1.5.3\src\raw.rs:45:9
   |
45 |         set_terminal_attr(&self.prev_ios).unwrap();
   |         ^^^^^^^^^^^^^^^^^ not found in this scope
 
error[E0425]: cannot find function `get_terminal_attr` in this scope
  --> ~\github.com-1ecc6299db9ec823\termion-1.5.3\src\raw.rs:90:23
   |
90 |         let mut ios = get_terminal_attr()?;
   |                       ^^^^^^^^^^^^^^^^^ not found in this scope
 
error[E0425]: cannot find function `raw_terminal_attr` in this scope
  --> ~\github.com-1ecc6299db9ec823\termion-1.5.3\src\raw.rs:93:9
   |
93 |         raw_terminal_attr(&mut ios);
   |         ^^^^^^^^^^^^^^^^^ not found in this scope
 
error[E0425]: cannot find function `set_terminal_attr` in this scope
  --> ~\github.com-1ecc6299db9ec823\termion-1.5.3\src\raw.rs:95:9
   |
95 |         set_terminal_attr(&ios)?;
   |         ^^^^^^^^^^^^^^^^^ not found in this scope
 
error[E0425]: cannot find function `set_terminal_attr` in this scope
   --> ~\github.com-1ecc6299db9ec823\termion-1.5.3\src\raw.rs:106:9
    |
106 |         set_terminal_attr(&self.prev_ios)?;
    |         ^^^^^^^^^^^^^^^^^ not found in this scope
 
error[E0425]: cannot find function `get_terminal_attr` in this scope
   --> ~\github.com-1ecc6299db9ec823\termion-1.5.3\src\raw.rs:111:23
    |
111 |         let mut ios = get_terminal_attr()?;
    |                       ^^^^^^^^^^^^^^^^^ not found in this scope
 
error[E0425]: cannot find function `raw_terminal_attr` in this scope
   --> ~\github.com-1ecc6299db9ec823\termion-1.5.3\src\raw.rs:112:9
    |
112 |         raw_terminal_attr(&mut ios);
    |         ^^^^^^^^^^^^^^^^^ not found in this scope
 
error[E0425]: cannot find function `set_terminal_attr` in this scope
   --> ~\github.com-1ecc6299db9ec823\termion-1.5.3\src\raw.rs:113:9
    |
113 |         set_terminal_attr(&ios)?;
    |         ^^^^^^^^^^^^^^^^^ not found in this scope
 
error: aborting due to 15 previous errors
 
Some errors have detailed explanations: E0425, E0432, E0433.
For more information about an error, try `rustc --explain E0425`.
error: Could not compile `termion`.
warning: build failed, waiting for other jobs to finish...
error: build failed

Perhaps we should use Alacritty instead?

@yuvadm
Copy link
Member Author

yuvadm commented Oct 7, 2019

Ouch, yeah this is a good point. Alacritty is a terminal emulator, not a library, so we can't really "use" it :)

Perhaps the right way to support Windows is to have some fallback that doesn't use termion?

Currently termion isn't used at all, so if we can get streamlib to compile under Windows with the existing implementation we have, that would be a great start. Perhaps using some conditional build depending on the OS.

@zoharyzgiaev do you think that would be possible?

@yuvadm
Copy link
Member Author

yuvadm commented Oct 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants