ironm73 / pyv8

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

Make pyv8 more modular #149

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Rather than patching and building v8 inside setup.py, can you please provide a 
set of patches to v8 in unified diff format that one can apply to v8 before 
building it so that it conforms to what boost and pyv8 need?

Also, give an option of disabling the private build of v8.  When it's disabled, 
you would assume that the person has already built and installed v8 to 
/usr/local on their system using the unified diff patches requested above.

This way the pyv8 build process can be decoupled from the v8 build process.  
That way you can have each piece build as discreet parts that can then become 
packages in a package management system (in my case FreeBSD ports).

Ultimately, the patching that you apply to v8 should just become make options 
in v8 itself such as "rtti=on" and "exceptions=on" and "runtimetypeinfo=on"

Original issue reported on code.google.com by rsimmo...@gmail.com on 10 Jan 2013 at 11:04

GoogleCodeExporter commented 8 years ago
Here is a patch that I've created from the search and replace that setup.py 
does to v8's code.  I cleaned it up a bit so there are only needed changes.

--- standalone.gypi.bak 2013-01-10 23:22:36.000000000 -0500
+++ standalone.gypi 2013-01-11 13:04:02.000000000 -0500
@@ -94,8 +94,7 @@
        or OS=="netbsd"', {
       'target_defaults': {
         'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
-                    '-Wnon-virtual-dtor', '-pthread', '-fno-rtti',
-                    '-fno-exceptions', '-pedantic' ],
+                    '-Wnon-virtual-dtor', '-pthread', '-pedantic' ],
         'ldflags': [ '-pthread', ],
         'conditions': [
           [ 'OS=="linux"', {
@@ -132,7 +131,7 @@
             'MinimalRebuild': 'false',
             'BufferSecurityCheck': 'true',
             'EnableFunctionLevelLinking': 'true',
-            'RuntimeTypeInfo': 'false',
+            'RuntimeTypeInfo': 'true',
             'WarningLevel': '3',
             'WarnAsError': 'true',
             'DebugInformationFormat': '3',
@@ -144,7 +143,7 @@
               ['component=="shared_library"', {
                 'ExceptionHandling': '1',  # /EHsc
               }, {
-                'ExceptionHandling': '0',
+                'ExceptionHandling': '1',
               }],
             ],
           },
@@ -184,8 +183,8 @@
           'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks
           'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic
                                                     # (Equivalent to -fPIC)
-          'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions
-          'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti
+          'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',       # -fno-exceptions
+          'GCC_ENABLE_CPP_RTTI': 'YES',             # -fno-rtti
           'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings
           # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
           'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',

Original comment by rsimmo...@gmail.com on 11 Jan 2013 at 6:07

GoogleCodeExporter commented 8 years ago
I have gone ahead and submitted patches to the v8 project that add build 
options for rtti=on and exceptions=on which are both required by pyv8 via 
boost-python.

If these patches are accepted, there will be no need to patch the v8 source 
tree in setup.py.  I will submit the patches to make this change to pyv8 if the 
other patches are accepted into v8.

This will bring pyv8 halfway to decoupling the build of pyv8 from v8 if the 
user wants to.  The next step is to add an option --skip-v8-build that skips 
the private v8 build completely.

The patches that I submitted to v8 are in the following defect report:
http://code.google.com/p/v8/issues/detail?id=2482

Original comment by rsimmo...@gmail.com on 12 Jan 2013 at 8:57

GoogleCodeExporter commented 8 years ago

Original comment by flier...@gmail.com on 13 Jan 2013 at 3:35

GoogleCodeExporter commented 8 years ago
I have added a `v8build` command, which use the standalone build process 
without private v8 build, you could just use `python setup.py v8build` to build 
pyv8 with preinstalled v8 and boost.

For the diff file, I think if v8 team could add some options will be better, 
thanks for your suggestion and patches :)

Original comment by flier...@gmail.com on 15 Jan 2013 at 4:43