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

Cargo build failure on FreeBSD #188

Closed
denningsrogue opened this issue Sep 16, 2020 · 5 comments
Closed

Cargo build failure on FreeBSD #188

denningsrogue opened this issue Sep 16, 2020 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@denningsrogue
Copy link

Cargo install of bandwhich 0.18.1 on freebsd servers running 12.1 RELEASE p9 results in the following failure:

error[E0308]: mismatched types
--> /home/denningsrogue/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/crossterm_terminal-0.1.0/src/sys/unix.rs:29:43
|
29 | let r = unsafe { ioctl(STDOUT_FILENO, TIOCGWINSZ, &us) };
| ^^^^^^^^^^
| |
| 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_terminal.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile bandwhich v0.18.1, intermediate artifacts can be found at /tmp/cargo-installySajL6

Caused by:
build failed

Updated 0 packages.
Failed to update bandwhich.

Package Installed Latest Needs update

No git packages need updating.
Overall updated 0 packages.
Overall failed to update 1 package: bandwhich.

@imsnif
Copy link
Owner

imsnif commented Sep 16, 2020

Hey @denningsrogue, sorry about this. This is a bug in an old version of one of our dependencies. It happened because we just moved to a new terminal infrastructure (crossterm). I'm going to have to do some dependency management in order to fix this and it might take me a few days to get to it.

Meanwhile as a workaround you can install version 0.17.0. Thanks for reporting this - I'll update when this is fixed in a new version.

@imsnif imsnif added the bug Something isn't working label Sep 16, 2020
@imsnif imsnif self-assigned this Sep 16, 2020
@denningsrogue
Copy link
Author

Thanks for the quick reply. I was able to fix the problem by changing line 29 in the code for crossterm:

From —> 29 | let r = unsafe { ioctl(STDOUT_FILENO, TIOCGWINSZ, &us) };

To —> 29 | let r = unsafe { ioctl(STDOUT_FILENO, TIOCGWINSZ.into(), &us) };

@denningsrogue
Copy link
Author

On my system the file is: /home/denningsrogue/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/crossterm_terminal-0.1.0/src/sys/unix.rs

@imsnif
Copy link
Owner

imsnif commented Sep 16, 2020

Definitely, that's the fix. :)

Crossterm fixed it in version 0.22: https://github.com/crossterm-rs/crossterm-terminal/blob/master/CHANGELOG.md#version-022
But since we (also) use crossterm as a transient dependency of tui, and the version of tui that we're using requires the older 0.1 version, we need to also upgrade tui.
We can't upgrade tui to the latest version, because there are breaking api changes. :/

Locally I managed to get it to work by bumping tui from 0.5 to 0.6 (which requires the right version but has no api changes that break the build), but I want to test this a little more thoroughly before releasing a version.

@imsnif imsnif changed the title Cargo build failure Cargo build failure on FreeBSD Sep 16, 2020
@imsnif
Copy link
Owner

imsnif commented Sep 29, 2020

Fixed in 0.19.0

@imsnif imsnif closed this as completed Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants