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

Fails to build for target s390x-unknown-linux-musl #38

Closed
OTLabs opened this issue Aug 14, 2022 · 9 comments
Closed

Fails to build for target s390x-unknown-linux-musl #38

OTLabs opened this issue Aug 14, 2022 · 9 comments

Comments

@OTLabs
Copy link

OTLabs commented Aug 14, 2022

[361]error[E0277]: the trait bound `u64: From<i32>` is not satisfied
[362](https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L362)  --> /home/buildozer/.cargo/registry/src/github.com-eae4ba8cbf2ce1c7/terminal_size-0.1.17/src/unix.rs:31:23
[363](https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L363)   |
[364](https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L364)31 |     if unsafe { ioctl(fd, TIOCGWINSZ.into(), &mut winsize) } == -1 {
[365](https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L365)   |                 ----- ^^ the trait `From<i32>` is not implemented for `u64`
[366](https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L366)   |                 |
[367](https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L367)   |                 required by a bound introduced by this call
[368](https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L368)   |
[369](https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L369)   = help: the following other types implement trait `From<T>`:
[370](https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L370)             <f32 as From<i16>>
[371](https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L371)             <f32 as From<i8>>
[372](https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L372)             <f32 as From<u16>>
[373](https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L373)             <f32 as From<u8>>
[374](https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L374)             <f64 as From<f32>>
[375](https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L375)             <f64 as From<i16>>
[376](https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L376)             <f64 as From<i32>>
[377](https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L377)             <f64 as From<i8>>
[378](https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L378)           and 67 others
[379](https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L379)   = note: required because of the requirements on the impl of `Into<u64>` for `i32`

https://gitlab.alpinelinux.org/otlabs/aports/-/jobs/802217#L361

@eminence
Copy link
Owner

Thanks for the report. Unfortunately I'm having a hard time reproducing this. My rustup doesn't access to a s390x-unknown-linux-musl target; I only have s390x-unknown-linux-gnu target. I do have some musl non-s390x targets available, and I tried a few of them, and none had this problem.

If you have easy access to a s390x-unknown-linux-musl target, can you try to build terminal-size v0.2.1? That new version uses rustix, not libc, which changes the particular line that is failing. If that works, then I can try to update rav1e and its deptree to use v0.2

@OTLabs
Copy link
Author

OTLabs commented Aug 15, 2022

I would quite appreciate if you can try to update rav1e and its deptree to use v0.2.1.

@eminence
Copy link
Owner

eminence commented Aug 20, 2022

In order to update rav1e to terminal-size v0.2.1, I think all we need is a new release of clap. (The latest clap release uses v0.1.17, but the master branch is using v0.2.1). Since rav1e doesn't have a Cargo.lock, they already use the latest version of clap by default.

@eminence
Copy link
Owner

eminence commented Nov 8, 2022

November status: clap is now using terminal_size v0.2, but rav1e is depending on console v0.15.2 which has a dependency on terminal_size v0.1. An upgrade has been proposed but is blocked on MSRV discussions

(I still don't have access to a s390x-unknown-linux-musl target, so I can't debug the original issue)

@tesuji
Copy link
Contributor

tesuji commented Mar 6, 2023

rust-lang/libc#2615 should fix the
wrong type for ioctl on musl.

@OTLabs could you try again with newest libc crate version (e.g. 0.2.139)?

@OTLabs
Copy link
Author

OTLabs commented Mar 7, 2023

Sure! Thank you! Giving it a try at https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/44836 but get a new error...

@faptc
Copy link

faptc commented Mar 7, 2023

The build fails because cargo cannot download arbitrary package.
In your config, cargo fetch received --target flag but cargo build
didn't. Maybe that's what the problem is.

@OTLabs
Copy link
Author

OTLabs commented Mar 8, 2023

The s390x binary was successfully build! Thank you!

@eminence
Copy link
Owner

eminence commented Mar 8, 2023

Thank you very much @tesuji and @faptc for your input here. I'm going to close this issue as "solved" now

@eminence eminence closed this as completed Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants