rdmenezes / cefpython

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

Update Cython to version 0.20 #110

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
A thorough testing will be required, as version 0.20 breaks some things. While 
doing a quick testing, one issue was found so far.

Issue 1
-------

The Debug() function needs to accept both unicode and bytes strings. In version 
0.19.2 of Cython you could pass unicode string and it was converted 
automatically, but with the new version an error is throwed:

 TypeError: Expected str, got unicode

The Debug() function:
https://code.google.com/p/cefpython/source/browse/cefpython/utils.pyx?r=2f6f611c
2fcf#20

Called from CreateJavascriptCallback():
https://code.google.com/p/cefpython/source/browse/cefpython/javascript_callback_
cef3.pyx?r=2f6f611c2fcf

The functionName param was decoded from the cefpython IPC message using the 
json library, and the json library automatically converted the string to 
unicode.

There might be more places where unicode is passed and it would throw an error.

Original issue reported on code.google.com by czarek.t...@gmail.com on 17 Jan 2014 at 8:42

GoogleCodeExporter commented 9 years ago
Version 0.20 of Cython introduces C++ template functions that we could utilize. 
We already use some C++ template functions, but now it can be done in a more 
convenient way, the same way importing of C++ template classes work.

Original comment by czarek.t...@gmail.com on 17 Jan 2014 at 8:45

GoogleCodeExporter commented 9 years ago

Original comment by czarek.t...@gmail.com on 31 Jul 2014 at 8:41

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
New feature in Cython 0.21 that might come useful:
 * Enums can now be declared as cpdef to export their values to the module's Python namespace. Cpdef enums in pxd files export their values to their own module, iff it exists.

https://github.com/cython/cython/blob/c67e895414aac90dfe9f789530143cff5b2ec7ad/C
HANGES.rst#021-2014-09-10

Original comment by czarek.t...@gmail.com on 10 Sep 2014 at 5:02

GoogleCodeExporter commented 9 years ago
Another issue with Cython 0.20.1 reported here:
https://groups.google.com/d/topic/cefpython/z-bFvBOxTIU/discussion

Original comment by czarek.t...@gmail.com on 17 Dec 2014 at 6:27

GoogleCodeExporter commented 9 years ago
What's the situation with this? Is it still breaking with Cython 0.21? I'm 
thinking of switching to CEF3 from PySide and I'd hate to downgrade to Python 2.

Original comment by alex.gro...@nextday.fi on 7 Jan 2015 at 4:25

GoogleCodeExporter commented 9 years ago
@comment #6 alex.gronholm@nextday.fi
The unicode issue explained in comment #0 is a BC change in Cython, not a bug. 
So it still needs to be resolved whether this is 0.20 or 0.21 or any later 
version. So far there are two issues found. The other one reported in comment 
#5 (not yet sure the cause of it). The fixes to these issues is a matter of a 
few lines of code I think. But it still needs thorough testing to find out if 
there are any other issues. By testing I mean running the wxpython.py example 
and runnning all the tests manually (as there are no unit tests as of yet) on 
both Windows and Linux.

Original comment by czarek.t...@gmail.com on 7 Jan 2015 at 5:04

GoogleCodeExporter commented 9 years ago
I'm probably not qualified to fix the code, but I'm willing to test on both 
Linux and Windows. 

Original comment by alex.gro...@nextday.fi on 7 Jan 2015 at 5:08

GoogleCodeExporter commented 9 years ago
@#8 alex.gronholm@nextday.fi
Can you build it from sources on both Windows and Linux? If you can build it 
and test it, then I can provide fixes to the bugs you find. The latest Cython 
version is 0.21.2 and I think we should aim for updating to that version.

Original comment by czarek.t...@gmail.com on 7 Jan 2015 at 5:12

GoogleCodeExporter commented 9 years ago

Original comment by czarek.t...@gmail.com on 14 Jan 2015 at 6:37

GoogleCodeExporter commented 9 years ago
Ah, I didn't see your last message. Yeah, I'll give it a whirl when I can.

Original comment by alex.gro...@nextday.fi on 16 Jan 2015 at 11:27

GoogleCodeExporter commented 9 years ago
When I tried to compile CEF itself, I got an error:
% make -j4 BUILDTYPE=Release cefclient
...
  CXX(target) out/Release/obj.target/seccomp_bpf/sandbox/linux/seccomp-bpf/verifier.o
sandbox/linux/seccomp-bpf/sandbox_bpf.cc:53:6: error: ‘void 
{anonymous}::WriteFailedStderrSetupMessage(int)’ defined but not used 
[-Werror=unused-function]
 void WriteFailedStderrSetupMessage(int out_fd) {
      ^
cc1plus: all warnings being treated as errors
sandbox/seccomp_bpf.target.mk:222: recipe for target 
'out/Release/obj.target/seccomp_bpf/sandbox/linux/seccomp-bpf/sandbox_bpf.o' 
failed

Original comment by alex.gro...@nextday.fi on 17 Jan 2015 at 1:43

GoogleCodeExporter commented 9 years ago
So I tried the same with the precompiled cef-python binaries.
Ended up with this:
% LANG=en_US python compile.py
...
g++ -g -Wall -Werror -DRENDERER_PROCESS  -I./../ -I/usr/include/python2.7 
-I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/gtk-2.0/include 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/cairo 
-I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/atk-1.0 
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include 
-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/lib64/glib-2.0/include 
-I/usr/lib64/gtk-2.0/include -I/usr/lib/glib-2.0/include 
-I/usr/lib/gtk-2.0/include -L./../linux/setup/lib_64bit 
-L./../linux/setup/lib_32bit -L./../linux/binaries_64bit 
-L./../linux/binaries_32bit main.cpp cefpython_app.cpp \
        v8function_handler.cpp v8utils.cpp javascript_callback.cpp \
        -lcef_dll_wrapper -lcef -o subprocess -Wl,-rpath,.
./../linux/binaries_64bit/libcef_dll_wrapper.a: error adding symbols: Malformed 
archive
collect2: error: ld returned 1 exit status
Makefile:31: recipe for target 'subprocess' failed
make: *** [subprocess] Error 1
Traceback (most recent call last):
  File "compile.py", line 75, in <module>
    what = raw_input("make failed, press 'y' to continue, 'n' to stop: ")
NameError: name 'raw_input' is not defined

Note the use of raw_input in compile.py which shouldn't be there since there 
raw_input() has been replaced with input() in Python 3.

Original comment by alex.gro...@nextday.fi on 17 Jan 2015 at 2:55

GoogleCodeExporter commented 9 years ago
One more thing -- why does cefpython/cpp_utils/Makefile statically point to 
Python 2.7? I don't think that can work if you intend to build it with other 
Python versions.

Original comment by alex.gro...@nextday.fi on 17 Jan 2015 at 3:14

GoogleCodeExporter commented 9 years ago
@Alex Please report compile problems and ask questions on the Forum.

Original comment by czarek.t...@gmail.com on 17 Jan 2015 at 4:15