Rubyboat
Rubyboat7mo ago

Compiling for use on ARM

I'm trying to use the rust deno crate on ARM linux, so I need to compile it for that. I'm trying my hardest to compile for arm linux on an x64 windows machine (yes i know). So I'm using WSL, and trying to compile rustyV8. Currently my setup is the following: i have:
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
in my cargo.toml, and because there is no prebuilt V8 binaries for this, I have the environment variable V8_FROM_SOURCE=1. my current error is the following:
thread 'main' panicked at /home/<me>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/v8-0.99.0/build.rs:947:5:
assertion failed: Command::new(gn()).arg(format!("--root={}",
dirs.root.display())).arg(format!("--script-executable={}",
python())).arg("gen").arg(&gn_out_dir).arg("--ide=json").arg("--args=".to_owned()
+
&args).stdout(Stdio::inherit()).stderr(Stdio::inherit()).envs(env::vars()).status().expect("Could not run `gn`").
thread 'main' panicked at /home/<me>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/v8-0.99.0/build.rs:947:5:
assertion failed: Command::new(gn()).arg(format!("--root={}",
dirs.root.display())).arg(format!("--script-executable={}",
python())).arg("gen").arg(&gn_out_dir).arg("--ide=json").arg("--args=".to_owned()
+
&args).stdout(Stdio::inherit()).stderr(Stdio::inherit()).envs(env::vars()).status().expect("Could not run `gn`").
1 Reply
Deno AI Helper
Deno AI Helper7mo ago
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the information you've provided in your message, I noticed that you have a syntax error in your cargo.toml snippet. The syntax for specifying a target in cargo.toml should be within a configuration file named .cargo/config or .cargo/config.toml, not directly in cargo.toml. Your .cargo/config or .cargo/config.toml should look something like this:
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
Please ensure that you are editing the correct file. Also, make sure that you have the arm-linux-gnueabihf-gcc toolchain installed on your WSL environment. Regarding the error you're encountering with the build.rs script, it's difficult to diagnose the exact issue without more context. The error message suggests that there's a problem with running the gn command, which is part of the V8 build process. Make sure that you have all the necessary dependencies installed and that the gn tool is accessible in your PATH. This advice is not based on the Deno documentation, so please double-check the accuracy of the advice given and consult the appropriate Rust and V8 documentation or community resources for further assistance.

Did you find this page helpful?