I'm trying to build deno (a javascript runtime built in rust) from source on FreeBSD 12.1.
The compilation failed at rusty_v8.
I then try to compile directly from the rusty_v8 repo.
I've followed the instructions from the github repository (installed python2.7 - symlinked to python since it's required to have python for the installation, installed glib-2.56.3_7,1).
I then ran cargo build and everything compiles until I get this error:
Compiling rusty_v8 v0.5.0 (/root/rusty_v8)
Running `CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_HOMEPAGE= CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=5 CARGO_PKG_NAME=rusty_v8 CARGO_PKG_REPOSITORY='https://github.com/denoland/rusty_v8' CARGO_PKG_AUTHORS='the Deno authors' CARGO_PKG_DESCRIPTION='Rust bindings to V8' CARGO_MANIFEST_DIR=/root/rusty_v8 CARGO=/usr/local/bin/cargo LD_LIBRARY_PATH='/root/rusty_v8/target/debug/deps:/usr/local/lib' CARGO_PKG_VERSION_PRE= CARGO_PKG_VERSION=0.5.0 rustc --crate-name build_script_build --edition=2018 build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=719d54043908067c -C extra-filename=-719d54043908067c --out-dir /root/rusty_v8/target/debug/build/rusty_v8-719d54043908067c -C incremental=/root/rusty_v8/target/debug/incremental -L dependency=/root/rusty_v8/target/debug/deps --extern cargo_gn=/root/rusty_v8/target/debug/deps/libcargo_gn-b31804f02f0a6a61.rlib --extern which=/root/rusty_v8/target/debug/deps/libwhich-e5ce3a8d7f279796.rlib -L native=/root/rusty_v8/target/debug/build/backtrace-sys-2d9c9cf21034351a/out`
error[E0308]: mismatched types
--> build.rs:117:18
|
117 | fn platform() -> &'static str {
| -------- ^^^^^^^^^^^^ expected `&str`, found `()`
| |
| implicitly returns `()` as its body has no tail or `return` expression
error: aborting due to previous error
The error comes from this function:
fn platform() -> &'static str {
#[cfg(target_os = "windows")]
{
"win"
}
#[cfg(target_os = "linux")]
{
"linux64"
}
#[cfg(target_os = "macos")]
{
"mac"
}
}
As target_os = "freebsd", the functions returns nothing, hence the error.
I'll try to modify the values to see if it changes anything and I'll deep a bit more into the source code.