Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V8_ENABLE_SANDBOX must be defined for default builds of v8 version > 10.8 #117

Open
hpmachining opened this issue Apr 12, 2023 · 2 comments

Comments

@hpmachining
Copy link
Contributor

I was getting a crash in CAMotics when building cbang against the latest V8 in arch linux.
Embedder-vs-V8 build configuration mismatch. On embedder side sandbox is DISABLED while on V8 side it's ENABLED.

According to this link, the default build configuration was changed in V8 version 10.8. The maintainer for the Arch v8-r package that I am building against was not enabling it until the latest release, 11.4.71, so I haven't had an issue until now. I can fix it on my end with this patch, but I think it should probably be in an if block depending on the v8 version being used.

--- a/src/cbang/js/v8/V8.h      2023-04-12 13:01:26.846888687 -0400
+++ b/src/cbang/js/v8/V8.h      2023-04-12 13:02:23.030223080 -0400
@@ -41,5 +41,6 @@
 #define V8STDINT_H_

 #define V8_ENABLE_CHECKS
+#define V8_ENABLE_SANDBOX

 #include <v8.h>

I haven't done extensive testing, just built and ran the camotics.tpl simulation in CAMotics, and that worked.

@jcoffland
Copy link
Member

You could also just add this to your ccflags when building.

@jcoffland jcoffland changed the title V8 sandbox default change in version > 10.8 V8_ENABLE_SANDBOX must be defined for default builds of v8 version > 10.8 Apr 13, 2023
@hpmachining
Copy link
Contributor Author

hpmachining commented Apr 13, 2023

I tried setting the cxxflags and was having issues. I’ll try again with the ccflags. Thank you.

EDIT: That didn't make any difference. For some reason, when that define is added to the build line, cbang isn't finding V8. For reference, here is my complete build line:
scons ccflags="-DV8_ENABLE_SANDBOX" cxxstd="c++17" disable_local="libevent sqlite3 re2 libyaml zlib bzip2 expat"

and here is from the build log:
Checking for C++ header file v8.h... no

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants