V8 Build broken with latest release #333

Closed
beachwalker opened this Issue Jul 5, 2013 · 15 comments

Comments

Projects
None yet
6 participants
Contributor

beachwalker commented Jul 5, 2013

I used trunk revision 13387 of v8 which builds fine (it is not the latest trunk update).
But the latest trunk does not compile, it seems the api of v8 has changed. Also the latest tagged release (3.19) does not compile.

Which version of v8 should we use? It is not mentioned in the docs (or I missed that point).

jefferey was assigned Jul 8, 2013

FYI osgEarth-2.4 builds with v8-3.18.5.14 and fails with v8-3.19.18.19

The build error with v8-3.19.18.19:

[1/3] Building CXX object src/osgEarthDrivers/script_engine_v8/CMakeFiles/osgdb_osgearth_scriptengine_javascript.dir/JavascriptEngineV8.cpp.o
FAILED: /usr/lib/ccache/bin/c++ -DOSGEARTH_HAVE_MINIZIP -Dosgdb_osgearth_scriptengine_javascript_EXPORTS -O3 -DNDEBUG -fPIC -I/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src -MMD -MT src/osgEarthDrivers/script_engine_v8/CMakeFiles/osgdb_osgearth_scriptengine_javascript.dir/JavascriptEngineV8.cpp.o -MF "src/osgEarthDrivers/script_engine_v8/CMakeFiles/osgdb_osgearth_scriptengine_javascript.dir/JavascriptEngineV8.cpp.o.d" -o src/osgEarthDrivers/script_engine_v8/CMakeFiles/osgdb_osgearth_scriptengine_javascript.dir/JavascriptEngineV8.cpp.o -c /home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp: In constructor ‘JavascriptEngineV8::JavascriptEngineV8(const osgEarth::Features::ScriptEngineOptions&)’:
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:50:51: warning: ‘static v8::Persistentv8::Context v8::Context::New(v8::ExtensionConfiguration_, v8::Handlev8::ObjectTemplate, v8::Handlev8::Value)’ is deprecated (declared at /usr/include/v8.h:4849) [-Wdeprecated-declarations]
/usr/include/v8.h:752:53: error: ‘v8::Persistent& v8::Persistent::operator=(const v8::Persistent&) [with T = v8::Context, v8::Persistent = v8::Persistentv8::Context]’ is private
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:50:51: error: within this context
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:58:52: error: no matching function for call to ‘v8::Context::Scope::Scope(v8::Persistentv8::Context&)’
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:58:52: note: candidates are:
/usr/include/v8.h:4970:43: note: v8::Context::Scope::Scope(v8::Isolate_, v8::Persistentv8::Context&)
/usr/include/v8.h:4970:43: note: candidate expects 2 arguments, 1 provided
/usr/include/v8.h:4966:52: note: v8::Context::Scope::Scope(v8::Handlev8::Context)
/usr/include/v8.h:4966:52: note: no known conversion for argument 1 from ‘v8::Persistentv8::Context’ to ‘v8::Handlev8::Context’
/usr/include/v8.h:4964:9: note: v8::Context::Scope::Scope(const v8::Context::Scope&)
/usr/include/v8.h:4964:9: note: no known conversion for argument 1 from ‘v8::Persistentv8::Context’ to ‘const v8::Context::Scope&’
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:66:67: error: no matching function for call to ‘v8::Persistentv8::ObjectTemplate::New(v8::Handlev8::ObjectTemplate&)’
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:66:67: note: candidate is:
/usr/include/v8.h:5508:4: note: static T* v8::Persistent::New(v8::Isolate_, T_) [with T = v8::ObjectTemplate]
/usr/include/v8.h:5508:4: note: candidate expects 2 arguments, 1 provided
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp: In member function ‘virtual osgEarth::Features::ScriptResult JavascriptEngineV8::run(const string&, const osgEarth::Features::Feature_, const osgEarth::Features::FilterContext_)’:
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:186:50: error: no matching function for call to ‘v8::Context::Scope::Scope(v8::Persistentv8::Context&)’
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:186:50: note: candidates are:
/usr/include/v8.h:4970:43: note: v8::Context::Scope::Scope(v8::Isolate_, v8::Persistentv8::Context&)
/usr/include/v8.h:4970:43: note: candidate expects 2 arguments, 1 provided
/usr/include/v8.h:4966:52: note: v8::Context::Scope::Scope(v8::Handlev8::Context)
/usr/include/v8.h:4966:52: note: no known conversion for argument 1 from ‘v8::Persistentv8::Context’ to ‘v8::Handlev8::Context’
/usr/include/v8.h:4964:9: note: v8::Context::Scope::Scope(const v8::Context::Scope&)
/usr/include/v8.h:4964:9: note: no known conversion for argument 1 from ‘v8::Persistentv8::Context’ to ‘const v8::Context::Scope&’
/usr/include/v8.h:770:44: error: ‘T_ v8::Persistent::operator->() const [with T = v8::Context]’ is private
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:192:21: error: within this context
/usr/include/v8.h:770:44: error: ‘T* v8::Persistent::operator->() const [with T = v8::Context]’ is private
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:199:21: error: within this context
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp: In member function ‘virtual osgEarth::Features::ScriptResult JavascriptEngineV8::call(const string&, const osgEarth::Features::Feature_, const osgEarth::Features::FilterContext_)’:
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:222:50: error: no matching function for call to ‘v8::Context::Scope::Scope(v8::Persistentv8::Context&)’
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:222:50: note: candidates are:
/usr/include/v8.h:4970:43: note: v8::Context::Scope::Scope(v8::Isolate_, v8::Persistentv8::Context&)
/usr/include/v8.h:4970:43: note: candidate expects 2 arguments, 1 provided
/usr/include/v8.h:4966:52: note: v8::Context::Scope::Scope(v8::Handlev8::Context)
/usr/include/v8.h:4966:52: note: no known conversion for argument 1 from ‘v8::Persistentv8::Context’ to ‘v8::Handlev8::Context’
/usr/include/v8.h:4964:9: note: v8::Context::Scope::Scope(const v8::Context::Scope&)
/usr/include/v8.h:4964:9: note: no known conversion for argument 1 from ‘v8::Persistentv8::Context’ to ‘const v8::Context::Scope&’
/usr/include/v8.h:770:44: error: ‘T_ v8::Persistent::operator->() const [with T = v8::Context]’ is private
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:226:50: error: within this context
/usr/include/v8.h:770:44: error: ‘T* v8::Persistent::operator->() const [with T = v8::Context]’ is private
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:238:21: error: within this context
/usr/include/v8.h:770:44: error: ‘T* v8::Persistent::operator->() const [with T = v8::Context]’ is private
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:245:21: error: within this context
/usr/include/v8.h:770:44: error: ‘T* v8::Persistent::operator->() const [with T = v8::Context]’ is private
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:255:64: error: within this context
/usr/include/v8.h: In static member function ‘static v8::Handlev8::Value JavascriptEngineV8::constructVec3dCallback(const v8::Arguments&)’:
/usr/include/v8.h:447:60: error: ‘v8::Local::Local(S_) [with S = v8::Object, T = v8::Object]’ is private
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:333:59: error: within this context
/usr/include/v8.h: In static member function ‘static v8::Handlev8::Value JavascriptEngineV8::constructGeoExtentCallback(const v8::Arguments&)’:
/usr/include/v8.h:447:60: error: ‘v8::Local::Local(S_) [with S = v8::Object, T = v8::Object]’ is private
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:364:59: error: within this context
/usr/include/v8.h:447:60: error: ‘v8::Local::Local(S_) [with S = v8::Object, T = v8::Object]’ is private
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:380:60: error: within this context
/usr/include/v8.h:447:60: error: ‘v8::Local::Local(S_) [with S = v8::Object, T = v8::Object]’ is private
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:381:60: error: within this context
/usr/include/v8.h:447:60: error: ‘v8::Local::Local(S*) [with S = v8::Object, T = v8::Object]’ is private
/home/cstankevitz/Work/2013-07-02_osgearth/osgearth/src/osgEarthDrivers/script_engine_v8/JavascriptEngineV8.cpp:392:59: error: within this context
ninja: build stopped: subcommand failed.

FYI... V8 changing their API is a PITA for everyone. Gentoo is going to deal with this by "bundling" with osgEarth the version of V8 that osgEarth was meant to use... vs. trying to use the system-installed version.

See

https://bugs.gentoo.org/show_bug.cgi?id=484786

and

http://gentoo.2317880.n4.nabble.com/does-v8-shared-library-make-sense-with-current-upstream-approach-td269644.html

Gentoo is going to deal with this by "bundling" with osgEarth the version of V8 that osgEarth was meant to use

I maintain osgearth in gentoo and I am not sure about that.

Contributor

remoe commented Oct 11, 2013

mongodb on gentoo has the same issue http://goo.gl/ly6dgx . Embedding v8 in projects is not optimal from the point of view of the security.

hasufell commented Nov 3, 2013

this is what's going to happen in gentoo:
once the remaining working v8 version get's removed due to security problems or whatever, osgearth will be removed as well, unless upstream provides a bundled version

Owner

gwaldron commented Nov 4, 2013

FYI, osgEarth using the new V8 API is on topic-v8-upgrade branch. We have no plans to bundle.

Contributor

remoe commented Nov 4, 2013

I've tried today this topic-v8-upgrade with new v8 engine on Windows-32. I used this version:

3.22.24

svn checkout http://v8.googlecode.com/svn/trunk/ v8

I have this issue:

JSWrappers.cpp
5>..\..\..\..\src\osgEarthDrivers\script_engine_v8\JavascriptEngineV8.cpp(47): error C2248: 'v8::HandleScope::HandleScope' : cannot access private member declared in class 'v8::HandleScope'
5>         trunk_4_11_13/inc\v8.h(768) : see declaration of 'v8::HandleScope::HandleScope'
5>         trunk_4_11_13/inc\v8.h(743) : see declaration of 'v8::HandleScope'

@jefferey, I found this: https://code.google.com/p/v8/issues/detail?id=2487

Contributor

jefferey commented Nov 4, 2013

This issue should be fixed now. Test and alert us if you find otherwise.

Owner

gwaldron commented Nov 4, 2013

FYI, plan is to keep osgEarth versions (in this case 2.5) in sync with a forked v8 repo, now found here:

https://github.com/pelicanmapping/v8/releases/tag/osgearth-2.5

gwaldron closed this Nov 4, 2013

FYI, plan is to keep osgEarth versions (in this case 2.5) in sync with a forked v8 repo, now found here:

Does that mean a packager would have to effectively package the forked v8 repo as well? We can't really keep our main v8 package in sync with osgearth... and having two in one repository is too much hassle for me.

Owner

gwaldron commented Nov 21, 2013

We don't intend to make any modifications to V8, if that's what you mean. The fork is really just a convenience so we can make our own tags so we know exactly what we were testing against.

Is it feasible to run osgearth without v8? If so, I can add a WITH_V8 cmake flag for the build and associated "#ifdef WITH_V8" preprocessor directives.

Owner

gwaldron commented Nov 21, 2013

Yes, it's completely optional. Just leave it out of the CMake configuration. No ifdef's required.

Glenn: that's great.

hasufell: you might want to modify the ebuild to exclude V8 and call it done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment