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

Crate not usable on arm/android any more #178

Closed
MagaTailor opened this issue Nov 29, 2015 · 6 comments
Closed

Crate not usable on arm/android any more #178

MagaTailor opened this issue Nov 29, 2015 · 6 comments
Assignees
Labels

Comments

@MagaTailor
Copy link
Contributor

The reason being this.

Compiling freetype-rs v0.4.0
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.0/src/face.rs:81:43: 81:77 error: mismatched types:
 expected `*const u8`,
    found `*const i8`
(expected u8,
    found i8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.0/src/face.rs:81             ffi::FT_Attach_File(self.raw, filepathname.as_ptr() as *const i8)
                                                                                                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.0/src/face.rs:81:43: 81:77 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to previous error
@bvssvni
Copy link
Member

bvssvni commented Nov 30, 2015

@petevine Can you test this? We could try filepathname.as_ptr() as *const _.

@MagaTailor
Copy link
Contributor Author

It does compile - I haven't seen this solution yet (a couple of crates have been fixed so far).
Isn't it too permissive or prone to some new kind of error in the future?

EDIT:
I didn't pay attention to version history - was 0.4.0 new enough? (i.e. using libc 0.2?)

@bvssvni
Copy link
Member

bvssvni commented Dec 1, 2015

@petevine Did the error happen on the old version of freetype-rs? Is it fixed now?

@bvssvni
Copy link
Member

bvssvni commented Dec 1, 2015

@petevine Yes, there have been upgrades to libc 0.2 that might change how it worked.

@MagaTailor
Copy link
Contributor Author

The fix allows the current version (0.4.0) to compile.

@bvssvni bvssvni added easy and removed discussion labels Dec 1, 2015
@bvssvni bvssvni self-assigned this Dec 1, 2015
bvssvni added a commit to bvssvni/freetype-rs that referenced this issue Dec 1, 2015
Closes PistonDevelopers#178

- Removed unknown `deny` attribute
@bvssvni bvssvni mentioned this issue Dec 1, 2015
@MagaTailor
Copy link
Contributor Author

Forgot to try on stable 1.5:

Compiling freetype-rs v0.4.1
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/face.rs:314:32: 314:43 error: mismatched types:
 expected `*const i8`,
    found `*mut u8`
(expected i8,
    found u8) [E0308]
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/face.rs:314                 CStr::from_ptr(family_name).to_bytes().to_vec()
                                                                                                                          ^~~~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/face.rs:314:32: 314:43 help: run `rustc --explain E0308` to see a detailed explanation
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/face.rs:327:32: 327:42 error: mismatched types:
 expected `*const i8`,
    found `*mut u8`
(expected i8,
    found u8) [E0308]
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/face.rs:327                 CStr::from_ptr(style_name).to_bytes().to_vec()
                                                                                                                          ^~~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/face.rs:327:32: 327:42 help: run `rustc --explain E0308` to see a detailed explanation
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/face.rs:352:32: 352:41 error: mismatched types:
 expected `*const i8`,
    found `*const u8`
(expected i8,
    found u8) [E0308]
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/face.rs:352                 CStr::from_ptr(face_name).to_bytes().to_vec()
                                                                                                                          ^~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/face.rs:352:32: 352:41 help: run `rustc --explain E0308` to see a detailed explanation
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/library.rs:68:40: 68:53 error: mismatched types:
 expected `*const u8`,
    found `*const i8`
(expected u8,
    found i8) [E0308]
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/library.rs:68             ffi::FT_New_Face(self.raw, path.as_ptr(), face_index as ffi::FT_Long, &mut face)
                                                                                                                                    ^~~~~~~~~~~~~
/tmp/.cargo-1.5/registry/src/github.com-48ad6e4054423464/freetype-rs-0.4.1/src/library.rs:68:40: 68:53 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to 4 previous errors

A few casts should fix that as well.

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

No branches or pull requests

2 participants