Closed vmx closed 7 years ago
The issue is that the generated bindings use std::os::raw::c_char, and our code uses libc::c_char. In the past these types have been identical, and now they are not for some reason. https://github.com/rust-lang/rust/pull/40317 just merged four days ago, so rust-mozjs requires a more recent nightly version in order to avoid this problem. For Servo, this can be addressed by updating the contents of the rust-commit-hash
file to make the build system use the given compiler version.
I've updated rust via rustup, my system is now on
nightly-x86_64-unknown-linux-gnu updated - rustc 1.17.0-nightly (ccce2c6eb 2017-03-27)
Which is after the commit https://github.com/rust-lang/rust/commit/24be89980e2e89404075fe463edae0f5db369251 mentioned above. The error is still the same.
Unless you are building rust-mozjs standalone, your local compiler (as updated by rustup) has no effect on the Servo build system. Are you building Servo (via ./mach build
), or rust-mozjs (via cargo build
)?
I'm building rust-mozjs standalone (it's all I care about atm). See the exact command I'm building with on the original bug description.
It builds now. My nightly build wasn't recent enough as as fix got merged with https://github.com/rust-lang/rust/pull/40867 just two days ago. Another rustup update
got me to version rustc 1.17.0-nightly (e1cec5d4b 2017-03-29)
which is recent enough. Thanks @jdm for finding that out.
I tried to compile
rust-mozjs
for Android x86. It fails with the error below. I suspect that there's a mismatch between the platform headers and the actual platform. On Android x86c_char
isi8
on ARM it'su8
.I have no clue, why it would expect an ARM-stlye
u8
although I compile for x86. I'm happy to work on a fix if anyone tells me where to look.