rusty_v8
rusty_v8 copied to clipboard
Build failed on OpenBSD amd64
I am trying to build Deno on OpenBSD current amd64:
$ RUST_BACKTRACE=full AUTOCONF_VERSION=2.69 AUTOMAKE_VERSION=1.16 cargo install deno
And I get this error:
Compiling rusty_v8 v0.26.0
error[E0308]: mismatched types
--> /home/bukhalo/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.26.0/build.rs:157:18
|
157 | fn platform() -> &'static str {
| -------- ^^^^^^^^^^^^ expected `&str`, found `()`
| |
| implicitly returns `()` as its body has no tail or `return` expression
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
error: could not compile `rusty_v8`
As far as I can see, the error is exactly like issue https://github.com/denoland/rusty_v8/issues/637 So here is the output of the rustc --print=cfg command:
$ rustc --print=cfg
debug_assertions
target_arch="x86_64"
target_endian="little"
target_env=""
target_family="unix"
target_feature="fxsr"
target_feature="sse"
target_feature="sse2"
target_os="openbsd"
target_pointer_width="64"
target_vendor="unknown"
unix
Yes, I know that OpenBSD is not officially supported, but I hope that the problems are not that big and can be solved. I do not write in Rust, but I can help with testing or debugging changes on OpenBSD.
That particular build failure is easy to fix:
diff --git a/build.rs b/build.rs
index 3dcd0a8..f7c2870 100644
--- a/build.rs
+++ b/build.rs
@@ -171,6 +171,10 @@ fn platform() -> &'static str {
{
"mac"
}
+ #[cfg(target_os = "openbsd")]
+ {
+ "openbsd"
+ }
}
fn download_ninja_gn_binaries() {
Let me know how far you get.
@bnoordhuis Thanks, it helped to move things along a little further. Next problem on next function download_ninja_gn_binaries because, https://github.com/denoland/ninja_gn_binaries repo not contain binaries for BSD systems. I was able to install ninja because it is in ports OpenBSD, but gn I had to compile by hand.
The next problem is to build V8 from source. I will write a little later what problems I had and where I left off.
@bukhalo Did you manage to fix the problems ? :)
@AurelienZintzmeyer Unfortunately, no.
I would probably be best if some created an OpenBSD gn port. Then the chromium port could utilize it (unless it bundles a custom version, for some reason), as well as deno and any other future ports.
Not actual, OpenBSD ports already has deno.