2 ms·
I Can't Run My Rust Game Either
- talldayo 2y ago[flagged]
- deleted 2y ago[deleted]
- h2odragon 2y agoHad a system built around python1 that was still running in 2005. everything in that codebase was inhouse fork versions. It wouldn't have occurred to me to expect the current versions of the tools i built on years ago to swap into the place of older code; even where we hadn't chopped the originals up in heinous ways in pursuit of our own goal. The grand "make" started with C compiler and libc. I'm not sure what the complaint is here: would it be better to go back to the GCC 2.95 period of stability? You want a compiler (and language) that doesn't change with the days opinions?
- JoeyBananas 2y agoSolution: use the correct conpiler version
- estebank 2y agoI don't have the time to check in detail what's going on, but given that rustc didn't have a platform tool chain for M1 Macs then, I would assume that winit didn't support it correctly back then either. I pulled the repo and, on an Intel Mac, as-is it didn't work due to some coreaudio issue. After running cargo update, it successfully built (but failed to run due to an assertion failure, which I assume wasn't present in debug builds when this was written). Edit: the reddit conversation at https://www.reddit.com/r/programming/comments/1ehif46/i_cant_run_my_rust_game_either/ https://www.reddit.com/r/programming/comments/1ehif46/i_cant... confirms what I suspected: Mac changed its API on the platform transition, so the binding had to follow through, but that was after that winit library version was released.
- pornel 2y agoThis is a common pitfall in Rust wrappers for C libraries — they diligently copy the underlying library's typedefs as Rust's type aliases, but Rust doesn't have the same implicit type conversions as C, which makes it a leaky abstraction. In this case, I bet older/Intel version had a `typedef char BOOL` (i8 in Rust), and another version/platform upgraded that to `typedef _Bool BOOL` (bool in Rust). In C that wasn't a breaking change, because C doesn't care if you compare `false` to 0, but Rust does. Similarly, the plain `char` in C is allowed to be signed or unsigned depending on platform. Bindings to C libraries break when Rust programs mix `c_char` and `u8`, which are the same type on some platforms but not others.