You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Thanks a lot for bringing V8 to rust world! This is awesome! :)
I've found a little issue when cross-compiling this wonderful library and I'm happy to share my findings to contribute to this project and wonderful rust community.
In my particular case my host is x86_64-unknown-linux-gnu and target is x86_64-pc-windows-msvc.
I used magnificent cargo-xwin package to achieve that. However it turns out that in rusty_v8 build.rs target conditions work great when host and target is the same, but not in such case. The culprit is that build.rs uses $[cfg(target_os = ...)], however in this context target_os refers to target of build.rs, which is compiled to be run on host, and this is not what target_os of rusty_v8 is.
This is a misunderstanding that I've seen happen in other projects too, like druid (maan2003/druid@229a3e1) for example, and using CARGO_CFG_TARGET_OS env instead seems to do the trick.
In my case the effect of this was that script tried to download prebuild .a file for windows platform, which does not exist and results in 404. As a workaround I specified the RUSTY_V8_ARCHIVE env var manually which allowed me to build the crate using correct .lib file. If anyone encounters same difficulties, then I also had to set CXXSTDLIB to msvcprt, because I got linking errors due to missing __ExceptionPtrCreate symbols.
The text was updated successfully, but these errors were encountered:
Hi! Thanks a lot for bringing V8 to rust world! This is awesome! :)
I've found a little issue when cross-compiling this wonderful library and I'm happy to share my findings to contribute to this project and wonderful rust community.
In my particular case my host is x86_64-unknown-linux-gnu and target is x86_64-pc-windows-msvc.
I used magnificent cargo-xwin package to achieve that. However it turns out that in rusty_v8 build.rs target conditions work great when host and target is the same, but not in such case. The culprit is that build.rs uses $[cfg(target_os = ...)], however in this context target_os refers to target of build.rs, which is compiled to be run on host, and this is not what target_os of rusty_v8 is.
This is a misunderstanding that I've seen happen in other projects too, like druid (maan2003/druid@229a3e1) for example, and using CARGO_CFG_TARGET_OS env instead seems to do the trick.
In my case the effect of this was that script tried to download prebuild .a file for windows platform, which does not exist and results in 404. As a workaround I specified the RUSTY_V8_ARCHIVE env var manually which allowed me to build the crate using correct .lib file. If anyone encounters same difficulties, then I also had to set CXXSTDLIB to msvcprt, because I got linking errors due to missing __ExceptionPtrCreate symbols.
The text was updated successfully, but these errors were encountered: