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

<Missing title> related to ARM breakage #41

Closed
MagaTailor opened this issue Jan 5, 2016 · 14 comments
Closed

<Missing title> related to ARM breakage #41

MagaTailor opened this issue Jan 5, 2016 · 14 comments

Comments

@MagaTailor
Copy link

Hi,

I guess you haven't caught up with this issue yet :)
Here's a first, coming from an ARM Linux machine using 1.7 nightly:

Compiling wayland-client v0.2.1
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/wayland-client-0.2.1/src/core/registry.rs:248:49: 248:58 error: mismatched types:
 expected `*const u8`,
    found `*const i8`
(expected u8,
    found i8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/wayland-client-0.2.1/src/core/registry.rs:248     let interface_str = unsafe { CStr::from_ptr(interface) };
                                                                                                                                                           ^~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/wayland-client-0.2.1/src/core/registry.rs:248:49: 248:58 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/wayland-client-0.2.1/src/core/output/output.rs:256:44: 256:56 error: mismatched types:
 expected `*const u8`,
    found `*const i8`
(expected u8,
    found i8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/wayland-client-0.2.1/src/core/output/output.rs:256     let manu_str = unsafe { CStr::from_ptr(manufacturer) };
                                                                                                                                                           ^~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/wayland-client-0.2.1/src/core/output/output.rs:256:44: 256:56 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/wayland-client-0.2.1/src/core/output/output.rs:257:45: 257:50 error: mismatched types:
 expected `*const u8`,
    found `*const i8`
(expected u8,
    found i8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/wayland-client-0.2.1/src/core/output/output.rs:257     let model_str = unsafe { CStr::from_ptr(model) };
                                                                                                                                                            ^~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/wayland-client-0.2.1/src/core/output/output.rs:257:45: 257:50 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/wayland-client-0.2.1/src/core/seat/seat.rs:196:44: 196:48 error: mismatched types:
 expected `*const u8`,
    found `*const i8`
(expected u8,
    found i8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/wayland-client-0.2.1/src/core/seat/seat.rs:196     let name_str = unsafe { CStr::from_ptr(name) };
                                                                                                                                                       ^~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/wayland-client-0.2.1/src/core/seat/seat.rs:196:44: 196:48 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/wayland-client-0.2.1/src/core/shell/shell_surface.rs:213:17: 213:31 error: mismatched types:
 expected `*const i8`,
    found `*const u8`
(expected i8,
    found u8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/wayland-client-0.2.1/src/core/shell/shell_surface.rs:213                 title.as_ptr()
                                                                                                                                      ^~~~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/wayland-client-0.2.1/src/core/shell/shell_surface.rs:213:17: 213:31 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/wayland-client-0.2.1/src/core/shell/shell_surface.rs:227:17: 227:31 error: mismatched types:
 expected `*const i8`,
    found `*const u8`
(expected i8,
    found u8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/wayland-client-0.2.1/src/core/shell/shell_surface.rs:227                 title.as_ptr()
                                                                                                                                      ^~~~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/wayland-client-0.2.1/src/core/shell/shell_surface.rs:227:17: 227:31 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to 6 previous errors

BTW:
Is there a way to disable building wayland dependencies on X? It's really slow on arm...

@elinorbgr
Copy link
Member

You are using wayland-client-0.2.1, which is a really outdated version, current version is 0.5.6.

Given your question, I guess you are depending on wayland-client through glutin? If so it's a question you should ask there.

@MagaTailor
Copy link
Author

Correct, yours is the first crate to not have this issue in the latest version without targeted fixing. Well done!

Not that it'll help much without updating all dependencies.

@MagaTailor
Copy link
Author

It seems I let you off the hook too easily :)

Using 0.5.6 from within an actual project (or rather on rust 1.5) exhibits the issue after all:

Compiling wayland-client v0.5.6
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:176:72: 176:111 error: mismatched types:
 expected `*const i8`,
    found `*mut u8`
(expected i8,
    found u8) [E0308]
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:176             let arg_2 = unsafe {String::from_utf8_lossy(CStr::from_ptr(*(args.offset(2) as *const *mut c_char)).to_bytes()).into_owned()};
                                                                                                                                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/wayland-client-0.5.6/src/sys/wayland.rs:9:5: 9:66 note: in this expansion of include!
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:176:72: 176:111 help: run `rustc --explain E0308` to see a detailed explanation
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:324:72: 324:111 error: mismatched types:
 expected `*const i8`,
    found `*mut u8`
(expected i8,
    found u8) [E0308]
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:324             let arg_1 = unsafe {String::from_utf8_lossy(CStr::from_ptr(*(args.offset(1) as *const *mut c_char)).to_bytes()).into_owned()};
                                                                                                                                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/wayland-client-0.5.6/src/sys/wayland.rs:9:5: 9:66 note: in this expansion of include!
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:324:72: 324:111 help: run `rustc --explain E0308` to see a detailed explanation
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:1034:72: 1034:111 error: mismatched types:
 expected `*const i8`,
    found `*mut u8`
(expected i8,
    found u8) [E0308]
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:1034             let arg_0 = unsafe {String::from_utf8_lossy(CStr::from_ptr(*(args.offset(0) as *const *mut c_char)).to_bytes()).into_owned()};
                                                                                                                                                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/wayland-client-0.5.6/src/sys/wayland.rs:9:5: 9:66 note: in this expansion of include!
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:1034:72: 1034:111 help: run `rustc --explain E0308` to see a detailed explanation
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:1165:72: 1165:111 error: mismatched types:
 expected `*const i8`,
    found `*mut u8`
(expected i8,
    found u8) [E0308]
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:1165             let arg_0 = unsafe {String::from_utf8_lossy(CStr::from_ptr(*(args.offset(0) as *const *mut c_char)).to_bytes()).into_owned()};
                                                                                                                                                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/wayland-client-0.5.6/src/sys/wayland.rs:9:5: 9:66 note: in this expansion of include!
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:1165:72: 1165:111 help: run `rustc --explain E0308` to see a detailed explanation
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:1169:72: 1169:111 error: mismatched types:
 expected `*const i8`,
    found `*mut u8`
(expected i8,
    found u8) [E0308]
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:1169             let arg_0 = unsafe {String::from_utf8_lossy(CStr::from_ptr(*(args.offset(0) as *const *mut c_char)).to_bytes()).into_owned()};
                                                                                                                                                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/wayland-client-0.5.6/src/sys/wayland.rs:9:5: 9:66 note: in this expansion of include!
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:1169:72: 1169:111 help: run `rustc --explain E0308` to see a detailed explanation
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:2506:72: 2506:111 error: mismatched types:
 expected `*const i8`,
    found `*mut u8`
(expected i8,
    found u8) [E0308]
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:2506             let arg_0 = unsafe {String::from_utf8_lossy(CStr::from_ptr(*(args.offset(0) as *const *mut c_char)).to_bytes()).into_owned()};
                                                                                                                                                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/wayland-client-0.5.6/src/sys/wayland.rs:9:5: 9:66 note: in this expansion of include!
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:2506:72: 2506:111 help: run `rustc --explain E0308` to see a detailed explanation
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:3404:72: 3404:111 error: mismatched types:
 expected `*const i8`,
    found `*mut u8`
(expected i8,
    found u8) [E0308]
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:3404             let arg_5 = unsafe {String::from_utf8_lossy(CStr::from_ptr(*(args.offset(5) as *const *mut c_char)).to_bytes()).into_owned()};
                                                                                                                                                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/wayland-client-0.5.6/src/sys/wayland.rs:9:5: 9:66 note: in this expansion of include!
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:3404:72: 3404:111 help: run `rustc --explain E0308` to see a detailed explanation
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:3405:72: 3405:111 error: mismatched types:
 expected `*const i8`,
    found `*mut u8`
(expected i8,
    found u8) [E0308]
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:3405             let arg_6 = unsafe {String::from_utf8_lossy(CStr::from_ptr(*(args.offset(6) as *const *mut c_char)).to_bytes()).into_owned()};
                                                                                                                                                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/wayland-client-0.5.6/src/sys/wayland.rs:9:5: 9:66 note: in this expansion of include!
/tmp/minesweeper-rs-master/target/release/build/wayland-client-6ced70a018d69f03/out/wayland_client_api.rs:3405:72: 3405:111 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to 8 previous errors

Using stable rust 1.5 this time.

@elinorbgr
Copy link
Member

Hmm, this is troubling, I'm using libc 0.2 everywhere, so this error should not show up...

Can you tell me which versions of wayland-client, wayland-sys, wayland-scanner and dlib is used in your Cargo.lock ?

@elinorbgr
Copy link
Member

Ah yeah, libc 0.2 is not compatible with Rust 1.5 and prior (from the rust issue)...

So, I guess my lib is only usable on ARM using rust 1.6 or newer

I can't really fix that though, the incompatibility comes from rust itself

@MagaTailor
Copy link
Author

If you don't require beta/nightly to build there's no problem to fix it. It's normally done via casts like as *const _ or using coercion via a variable. Have a look at other fixed crates.

@elinorbgr
Copy link
Member

Hmm, ok, I'll see what I can do about that.

@elinorbgr
Copy link
Member

Hopefully #42 should fix this issue.

@MagaTailor
Copy link
Author

With typos like ow? ;) Owww!

Have a look at some more issues building with 1.5:

Compiling wayland-client v0.5.7 (file:///tmp/wayland-client-rs-master)
wayland-client/src/cursor.rs:7:19: 7:24 error: unresolved import `wayland_sys::c_int`. There is no `c_int` in `wayland_sys` [E0432]
wayland-client/src/cursor.rs:7 use wayland_sys::{c_int, uint32_t};
                                                 ^~~~~
wayland-client/src/cursor.rs:7:19: 7:24 help: run `rustc --explain E0432` to see a detailed explanation
wayland-client/src/cursor.rs:7:26: 7:34 error: unresolved import `wayland_sys::uint32_t`. There is no `uint32_t` in `wayland_sys` [E0432]
wayland-client/src/cursor.rs:7 use wayland_sys::{c_int, uint32_t};
                                                        ^~~~~~~~
wayland-client/src/cursor.rs:7:26: 7:34 help: run `rustc --explain E0432` to see a detailed explanation
/tmp/wayland-client-rs-master/target/debug/build/wayland-client-b1d6f73f31278fa8/out/wayland_client_api.rs:43:20: 43:26 error: unresolved import `std::ow::raw::c_void`. Could not find `ow` in `std` [E0432]
/tmp/wayland-client-rs-master/target/debug/build/wayland-client-b1d6f73f31278fa8/out/wayland_client_api.rs:43 use std::ow::raw::{c_void, c_char};
                                                                                                                                 ^~~~~~
wayland-client/src/sys/wayland.rs:9:5: 9:66 note: in this expansion of include!
/tmp/wayland-client-rs-master/target/debug/build/wayland-client-b1d6f73f31278fa8/out/wayland_client_api.rs:43:20: 43:26 help: run `rustc --explain E0432` to see a detailed explanation
/tmp/wayland-client-rs-master/target/debug/build/wayland-client-b1d6f73f31278fa8/out/wayland_client_api.rs:43:28: 43:34 error: unresolved import `std::ow::raw::c_char`. Could not find `ow` in `std` [E0432]
/tmp/wayland-client-rs-master/target/debug/build/wayland-client-b1d6f73f31278fa8/out/wayland_client_api.rs:43 use std::ow::raw::{c_void, c_char};
                                                                                                                                         ^~~~~~
wayland-client/src/sys/wayland.rs:9:5: 9:66 note: in this expansion of include!
/tmp/wayland-client-rs-master/target/debug/build/wayland-client-b1d6f73f31278fa8/out/wayland_client_api.rs:43:28: 43:34 help: run `rustc --explain E0432` to see a detailed explanation
error: aborting due to 4 previous errors
Could not compile `wayland-client`.

@elinorbgr
Copy link
Member

I was fixing that, but messed things up a little.
I should stop fixing things while sick, I guess.
I'll publish 0.5.8 with fixes asap.

@MagaTailor
Copy link
Author

Take your time, no need to rush - wayland can wait a little bit longer ;)

@elinorbgr
Copy link
Member

Okay.

0.5.8 is published, and should be corrected (at least it builds correctly on x86).

Can you tell me if it solves the breakage on ARM ?

@MagaTailor
Copy link
Author

Yup! Thanks.

@elinorbgr
Copy link
Member

Okay, perfect. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants