cpjreynolds / rustty

A terminal UI library
https://docs.rs/rustty
MIT License
153 stars 14 forks source link

Could not compile `rustty` from Cargo #30

Closed bng5 closed 8 years ago

bng5 commented 8 years ago

Rustty does work correctly when I clone from Github and run the examples as follows: $ cargo run --example ui

But if I add Rustty to my project dependencies, rustc cannot compile Rustty.

pablo@boreth:~/proyectos/rust$ cargo new tui --bin
pablo@boreth:~/proyectos/rust$ cd tui
pablo@boreth:~/proyectos/rust/tui$ cat <<EOT >> Cargo.toml 
> 
> [dependencies]
> rustty = "*"
> EOT
pablo@boreth:~/proyectos/rust/tui$ cargo run --verbose
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling libc v0.1.12
     Running `rustc /home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/libc-0.1.12/rust/src/liblibc/lib.rs --crate-name libc --crate-type lib -g --cfg feature=\"cargo-build\" --cfg feature=\"default\" -C metadata=29adb837ec836726 -C extra-filename=-29adb837ec836726 --out-dir /home/pablo/proyectos/rust/tui/target/debug/deps --emit=dep-info,link -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps --cap-lints allow`
   Compiling lazy_static v0.1.15
     Running `rustc /home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/lazy_static-0.1.15/src/lib.rs --crate-name lazy_static --crate-type lib -g -C metadata=f3aa6dfcc7c157cc -C extra-filename=-f3aa6dfcc7c157cc --out-dir /home/pablo/proyectos/rust/tui/target/debug/deps --emit=dep-info,link -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps --cap-lints allow`
   Compiling winapi v0.2.5
     Running `rustc /home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/winapi-0.2.5/src/lib.rs --crate-name winapi --crate-type lib -g -C metadata=d88a8c018c340227 -C extra-filename=-d88a8c018c340227 --out-dir /home/pablo/proyectos/rust/tui/target/debug/deps --emit=dep-info,link -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps --cap-lints allow`
   Compiling winapi-build v0.1.1
     Running `rustc /home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/winapi-build-0.1.1/src/lib.rs --crate-name build --crate-type lib -g -C metadata=304afb6bdff23d72 -C extra-filename=-304afb6bdff23d72 --out-dir /home/pablo/proyectos/rust/tui/target/debug/deps --emit=dep-info,link -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps --cap-lints allow`
   Compiling bitflags v0.3.3
     Running `rustc /home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/bitflags-0.3.3/src/lib.rs --crate-name bitflags --crate-type lib -g -C metadata=eec34728826d9769 -C extra-filename=-eec34728826d9769 --out-dir /home/pablo/proyectos/rust/tui/target/debug/deps --emit=dep-info,link -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps --cap-lints allow`
   Compiling nix v0.4.2
     Running `rustc /home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/nix-0.4.2/src/lib.rs --crate-name nix --crate-type lib -g -C metadata=942045123da3a85a -C extra-filename=-942045123da3a85a --out-dir /home/pablo/proyectos/rust/tui/target/debug/deps --emit=dep-info,link -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps --extern bitflags=/home/pablo/proyectos/rust/tui/target/debug/deps/libbitflags-eec34728826d9769.rlib --extern libc=/home/pablo/proyectos/rust/tui/target/debug/deps/liblibc-29adb837ec836726.rlib --cap-lints allow`
   Compiling kernel32-sys v0.2.1
     Running `rustc /home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/kernel32-sys-0.2.1/build.rs --crate-name build_script_build --crate-type bin -g --out-dir /home/pablo/proyectos/rust/tui/target/debug/build/kernel32-sys-35c1a745c861d23a --emit=dep-info,link -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps --extern build=/home/pablo/proyectos/rust/tui/target/debug/deps/libbuild-304afb6bdff23d72.rlib --cap-lints allow`
     Running `/home/pablo/proyectos/rust/tui/target/debug/build/kernel32-sys-35c1a745c861d23a/build-script-build`
     Running `rustc /home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/kernel32-sys-0.2.1/src/lib.rs --crate-name kernel32 --crate-type lib -g -C metadata=35c1a745c861d23a -C extra-filename=-35c1a745c861d23a --out-dir /home/pablo/proyectos/rust/tui/target/debug/deps --emit=dep-info,link -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps --extern winapi=/home/pablo/proyectos/rust/tui/target/debug/deps/libwinapi-d88a8c018c340227.rlib --cap-lints allow`
   Compiling term v0.2.14
     Running `rustc /home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/term-0.2.14/src/lib.rs --crate-name term --crate-type lib -g -C metadata=f61a748b7d91421e -C extra-filename=-f61a748b7d91421e --out-dir /home/pablo/proyectos/rust/tui/target/debug/deps --emit=dep-info,link -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps --extern winapi=/home/pablo/proyectos/rust/tui/target/debug/deps/libwinapi-d88a8c018c340227.rlib --extern kernel32=/home/pablo/proyectos/rust/tui/target/debug/deps/libkernel32-35c1a745c861d23a.rlib --cap-lints allow`
   Compiling rustty v0.1.9
     Running `rustc /home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/rustty-0.1.9/src/lib.rs --crate-name rustty --crate-type lib -g -C metadata=a7394a18048c594c -C extra-filename=-a7394a18048c594c --out-dir /home/pablo/proyectos/rust/tui/target/debug/deps --emit=dep-info,link -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps --extern term=/home/pablo/proyectos/rust/tui/target/debug/deps/libterm-f61a748b7d91421e.rlib --extern libc=/home/pablo/proyectos/rust/tui/target/debug/deps/liblibc-29adb837ec836726.rlib --extern nix=/home/pablo/proyectos/rust/tui/target/debug/deps/libnix-942045123da3a85a.rlib --extern lazy_static=/home/pablo/proyectos/rust/tui/target/debug/deps/liblazy_static-f3aa6dfcc7c157cc.rlib --cap-lints allow`
/home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/rustty-0.1.9/src/core/driver.rs:198:46: 198:57 error: mismatched types:
 expected `i32`,
    found `i16`
(expected i32,
    found i16) [E0308]
/home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/rustty-0.1.9/src/core/driver.rs:198                 let params = &[Param::Number(attr as i16)];
                                                                                                                                             ^~~~~~~~~~~
/home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/rustty-0.1.9/src/core/driver.rs:198:46: 198:57 help: run `rustc --explain E0308` to see a detailed explanation
/home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/rustty-0.1.9/src/core/driver.rs:203:46: 203:54 error: mismatched types:
 expected `i32`,
    found `i16`
(expected i32,
    found i16) [E0308]
/home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/rustty-0.1.9/src/core/driver.rs:203                 let params = &[Param::Number(y as i16), Param::Number(x as i16)];
                                                                                                                                             ^~~~~~~~
/home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/rustty-0.1.9/src/core/driver.rs:203:46: 203:54 help: run `rustc --explain E0308` to see a detailed explanation
/home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/rustty-0.1.9/src/core/driver.rs:203:71: 203:79 error: mismatched types:
 expected `i32`,
    found `i16`
(expected i32,
    found i16) [E0308]
/home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/rustty-0.1.9/src/core/driver.rs:203                 let params = &[Param::Number(y as i16), Param::Number(x as i16)];
                                                                                                                                                                      ^~~~~~~~
/home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/rustty-0.1.9/src/core/driver.rs:203:71: 203:79 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to 3 previous errors
Could not compile `rustty`.

Caused by:
  Process didn't exit successfully: `rustc /home/pablo/.cargo/registry/src/github.com-0a35038f75765ae4/rustty-0.1.9/src/lib.rs --crate-name rustty --crate-type lib -g -C metadata=a7394a18048c594c -C extra-filename=-a7394a18048c594c --out-dir /home/pablo/proyectos/rust/tui/target/debug/deps --emit=dep-info,link -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps -L dependency=/home/pablo/proyectos/rust/tui/target/debug/deps --extern term=/home/pablo/proyectos/rust/tui/target/debug/deps/libterm-f61a748b7d91421e.rlib --extern libc=/home/pablo/proyectos/rust/tui/target/debug/deps/liblibc-29adb837ec836726.rlib --extern nix=/home/pablo/proyectos/rust/tui/target/debug/deps/libnix-942045123da3a85a.rlib --extern lazy_static=/home/pablo/proyectos/rust/tui/target/debug/deps/liblazy_static-f3aa6dfcc7c157cc.rlib --cap-lints allow` (exit code: 101)
Syntaf commented 8 years ago

This was fixed in https://github.com/cpjreynolds/rustty/pull/26 , however i'm not sure if the owner is active anymore. No telling if the fix will be pushed to cargo, it's best to use the git link in your cargo

bng5 commented 8 years ago

You're right. Now it compiles.

Thank you.

phifty commented 8 years ago

It would be nice to have the latest version that compiles with rust 1.6 published to crates.io. Since my project has this one as a dependency, I can't publish my crate if the Cargo.toml points directly to this repository.

dfens commented 8 years ago

+1, I still have same error with rustty 1.9, any updates on crate?

cpjreynolds commented 8 years ago

rustty is now active again and version 0.1.10 is up on cargo as of a few seconds ago. Closing now as this appears to have been resolved.