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

Windows support #1

Closed
conradkleinespel opened this issue Feb 16, 2015 · 4 comments · Fixed by #2
Closed

Windows support #1

conradkleinespel opened this issue Feb 16, 2015 · 4 comments · Fixed by #2

Comments

@conradkleinespel
Copy link
Owner

At the moment, rpassword only builds on UNIX. We need Windows support, as seen in rust-lang/cargo#1306.

Making termios work on Windows seems weird to me because I think the name termios refers to a POSIX API. Or maybe that would require a name change, to adhere to the "Rust-way" of not giving cross-platform libraries platform-specific names.

If there's a simple way to add Windows support to rpassword, we could also using #[cfg(...)]. What do you think?

@bombless
Copy link

How about switching to another dependency?
Here's the situation so far:

  • ncurses libraries don't support Windows. (And it sounds like it shouldn't for its name, but ncurses-rs actually seems close to work on Windows.)
  • The owner of rustbox is willing to add Windows support for termbox, but we need to wait for that, and I'll try it at the same time. Since termbox support Windows through CYGWIN, and termbox-go actually support Windows, I think this approach may work in a reasonable way.

I personally think it may be good idea for termios to build for unsupported platforms and leave empty library there for these platforms, as rust-cocoa do similar thing.

@conradkleinespel
Copy link
Owner Author

@bombless I don't mind switching to another dependency. If Rustbox supports Windows and we can read passwords without showing them to the screen, that'd be fine by me.

I don't understand what you mean about "termios to build for unsupported platforms". How would that fix the problem ? I'm genuinely curious.

@bombless
Copy link

@conradkleinespel If the project contain dependency that fails to build, then cargo build will always fail, so we should opt-out termios for Windows. Cargo.toml only allow opt-in dependencies, so we cannot do that. If dependencies build without problem (and crate termios will export nothing on Windows), we can handle everything at source code level.

I'd admit that there's another solution that we add different dependencies for each platform on Cargo.toml, but it may cause problem, e.g. we may support FreeBSD soon, then you need to edit Cargo.toml to build on it. If we just handle platform-specific thing on source level, it won't have such problem, since we just take Windows as special case, it will automatically build on every UNIX-like system.

@conradkleinespel
Copy link
Owner Author

@bombless Ah, OK. I understand now. This is probably a good thing indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants