Closed conradkleinespel closed 9 years ago
How about switching to another dependency? Here's the situation so far:
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.
@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.
@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.
@bombless Ah, OK. I understand now. This is probably a good thing indeed.
At the moment,
rpassword
only builds on UNIX. We need Windows support, as seen in https://github.com/rust-lang/cargo/issues/1306.Making
termios
work on Windows seems weird to me because I think the nametermios
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?