cjbassi/ytop

Build fails on FreeBSD 12: error[E0308]: mismatched types TIOCGWINSZ expected `u64`, found `u32`

Opened this issue · 3 comments

     Running `/usr/local/bin/rustc --edition=2018 --crate-name fern /usr/ports/sysutils/gotop/work/ytop-0.5.1-5-g74bc250/cargo-crates/fern-0.5.9/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C metadata=6a5b7240b2f46be5 -C extra-filename=-6a5b7240b2f46be5 --out-dir /usr/ports/sysutils/gotop/work/target/release/deps -L dependency=/usr/ports/sysutils/gotop/work/target/release/deps --extern chrono=/usr/ports/sysutils/gotop/work/target/release/deps/libchrono-7b42564b673a393b.rmeta --extern log=/usr/ports/sysutils/gotop/work/target/release/deps/liblog-9a97fd5d0de6fa62.rmeta --cap-lints allow -C linker=cc -C link-arg=-fstack-protector-strong`
error[E0308]: mismatched types
  --> /usr/ports/sysutils/gotop/work/ytop-0.5.1-5-g74bc250/cargo-crates/crossterm-0.14.1/src/terminal/sys/unix.rs:36:70
   |
36 |     if let Ok(true) = wrap_with_result(unsafe { ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut size) }) {
   |                                                                      ^^^^^^^^^^
   |                                                                      |
   |                                                                      expected `u64`, found `u32`
   |                                                                      help: you can convert an `u32` to `u64`: `TIOCGWINSZ.into()`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
error: could not compile `crossterm`.

Caused by:
  process didn't exit successfully: `/usr/local/bin/rustc --edition=2018 --crate-name crossterm /usr/ports/sysutils/gotop/work/ytop-0.5.1-5-g74bc250/cargo-crates/crossterm-0.14.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 --cfg 'feature="default"' -C metadata=75ff034e39c3c7a7 -C extra-filename=-75ff034e39c3c7a7 --out-dir /usr/ports/sysutils/gotop/work/target/release/deps -L dependency=/usr/ports/sysutils/gotop/work/target/release/deps --extern bitflags=/usr/ports/sysutils/gotop/work/target/release/deps/libbitflags-5ff31297c1806566.rmeta --extern lazy_static=/usr/ports/sysutils/gotop/work/target/release/deps/liblazy_static-a0d48c1040764acb.rmeta --extern libc=/usr/ports/sysutils/gotop/work/target/release/deps/liblibc-470c1b7c1ae85d31.rmeta --extern mio=/usr/ports/sysutils/gotop/work/target/release/deps/libmio-9b8635b99b32b202.rmeta --extern parking_lot=/usr/ports/sysutils/gotop/work/target/release/deps/libparking_lot-9dac301372910d2d.rmeta --extern signal_hook=/usr/ports/sysutils/gotop/work/target/release/deps/libsignal_hook-fbfd02724ca89cb7.rmeta --cap-lints allow -C linker=cc -C link-arg=-fstack-protector-strong` (exit code: 1)
warning: build failed, waiting for other jobs to finish...

I just upgraded crossterm on master. Can you tell me if the issue is still there?

The crossterm version changed in ytop, but tui-rs still needs 0.14 and the compilation breaks.

Now the errors look like this:

error: use of deprecated item 'std::error::Error::description': use the Display impl or to_string()
   --> /wrkdirs/usr/ports/sysutils/ytop/work/tui-rs-aff0a4c40aff6e0962a2a935d4b21065298e329c/src/backend/crossterm.rs:64:27
    | 
64  |                 map_error(queue!(string, MoveTo(x, y)))?;
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | 
note: the lint level is defined here
   --> /wrkdirs/usr/ports/sysutils/ytop/work/tui-rs-aff0a4c40aff6e0962a2a935d4b21065298e329c/src/lib.rs:146:9
    | 
146 | #![deny(warnings)]
    |         ^^^^^^^^
    = note: `#[deny(deprecated)]` implied by `#[deny(warnings)]`
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: use of deprecated item 'std::error::Error::description': use the Display impl or to_string()
  --> /wrkdirs/usr/ports/sysutils/ytop/work/tui-rs-aff0a4c40aff6e0962a2a935d4b21065298e329c/src/backend/crossterm.rs:79:27
   | 
79 |                 map_error(queue!(string, SetForegroundColor(color)))?;
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: use of deprecated item 'std::error::Error::description': use the Display impl or to_string()
  --> /wrkdirs/usr/ports/sysutils/ytop/work/tui-rs-aff0a4c40aff6e0962a2a935d4b21065298e329c/src/backend/crossterm.rs:85:27
   |
85 |                 map_error(queue!(string, SetBackgroundColor(color)))?;
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: use of deprecated item 'std::error::Error::description': use the Display impl or to_string()
   --> /wrkdirs/usr/ports/sysutils/ytop/work/tui-rs-aff0a4c40aff6e0962a2a935d4b21065298e329c/src/backend/crossterm.rs:94:19
    |
94  |           map_error(queue!(
    |  ___________________^
95  | |             self.buffer,
96  | |             Print(string.clone()),
97  | |             SetForegroundColor(CColor::Reset),
98  | |             SetBackgroundColor(CColor::Reset),
99  | |             SetAttribute(CAttribute::Reset)
100 | |         ))
    | |_________^
    |
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)