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

Raspberry Pi support #85

Open
Bombfuse opened this issue May 7, 2020 · 17 comments
Open

Raspberry Pi support #85

Bombfuse opened this issue May 7, 2020 · 17 comments

Comments

@Bombfuse
Copy link
Contributor

Bombfuse commented May 7, 2020

It looks like this line is failing to compile.

Tried compiling from a Raspberry Pi 3
Tried Cross-compiling on WSL/Ubuntu targeting arm7-unknown-linux-gnueabihf

    --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/sapp-linux-0.1.7/src/lib.rs:1132:46
     |
1132 |             let rust_msg = CString::from_raw(msg as *mut i8);
     |                                              ^^^^^^^^^^^^^^ expected `u8`, found `i8`
     |
     = note: expected raw pointer `*mut u8`
                found raw pointer `*mut i8`

error: aborting due to previous error
@not-fl3 not-fl3 changed the title Failing to compile sapp-linux Raspberry Pi support May 8, 2020
@not-fl3
Copy link
Owner

not-fl3 commented May 8, 2020

Fixed that specific error and now it builds for arm-unknown-linux-gnueabihf

But I am not sure that miniquad will works on raspberry - afaik there was some raspberry-specific GL loader required.

@Bombfuse
Copy link
Contributor Author

Bombfuse commented May 8, 2020

I'm targeting the Gameshell which is some flavor of some linux distro. Also not sure if it will run but I'll try it out!

@Bombfuse
Copy link
Contributor Author

Bombfuse commented May 8, 2020

I'm sourcing from the repo/master but I'm still getting the same error as before even after cargo update.

I'm curious if instead of "_", it explicitly has to be "u8". I'll clone and try it out

@Bombfuse
Copy link
Contributor Author

Bombfuse commented May 8, 2020

Can confirm that changing it to a u8 fixes the problem! It now runs on raspberry pi! Next, to try the gameshell

@not-fl3
Copy link
Owner

not-fl3 commented May 8, 2020

Hm, interesting, _ works for me with cargo build --arm-unknown-linux-gnueabihf and I can't see the difference with _ and u8.
How do you compile for raspberry? Any way to reproduce this error?

@Bombfuse
Copy link
Contributor Author

Bombfuse commented May 9, 2020

Just a regular cargo build on the pi works when the u8 change. Not sure how to reproduce it without using Raspbian, maybe it's possible to spin it up in a VM.

@not-fl3
Copy link
Owner

not-fl3 commented May 9, 2020

Just tried on the raspbian and it works for me. (just for the record - miniquad took 13 minutes to compile in qemu and raspbian).
Could you try it again and post an error? I guess something is wrong with cargo versions, caches or something like that.

I found the source of the problem: rust-lang/rust#29867 and very similar fix: https://github.com/alacritty/alacritty/pull/60/files

@Bombfuse
Copy link
Contributor Author

Bombfuse commented May 9, 2020

Yah I can try it out again tonight and get some more details

@not-fl3
Copy link
Owner

not-fl3 commented May 9, 2020

awesome, thanks!

@Bombfuse
Copy link
Contributor Author

Yah it looks like it was ultimately the quad-gl dependency I had that was erroring out, because it didn't have the updated code. I removed the dependency and it builds properly now! Looks like its fixed

@not-fl3
Copy link
Owner

not-fl3 commented May 10, 2020

Awesome!
This means that RPI-3+ is now supported by miniquad! 🎉
Will keep it open - because of RPI-2 with opengl 2.

@Bombfuse
Copy link
Contributor Author

I haven't ran it on the actual Pi yet, just cross-compiled from WSL/Ubuntu. I can try to get a window open on the Pi to confirm though!

@Bombfuse
Copy link
Contributor Author

Can confirm it runs on raspberry pi!

@Bombfuse
Copy link
Contributor Author

Bombfuse commented Jul 29, 2020

Appears that there's a new break in sapp-linux

macbook:~ bombfuse$ cd miniquad/
macbook:miniquad bombfuse$ cargo build --target armv7-unknown-linux-gnueabihf
    Updating crates.io index
  Downloaded libc v0.2.74
  Downloaded 1 crate (503.4 KB) in 0.81s
   Compiling libc v0.2.74
   Compiling sapp-linux v0.1.8 (/Users/bombfuse/miniquad/native/sapp-linux)
error[E0308]: mismatched types
    --> native/sapp-linux/src/lib.rs:1277:42
     |
1277 |             data: ClientMessageData { l: data },
     |                                          ^^^^ expected `i32`, found `i64`
     |
     = note: expected array `[i32; 5]`
                found array `[i64; 5]`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
error: could not compile `sapp-linux`.

To learn more, run the command again with --verbose.

edited with miniquad output

@iamwacko
Copy link
Contributor

RPI-3+ builds are broken. I get mismatched type errors expected 'u8', found 'i8' all over the code.

@not-fl3
Copy link
Owner

not-fl3 commented Jun 15, 2022

RPI-3+ builds are broken. I get mismatched type errors expected 'u8', found 'i8' all over the code.

Thanks for the report! Totally overlooked an RPI in the 0.3 update PR, we should definitely add it to the CI somehow!

Can't promise a fix soon, making an RPI setup will take some time, not sure I'll have time for this super soon :(

PRs very welcome tho!

@iamwacko
Copy link
Contributor

iamwacko commented Jun 20, 2022

@not-fl3 Opened a PR that fixes RPI compilation.

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

3 participants