rusty_v8 icon indicating copy to clipboard operation
rusty_v8 copied to clipboard

No binding built when using RUSTY_V8_ARCHIVE

Open ArchGuyWu opened this issue 1 year ago • 3 comments

Using RUSTY_V8_ARCHIVE just requires to specify the path to v8 static library, but rusty_v8 also requires prebuilt rusty_v8_src_binding.

  error: couldn't read C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\v8-0.99.0\gen\src_binding_release_x86_64-pc-windows-gnu.rs: The system cannot find the file specified. (os error 2)
   --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\v8-0.99.0\src\binding.rs:4:1
    |
  4 | include!(env!("RUSTY_V8_SRC_BINDING_PATH"));
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
  
  error: could not compile `v8` (lib) due to 1 previous error

ArchGuyWu avatar Aug 16 '24 05:08 ArchGuyWu

You can set RUSTY_V8_SRC_BINDING_PATH to the relevant file, which is available in the CI run that built that release: https://github.com/denoland/rusty_v8/actions/runs/10432771882#artifacts

I guess we could improve this by also including these files in the release artifacts

devsnek avatar Aug 19 '24 14:08 devsnek

You can set RUSTY_V8_SRC_BINDING_PATH to the relevant file, which is available in the CI run that built that release: https://github.com/denoland/rusty_v8/actions/runs/10432771882#artifacts

I guess we could improve this by also including these files in the release artifacts

Could we make rusty_v8 automatically obtain a binding if the RUSTY_V8_SRC_BINDING_PATH environment variable is not set? This is because it might be a custom static library.

ArchGuyWu avatar Aug 20 '24 01:08 ArchGuyWu

The binding file needs to be built under the same conditions that the static library was built. If you have your own process for building the static library, you will need to include the binding file in that workflow as well.

devsnek avatar Aug 21 '24 14:08 devsnek

The github releases now include the src_binding files as well.

devsnek avatar Sep 04 '24 18:09 devsnek

You can set RUSTY_V8_SRC_BINDING_PATH to the relevant file, which is available in the CI run that built that release: https://github.com/denoland/rusty_v8/actions/runs/10432771882#artifacts

I guess we could improve this by also including these files in the release artifacts

Looks like RUSTY_V8_SRC_BINDING_PATH used in https://github.com/denoland/rusty_v8/blob/a97d89614e8249a86c223a2bc049b1c574bb40f1/src/binding.rs#L5 with includes! , and it can't be absolute path, so we cannot use an external src_binding file like what RUSTY_V8_ARCHIVE does?

GreenDou avatar Sep 05 '24 10:09 GreenDou