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

Build error with Python-3.7.0-rc1 #193

Closed
sagitter opened this issue Jun 20, 2018 · 2 comments
Closed

Build error with Python-3.7.0-rc1 #193

sagitter opened this issue Jun 20, 2018 · 2 comments

Comments

@sagitter
Copy link

sagitter commented Jun 20, 2018

Hi all.

Recent recompilation of antimony by using Python-3.7 is failing with following error:

[  9%] Building CXX object lib/graph/CMakeFiles/SbGraph.dir/src/types/downstream.cpp.o
cd /builddir/build/BUILD/antimony-0.9.3/build/lib/graph && /usr/bin/c++   -isystem /usr/include/python3.7m -I/builddir/build/BUILD/antimony-0.9.3/lib/graph/inc  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -pie -DNDEBUG -DRELEASE   -std=gnu++11 -o CMakeFiles/SbGraph.dir/src/types/downstream.cpp.o -c /builddir/build/BUILD/antimony-0.9.3/lib/graph/src/types/downstream.cpp
/builddir/build/BUILD/antimony-0.9.3/lib/graph/src/util.cpp: In function 'std::pair<std::__cxx11::basic_string<char>, int> getPyError()':
/builddir/build/BUILD/antimony-0.9.3/lib/graph/src/util.cpp:50:35: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
         char* c = PyUnicode_AsUTF8(PyList_GetItem(lst, i));
                   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [lib/graph/CMakeFiles/SbGraph.dir/build.make:157: lib/graph/CMakeFiles/SbGraph.dir/src/util.cpp.o] Error 1

System: Fedora 29 (devel branch)
Antimony commit 020910c
Python 3.7.0-rc1
Full build log: https://koji.fedoraproject.org/koji/getfile?taskID=27751872&volume=DEFAULT&name=build.log

Please, take a look.

@sagitter sagitter changed the title Build error with Python-3.7 Build error with Python-3.7.0-rc1 Jun 22, 2018
@sagitter
Copy link
Author

Workaround for fixing temporarily this error (from Fedora developers):

--- app/viewport/render/instance.h.orig	2016-11-27 19:16:48.000000000 -0700
+++ app/viewport/render/instance.h	2018-06-28 14:44:06.985669560 -0600
@@ -1,6 +1,8 @@
 #pragma once
 
+#undef slots
 #include <Python.h>
+#define slots Q_SLOTS
 #include <QObject>
 
 #include "viewport/image.h"
--- lib/graph/src/util.cpp.orig	2016-11-27 19:16:48.000000000 -0700
+++ lib/graph/src/util.cpp	2018-06-28 14:19:57.332549621 -0600
@@ -47,7 +47,7 @@ std::pair<std::string, int> getPyError()
     error_traceback = "";
     for (int i=0; i < PyList_Size(lst); ++i)
     {
-        char* c = PyUnicode_AsUTF8(PyList_GetItem(lst, i));
+        const char* c = PyUnicode_AsUTF8(PyList_GetItem(lst, i));
         assert(!PyErr_Occurred());
         error_traceback += std::string(c);
     }

@mkeeter
Copy link
Owner

mkeeter commented Jun 29, 2018

Thanks for the reminder, that fix looks good to me.

@mkeeter mkeeter closed this as completed Jun 29, 2018
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

No branches or pull requests

2 participants