gurobokum / pyv8

Automatically exported from code.google.com/p/pyv8
0 stars 0 forks source link

Build failure: cannot allocate an object of abstract type error #144

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm running the following as instructed:
svn checkout http://v8.googlecode.com/svn/trunk/ v8
svn checkout http://pyv8.googlecode.com/svn/trunk/ pyv8
export V8_HOME=/home/user/v8
cd pyv8
python setup.py build

The build fails during the pyv8 part (v8 itself builds just fine):

In file included from src/Engine.cpp:12:0:
src/AST.h: In member function ‘const string CAstNode::ToString() const’:
src/AST.h:170:70: error: cannot allocate an object of abstract type 
‘v8::internal::PrettyPrinter’
In file included from src/AST.h:21:0,
                 from src/Engine.cpp:12:
src/PrettyPrinter.h:8:7: note:   because the following virtual functions are 
pure within ‘v8::internal::PrettyPrinter’:
In file included from /home/rj45/Software/v8/src/scopes.h:31:0,
                 from src/V8Internal.h:10,
                 from src/Engine.cpp:5:
/home/rj45/Software/v8/src/ast.h:2499:16: note:         virtual void 
v8::internal::AstVisitor::Visit(v8::internal::AstNode*)
In file included from src/Engine.cpp:12:0:
src/AST.h: In member function ‘const string CAstFunctionLiteral::ToAST() 
const’:
src/AST.h:688:64: error: cannot allocate an object of abstract type 
‘v8::internal::AstPrinter’
In file included from src/AST.h:21:0,
                 from src/Engine.cpp:12:
src/PrettyPrinter.h:50:7: note:   because the following virtual functions are 
pure within ‘v8::internal::AstPrinter’:
In file included from /home/rj45/Software/v8/src/scopes.h:31:0,
                 from src/V8Internal.h:10,
                 from src/Engine.cpp:5:
/home/rj45/Software/v8/src/ast.h:2499:16: note:         virtual void 
v8::internal::AstVisitor::Visit(v8::internal::AstNode*)
In file included from src/Engine.cpp:12:0:
src/AST.h: In member function ‘const string CAstFunctionLiteral::ToJSON() 
const’:
src/AST.h:689:69: error: cannot allocate an object of abstract type 
‘v8::internal::JsonAstBuilder’
In file included from src/AST.h:21:0,
                 from src/Engine.cpp:12:
src/PrettyPrinter.h:91:7: note:   because the following virtual functions are 
pure within ‘v8::internal::JsonAstBuilder’:
In file included from /home/rj45/Software/v8/src/scopes.h:31:0,
                 from src/V8Internal.h:10,
                 from src/Engine.cpp:5:
/home/rj45/Software/v8/src/ast.h:2499:16: note:         virtual void 
v8::internal::AstVisitor::Visit(v8::internal::AstNode*)
In file included from src/Engine.cpp:12:0:
src/AST.h: In member function ‘void 
CAstNode::Visit(boost::python::api::object)’:
src/AST.h:821:70: error: cannot allocate an object of abstract type 
‘CAstVisitor’
src/AST.h:704:7: note:   because the following virtual functions are pure 
within ‘CAstVisitor’:
In file included from /home/rj45/Software/v8/src/scopes.h:31:0,
                 from src/V8Internal.h:10,
                 from src/Engine.cpp:5:
/home/rj45/Software/v8/src/ast.h:2499:16: note:         virtual void 
v8::internal::AstVisitor::Visit(v8::internal::AstNode*)
src/Engine.cpp: In static member function ‘static v8::Handle<v8::Value> 
CPythonExtension::CallStub(const v8::Arguments&)’:
src/Engine.cpp:568:82: warning: ‘static void* 
v8::External::Unwrap(v8::Handle<v8::Value>)’ is deprecated (declared at 
/home/rj45/Software/v8/include/v8.h:4747) [-Wdeprecated-declarations]
In file included from src/Engine.cpp:12:0:
src/AST.h: In instantiation of ‘boost::python::list 
to_python(v8::internal::ZoneList<T*>*) [with T = v8::internal::Declaration]’:
src/AST.h:108:82:   required from here
src/AST.h:758:21: error: cannot declare variable ‘collector’ to be of 
abstract type ‘CAstListCollector’
src/AST.h:744:8: note:   because the following virtual functions are pure 
within ‘CAstListCollector’:
In file included from /home/rj45/Software/v8/src/scopes.h:31:0,
                 from src/V8Internal.h:10,
                 from src/Engine.cpp:5:
/home/rj45/Software/v8/src/ast.h:2499:16: note:         virtual void 
v8::internal::AstVisitor::Visit(v8::internal::AstNode*)
In file included from src/Engine.cpp:12:0:
src/AST.h: In instantiation of ‘boost::python::list 
to_python(v8::internal::ZoneList<T*>*) [with T = v8::internal::Statement]’:
src/AST.h:209:81:   required from here
src/AST.h:758:21: error: cannot declare variable ‘collector’ to be of 
abstract type ‘CAstListCollector’
src/AST.h:744:8: note:   since type ‘CAstListCollector’ has pure virtual 
functions
src/AST.h: In instantiation of ‘boost::python::api::object to_python(T*) 
[with T = v8::internal::FunctionLiteral]’:
src/AST.h:235:93:   required from here
src/AST.h:737:23: error: cannot declare variable ‘collector’ to be of 
abstract type ‘CAstObjectCollector’
src/AST.h:723:8: note:   because the following virtual functions are pure 
within ‘CAstObjectCollector’:
In file included from /home/rj45/Software/v8/src/scopes.h:31:0,
                 from src/V8Internal.h:10,
                 from src/Engine.cpp:5:
/home/rj45/Software/v8/src/ast.h:2499:16: note:         virtual void 
v8::internal::AstVisitor::Visit(v8::internal::AstNode*)
In file included from src/Engine.cpp:12:0:
src/AST.h: In instantiation of ‘boost::python::api::object to_python(T*) 
[with T = v8::internal::Block]’:
src/AST.h:249:85:   required from here
src/AST.h:737:23: error: cannot declare variable ‘collector’ to be of 
abstract type ‘CAstObjectCollector’
src/AST.h:723:8: note:   since type ‘CAstObjectCollector’ has pure virtual 
functions
src/AST.h: In instantiation of ‘boost::python::api::object to_python(T*) 
[with T = v8::internal::VariableProxy]’:
src/AST.h:257:88:   required from here
src/AST.h:737:23: error: cannot declare variable ‘collector’ to be of 
abstract type ‘CAstObjectCollector’
src/AST.h:723:8: note:   since type ‘CAstObjectCollector’ has pure virtual 
functions
src/AST.h: In instantiation of ‘boost::python::api::object to_python(T*) 
[with T = v8::internal::Module]’:
src/AST.h:265:86:   required from here
src/AST.h:737:23: error: cannot declare variable ‘collector’ to be of 
abstract type ‘CAstObjectCollector’
src/AST.h:723:8: note:   since type ‘CAstObjectCollector’ has pure virtual 
functions
src/AST.h: In instantiation of ‘boost::python::api::object to_python(T*) 
[with T = v8::internal::Statement]’:
src/AST.h:314:90:   required from here
src/AST.h:737:23: error: cannot declare variable ‘collector’ to be of 
abstract type ‘CAstObjectCollector’
src/AST.h:723:8: note:   since type ‘CAstObjectCollector’ has pure virtual 
functions
src/AST.h: In instantiation of ‘boost::python::api::object to_python(T*) 
[with T = v8::internal::Expression]’:
src/AST.h:324:93:   required from here
src/AST.h:737:23: error: cannot declare variable ‘collector’ to be of 
abstract type ‘CAstObjectCollector’
src/AST.h:723:8: note:   since type ‘CAstObjectCollector’ has pure virtual 
functions
src/AST.h: In instantiation of ‘boost::python::api::object to_python(T*) 
[with T = v8::internal::IterationStatement]’:
src/AST.h:375:93:   required from here
src/AST.h:737:23: error: cannot declare variable ‘collector’ to be of 
abstract type ‘CAstObjectCollector’
src/AST.h:723:8: note:   since type ‘CAstObjectCollector’ has pure virtual 
functions
src/AST.h: In instantiation of ‘boost::python::api::object to_python(T*) 
[with T = v8::internal::BreakableStatement]’:
src/AST.h:383:90:   required from here
src/AST.h:737:23: error: cannot declare variable ‘collector’ to be of 
abstract type ‘CAstObjectCollector’
src/AST.h:723:8: note:   since type ‘CAstObjectCollector’ has pure virtual 
functions
src/AST.h: In instantiation of ‘boost::python::api::object to_python(T*) 
[with T = v8::internal::Literal]’:
src/AST.h:511:59:   required from here
src/AST.h:737:23: error: cannot declare variable ‘collector’ to be of 
abstract type ‘CAstObjectCollector’
src/AST.h:723:8: note:   since type ‘CAstObjectCollector’ has pure virtual 
functions
src/AST.h: In instantiation of ‘boost::python::list 
to_python(v8::internal::ZoneList<T*>*) [with T = v8::internal::Expression]’:
src/AST.h:540:86:   required from here
src/AST.h:758:21: error: cannot declare variable ‘collector’ to be of 
abstract type ‘CAstListCollector’
src/AST.h:744:8: note:   since type ‘CAstListCollector’ has pure virtual 
functions
error: command 'gcc' failed with exit status 1

Original issue reported on code.google.com by rsimmo...@gmail.com on 6 Dec 2012 at 10:40

GoogleCodeExporter commented 9 years ago
I'm using a flavor of ubuntu 12.10 with python 2.7.3.

What's causing this issue?

Original comment by rsimmo...@gmail.com on 6 Dec 2012 at 10:42

GoogleCodeExporter commented 9 years ago
This issue is being caused by the current revision of v8.  The workaround to 
fix this problem is to checkout r13134 of v8.  Additionally, make sure to 
comment out line 448 in pyv8/setup.py so that pyv8 does not update the v8 code:
#self.checkout_v8()

Original comment by rsimmo...@gmail.com on 7 Dec 2012 at 4:38

GoogleCodeExporter commented 9 years ago
I've got the same problem. In order to build PyV8, I follow this guide: 
http://andrewwilkinson.wordpress.com/2012/01/23/integrating-python-and-javascrip
t-with-pyv8/ I've checkedout the r13134 of v8, as you suggested here, but it 
doesn't work! Any suggestions?

Original comment by gilberto...@gmail.com on 8 Dec 2012 at 2:53

GoogleCodeExporter commented 9 years ago
Did you comment out self.checkout_v8() ? If not, then you will update v8 to the 
new non-working version before building pyv8.

Original comment by rsimmo...@gmail.com on 8 Dec 2012 at 6:24

GoogleCodeExporter commented 9 years ago
Yes, I've commented self.checkout_v8() in setup.py (in pyv8 source code).

Original comment by gilberto...@gmail.com on 8 Dec 2012 at 6:28

GoogleCodeExporter commented 9 years ago
Ah.  Perhaps don't follow those directions.  Do the following:
svn checkout http://v8.googlecode.com/svn/trunk/@13134 v8
svn checkout http://pyv8.googlecode.com/svn/trunk/ pyv8
Comment out line 448 of pyv8/setup.py: #self.checkout_v8()
export V8_HOME=/path/to/v8
cd pyv8
python setup.py build
sudo python setup.py install

Original comment by rsimmo...@gmail.com on 8 Dec 2012 at 6:28

GoogleCodeExporter commented 9 years ago
Now it works. I suppose the error was in "export PyV8=`pwd`" command. Thank you 
for helping me.

Original comment by gilberto...@gmail.com on 8 Dec 2012 at 6:45

GoogleCodeExporter commented 9 years ago
I just attempted to build today and experienced this issue.  The easiest 
solution I found, given the current v8 code base is to have setup.py checkout 
r13261 of v8.  If you set V8_SVN_REVISION to 13261, everything seems to work 
just fine.

It looks like r13262 was a fairly large change, and the most recent culprit for 
these errors.

Original comment by artlo...@gmail.com on 24 Dec 2012 at 7:27

GoogleCodeExporter commented 9 years ago

Original comment by flier...@gmail.com on 26 Dec 2012 at 7:28

GoogleCodeExporter commented 9 years ago
Why does pyv8 require its own private copy of v8 to build against?  Can't it be 
set to build against an installed version of v8 already on the system?

Original comment by rsimmo...@gmail.com on 26 Dec 2012 at 6:26

GoogleCodeExporter commented 9 years ago
v8 disabled C++ exception and RTTI by default, but boost::python need it 

Original comment by flier...@gmail.com on 27 Dec 2012 at 1:49

GoogleCodeExporter commented 9 years ago
I want to continue this, but on the group list.  This is offtopic for this 
issue report:
https://groups.google.com/forum/?fromgroups=#!topic/pyv8/kp9mM4BZwDY

Original comment by rsimmo...@gmail.com on 27 Dec 2012 at 2:10

GoogleCodeExporter commented 9 years ago
Please verify it with SVN trunk code after r459, thanks

Original comment by flier...@gmail.com on 31 Dec 2012 at 3:50

GoogleCodeExporter commented 9 years ago
I've just been able to build successfully on Mac OS.  Thanks for the fix!

Original comment by artlo...@gmail.com on 4 Jan 2013 at 6:29

GoogleCodeExporter commented 9 years ago

Original comment by flier...@gmail.com on 7 Jan 2013 at 3:06