softprops / atty

are you or are you not a tty?
MIT License
274 stars 51 forks source link

Fails to build for Mac OS #26

Closed slimsag closed 6 years ago

slimsag commented 6 years ago

On Mac OS, using the latest Rust nightly version, cloning and building this crate fails:

$ cargo run --example atty
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling libc v0.2.40                                                       
   Compiling atty v0.2.9 (file:///Users/stephen/drive/hexops/hexi/display/tmp/atty)
error[E0428]: the name `is` is defined multiple times
   --> src/lib.rs:164:1
    |
40  | pub fn is(stream: Stream) -> bool {
    | --------------------------------- previous definition of the value `is` here
...
164 | pub fn is(_stream: Stream) -> bool {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `is` redefined here
    |
    = note: `is` must be defined only once in the value namespace of this module

error: aborting due to previous error

For more information about this error, try `rustc --explain E0428`.
error: Could not compile `atty`.

To learn more, run the command again with --verbose.

This may be the same regression as https://github.com/softprops/atty/issues/21

BurntSushi commented 6 years ago

Are you trying to do a wasm build? Like 164 is #[cfg(target_arch = "wasm32")], so I'm not sure how that's possible in a normal darwin build.

slimsag commented 6 years ago

@BurntSushi No, I am trying to build for x86_64-apple-darwin.

I see now (right before you posted your message) that something is actually wrong with my Rust installation somehow because cargo run --example atty is trying to do a wasm build by default and cargo run --target=x86_64-apple-darwin --example atty works fine.

Apologies for the false issue :/ I'll try to figure out why my Rust installation is like this.