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

Add support for Python 3.8 and Upgrade Cython #594

Merged
merged 1 commit into from
Feb 14, 2021
Merged

Add support for Python 3.8 and Upgrade Cython #594

merged 1 commit into from
Feb 14, 2021

Conversation

gmjosack
Copy link
Contributor

Fixes: #546

Had to include harfbuzz manually as newer Pango change this.
See:
eiskaltdcpp/eiskaltdcpp#413
https://gitlab.gnome.org/GNOME/pango/-/issues/387

Also had to add -Wno-deprecated-declarations to get this to compile because
of the following errors that didn't seem to be coming from this code directly:

warning: ‘GTimeVal’ is deprecated: Use 'GDateTime' instead
warning: ‘GTypeDebugFlags’ is deprecated

Fixes: #546

Had to include harfbuzz manually as newer Pango change this.
See:
    eiskaltdcpp/eiskaltdcpp#413
    https://gitlab.gnome.org/GNOME/pango/-/issues/387

Also had to add `-Wno-deprecated-declarations` to get this to compile because
of the following errors that didn't seem to be coming from this code directly:

    warning: ‘GTimeVal’ is deprecated: Use 'GDateTime' instead
    warning: ‘GTypeDebugFlags’ is deprecated
@cztomczak
Copy link
Owner

What code was causing these warnings?

@gmjosack
Copy link
Contributor Author

As far as I could tell its an interaction between gtk and glib. I'm building on Ubuntu 18.04.

building 'cefpython_py38' extension
creating build
creating build/temp.linux-x86_64-3.8
g++ -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/gary/dev/spelunky.fyi/cefpython/src/linux -I/home/gary/dev/spelunky.fyi/cefpython/src -I/home/gary/dev/spelunky.fyi/cefpython/src/common -I/home/gary/dev/spelunky.fyi/cefpython/src/extern -I/home/gary/dev/spelunky.fyi/cefpython/src/extern/cef -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/include/gtk-unix-print-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/atk-1.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/lib/x86_64-linux-gnu/gtk-unix-print-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/lib/i386-linux-gnu/gtk-2.0/include -I/usr/lib/i386-linux-gnu/gtk-unix-print-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/lib64/gtk-2.0/include -I/usr/lib64/gtk-unix-print-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib/gtk-2.0/include -I/usr/lib/gtk-2.0/gtk-unix-print-2.0 -I/usr/lib/glib-2.0/include -I/home/gary/.local/python-venvs/cefpython/include -I/usr/include/python3.8 -c cefpython_py38.cpp -o build/temp.linux-x86_64-3.8/cefpython_py38.o -O3 -DNDEBUG -std=gnu++11 -std=gnu++11 -flto -fdata-sections -ffunction-sections
In file included from /usr/include/gtk-2.0/gtk/gtkobject.h:37,
                 from /usr/include/gtk-2.0/gtk/gtkwidget.h:36,
                 from /usr/include/gtk-2.0/gtk/gtkcontainer.h:35,
                 from /usr/include/gtk-2.0/gtk/gtkbin.h:35,
                 from /usr/include/gtk-2.0/gtk/gtkwindow.h:36,
                 from /usr/include/gtk-2.0/gtk/gtkdialog.h:35,
                 from /usr/include/gtk-2.0/gtk/gtkaboutdialog.h:32,
                 from /usr/include/gtk-2.0/gtk/gtk.h:33,
                 from cefpython_py38.cpp:648:
/usr/include/gtk-2.0/gtk/gtktypeutils.h:236:64: warning: ‘GTypeDebugFlags’ is deprecated [-Wdeprecated-declarations]
  236 | void            gtk_type_init   (GTypeDebugFlags    debug_flags);
      |                                                                ^
In file included from /usr/include/glib-2.0/gobject/gobject.h:24,
                 from /usr/include/glib-2.0/gobject/gbinding.h:29,
                 from /usr/include/glib-2.0/glib-object.h:22,
                 from /usr/include/glib-2.0/gio/gioenums.h:28,
                 from /usr/include/glib-2.0/gio/giotypes.h:28,
                 from /usr/include/glib-2.0/gio/gio.h:26,
                 from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
                 from /usr/include/gtk-2.0/gdk/gdk.h:32,
                 from /usr/include/gtk-2.0/gtk/gtk.h:32,
                 from cefpython_py38.cpp:648:
/usr/include/glib-2.0/gobject/gtype.h:685:3: note: declared here
  685 | } GTypeDebugFlags GLIB_DEPRECATED_TYPE_IN_2_36;
      |   ^~~~~~~~~~~~~~~
In file included from /usr/include/gtk-2.0/gtk/gtktoolitem.h:31,
                 from /usr/include/gtk-2.0/gtk/gtktoolbutton.h:30,
                 from /usr/include/gtk-2.0/gtk/gtkmenutoolbutton.h:30,
                 from /usr/include/gtk-2.0/gtk/gtk.h:126,
                 from cefpython_py38.cpp:648:
/usr/include/gtk-2.0/gtk/gtktooltips.h:73:12: warning: ‘GTimeVal’ is deprecated: Use 'GDateTime' instead [-Wdeprecated-declarations]
   73 |   GTimeVal last_popdown;
      |            ^~~~~~~~~~~~
In file included from /usr/include/glib-2.0/glib/galloca.h:32,
                 from /usr/include/glib-2.0/glib.h:30,
                 from /usr/include/glib-2.0/gobject/gbinding.h:28,
                 from /usr/include/glib-2.0/glib-object.h:22,
                 from /usr/include/glib-2.0/gio/gioenums.h:28,
                 from /usr/include/glib-2.0/gio/giotypes.h:28,
                 from /usr/include/glib-2.0/gio/gio.h:26,
                 from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
                 from /usr/include/gtk-2.0/gdk/gdk.h:32,
                 from /usr/include/gtk-2.0/gtk/gtk.h:32,
                 from cefpython_py38.cpp:648:
/usr/include/glib-2.0/glib/gtypes.h:545:26: note: declared here
  545 | typedef struct _GTimeVal GTimeVal GLIB_DEPRECATED_TYPE_IN_2_62_FOR(GDateTime);
      |                          ^~~~~~~~

@cztomczak
Copy link
Owner

Have you tested Windows and Mac as well?

@gmjosack
Copy link
Contributor Author

I don't have access to a Windows or Mac computer unfortunately.

@thetestgame
Copy link

There been any news on this PR? Python 3.8 support is critical for our application currently.

@gmjosack
Copy link
Contributor Author

I don't have the ability to test this PR on windows or mac. if anyone does I'm sure the author would appreciate that and it would help get this merged.

@Berserker66
Copy link

I can test this on Windows, but may take a while as I have other priorities. I expect to be able to test this by 27th nov, if noone beats me to it.

@Berserker66
Copy link

Seems to work fine on windows. As I no longer have VS2017 I made a little edit to make it VS2019, the examples and our application run fine on windows.

@bryan-koroleski-fivestars
Copy link
Contributor

Got this working on Windows recently but I needed to make some tweaks.

From 6feba6ff75eadaba5e41fd670df835ada2e030d8 Mon Sep 17 00:00:00 2001
From: Bryan Koroleski <bryan.koroleski@fivestars.com>
Date: Thu, 21 Jan 2021 18:11:38 -0600
Subject: [PATCH] Fix 32-bit builds on Windows 10

---
 tools/cython_setup.py   | 1 +
 tools/make_installer.py | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/cython_setup.py b/tools/cython_setup.py
index 52482cb..600f5a1 100644
--- a/tools/cython_setup.py
+++ b/tools/cython_setup.py
@@ -147,6 +147,7 @@ def get_winsdk_lib():
     if WINDOWS:
         if ARCH32:
             winsdk_libs = [
+                r"C:\\Program Files (x86)\\Windows Kits\\10\\Lib",
                 r"C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Lib",
                 r"C:\\Program Files\\Microsoft SDKs\\Windows\\v7.0\\Lib",
                 # Visual Studio 2008 installation
diff --git a/tools/make_installer.py b/tools/make_installer.py
index bc3b5ce..717b82b 100644
--- a/tools/make_installer.py
+++ b/tools/make_installer.py
@@ -365,10 +365,11 @@ def copy_cpp_extension_dependencies_issue359(pkg_dir):
     # in the package. Thus if included, msvcpxx.dll dependency is
     # required as well.
 
-    # Python 3.5 / 3.6 / 3.7
+    # Python 3.5 / 3.6 / 3.7 / 3.8
     if os.path.exists(os.path.join(pkg_dir, "cefpython_py35.pyd")) \
             or os.path.exists(os.path.join(pkg_dir, "cefpython_py36.pyd")) \
-            or os.path.exists(os.path.join(pkg_dir, "cefpython_py37.pyd")):
+            or os.path.exists(os.path.join(pkg_dir, "cefpython_py37.pyd")) \
+            or os.path.exists(os.path.join(pkg_dir, "cefpython_py38.pyd")):
         search_paths = [
             # This is where Microsoft Visual C++ 2015 Update 3 installs
             # (14.00.24212).
-- 
2.30.0

@pixtoken
Copy link

Works for me on Ubuntu 20.10.

@cztomczak cztomczak merged commit 55e6360 into cztomczak:master Feb 14, 2021
@codingcatgirl
Copy link

I'm looking to add compatibility for python 3.8 or even 3.9 on linux. I just saw that this merge request added 3.8 compatibility for linux, but then the commit right after it removed it. (d6deaf8#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L214) – but why? Reading this thread sounds to me like it was tested under linux.

What possible issues would i need to solve to add 3.8 compatibility for linux?

@codingcatgirl
Copy link

@gmjosack maybe you know the answer to this?

@gmjosack
Copy link
Contributor Author

Sorry, I don't have any context on that commit but also don't really see anything in it that would imply linux support would have been removed. Is it just a documantation bug? I'm not currently using cefpython so can't provide any support there.

@codingcatgirl
Copy link

Well, the next release following it (66.1) made it clear that linux is not supported and put it on the roadmap (if enough people pay for it, i guess), also only wheels for windows were released, so it's definitely intentional.

@gmjosack
Copy link
Contributor Author

Ah, that's a shame. It definitely worked on linux as that was the only place i tested it :X

@codingcatgirl
Copy link

Well, cool. Guess i'll try to build it and if it works just… publish a wheel myself or something? I'm very confused right now as to what the reasoning here is.

@codingcatgirl
Copy link

Ah, i see. The -Wno-deprecated-declarations was removed again. Can you tell me where you added it so i don't have to look for it myself? :D

@codingcatgirl
Copy link

…duh i can just look at your diff. Lesson learned, time to go to bed.

linesight pushed a commit to linesight/cefpython that referenced this pull request Jan 28, 2024
Fixes: cztomczak#546

Had to include harfbuzz manually as newer Pango change this.
See:
    eiskaltdcpp/eiskaltdcpp#413
    https://gitlab.gnome.org/GNOME/pango/-/issues/387

Also had to add `-Wno-deprecated-declarations` to get this to compile because
of the following errors that didn't seem to be coming from this code directly:

    warning: ‘GTimeVal’ is deprecated: Use 'GDateTime' instead
    warning: ‘GTypeDebugFlags’ is deprecated
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

Successfully merging this pull request may close these issues.

Support Python 3.8
7 participants