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

mismatched types error on armv7 #10

Closed
MagaTailor opened this issue Nov 19, 2015 · 8 comments
Closed

mismatched types error on armv7 #10

MagaTailor opened this issue Nov 19, 2015 · 8 comments

Comments

@MagaTailor
Copy link

Hi,

There's been a breakage affecting arm platforms recently (and x86 android too) and while some of the crates have already been fixed it seems the problem won't be fixed in a top-down manner. You will probably have to look into this:

Compiling users v0.4.3
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/users-0.4.3/src/lib.rs:280:40: 280:41 error: mismatched types:
 expected `*const u8`,
    found `*const i8`
(expected u8,
    found i8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/users-0.4.3/src/lib.rs:280     from_utf8_unchecked(CStr::from_ptr(p).to_bytes()).to_string()
                                                                                                                               ^
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/users-0.4.3/src/lib.rs:280:40: 280:41 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/users-0.4.3/src/lib.rs:365:61: 365:89 error: mismatched types:
 expected `*const i8`,
    found `*const u8`
(expected i8,
    found u8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/users-0.4.3/src/lib.rs:365                 let user = unsafe { passwd_to_user(getpwnam(username_c.unwrap().as_ptr())) };
                                                                                                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/users-0.4.3/src/lib.rs:365:61: 365:89 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/users-0.4.3/src/lib.rs:418:62: 418:92 error: mismatched types:
 expected `*const i8`,
    found `*const u8`
(expected i8,
    found u8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/users-0.4.3/src/lib.rs:418                 let user = unsafe { struct_to_group(getgrnam(group_name_c.unwrap().as_ptr())) };
                                                                                                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/users-0.4.3/src/lib.rs:418:62: 418:92 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to 3 previous errors

@MagaTailor
Copy link
Author

The alternative to doing casts is a switch to std::os::raw where applicable. What's the plan for this crate?

@ogham
Copy link
Owner

ogham commented Jan 28, 2016

Hi,

I just made a load of changes, including removing some casts (which I think I originally wrote when I didn't know what I was doing). Try now?

@MagaTailor
Copy link
Author

It does compile on nightly - I can't tell from memory if it didn't using 1.5 or nightly.

@ogham
Copy link
Owner

ogham commented Jan 28, 2016

This crate doesn't use any unstable features anymore, so if it compiles now it should compile everywhere (I hope!)

@MagaTailor
Copy link
Author

No, that's not what I meant - the ARM issue bites differently before and after 1.6. The details are in the link.

@MagaTailor
Copy link
Author

I've found my old comment so it seems the issue was not about 1.5 but rather >= 1.6. Thanks!

It doesn't help much building exa though, cause the root cause is still there and other crates, like locale stop the show.

@MagaTailor
Copy link
Author

Ha, see what I mean? Before that debacle Rust used to be a cross-platform language but now you'd have to be thinking about stuff like this in advance:

 Compiling users v0.4.4
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/users-0.4.4/src/lib.rs:326:35: 326:44 error: mismatched types:
 expected `*const i8`,
    found `*const u8`
(expected i8,
    found u8) [E0308]
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/users-0.4.4/src/lib.rs:326         members.push(from_raw_buf(*username));
                                                                                                                      ^~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/users-0.4.4/src/lib.rs:326:35: 326:44 help: run `rustc --explain E0308` to see a detailed explanation
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/users-0.4.4/src/lib.rs:365:61: 365:89 error: mismatched types:
 expected `*const u8`,
    found `*const i8`
(expected u8,
    found i8) [E0308]
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/users-0.4.4/src/lib.rs:365                 let user = unsafe { passwd_to_user(getpwnam(username_c.unwrap().as_ptr())) };
                                                                                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/users-0.4.4/src/lib.rs:365:61: 365:89 help: run `rustc --explain E0308` to see a detailed explanation
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/users-0.4.4/src/lib.rs:418:62: 418:92 error: mismatched types:
 expected `*const u8`,
    found `*const i8`
(expected u8,
    found i8) [E0308]
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/users-0.4.4/src/lib.rs:418                 let user = unsafe { struct_to_group(getgrnam(group_name_c.unwrap().as_ptr())) };
                                                                                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/users-0.4.4/src/lib.rs:418:62: 418:92 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to 3 previous errors
Build failed, waiting for other jobs to finish...
Could not compile `users`.

This happens on Rust 1.5 which previously was OK.

@MagaTailor MagaTailor reopened this Jan 28, 2016
@MagaTailor
Copy link
Author

Rust 1.5 is probably irrelevant by now, closing.

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