Open felixf4xu opened 1 month ago
You will need to specify V8_FROM_SOURCE=1
env var as per https://github.com/denoland/rusty_v8?tab=readme-ov-file#build-v8-from-source
thanks, but what I want is to build with the .a (v8 library).
By what setting will this repo built with the binary form of v8 library? From what I read from the readme, it should be default.
Anything that I missed?
@devsnek can you take a look?
@felixf4xu if you're building with a pre-existing .a
file you will also need a src_binding.rs
file. building with V8_FROM_SOURCE=1
will create this file, which is the intended way to build from the repo.
Thanks, I guess I was confused by the readme:
Binaries builds are turned on by default: cargo build will initiate a download from github to get the static lib. To disable this build using the V8_FROM_SOURCE environmental variable.
Anyway, I would like to share my steps to build this repo.
V8_FROM_SOURCE=1 cargo build
This will fail after a lot of c++ errors which is not a surprise, but it will create the target/debug/gn_out/src_binding.rs
file and print out this line
[v8 129.0.0] cargo:rustc-env=RUSTY_V8_SRC_BINDING_PATH=/home/ccc/github/rusty_v8/target/debug/gn_out/src_binding.rs
src_binding.rs
V8_FROM_SOURCE=0 RUSTY_V8_SRC_BINDING_PATH=/home/ccc/github/rusty_v8/target/debug/gn_out/src_binding.rs cargo build
it will build successfully very fast, because target/debug/gn_out/obj/librusty_v8.a
is downloaded not compiled.
Then I can go on to try the examples by cargo build --example hello_world
and cargo run --example hello_world
, it's nice to see the output of 3 + 4 = 7
!
But this building process makes me wonder, if only src_binding.rs
is needed, is there any easier step to create it instead of forcing to build from source once? it says
/* automatically generated by rust-bindgen 0.69.4 */
Option 1:
can we just generate src_binding.rs
instead of try to build all v8 from source?
Option 2:
can we check in the src_binding.rs
file into git? I see it's generated by src/binding.hpp
and v8/include
, and both of those 2 dependencies are checked in, so it might be possible to also check in src_binding.rs
together in one commit to avoid version mismatch.
Hi,
I cloned this repo and its submodules, then in the root folder of the repo, I run
cargo build
I'm not sure if this is the right first step to build.
I did not set any env variable.