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 is broken with python3 #825

Closed
rumpelsepp opened this issue Jul 19, 2016 · 3 comments
Closed

Build is broken with python3 #825

rumpelsepp opened this issue Jul 19, 2016 · 3 comments

Comments

@rumpelsepp
Copy link

I know that only python2 is supported right know. On arch linux python3 is the default, /usr/bin/python. How can I build profinity under that circumstances?

In file included from /usr/include/string.h:630:0,
                 from /usr/include/python3.5m/Python.h:30,
                 from src/plugins/python_plugins.c:35:
src/plugins/python_plugins.c: In function ‘python_pre_chat_message_display_hook’:
src/plugins/python_plugins.c:281:43: error: implicit declaration of function ‘PyString_AsString’ [-Werror=implicit-function-declaration]
                 char *result_str = strdup(PyString_AsString(PyUnicode_AsUTF8String(result)));
                                           ^
src/plugins/python_plugins.c:281:43: error: passing argument 1 of ‘strlen’ makes pointer from integer without a cast [-Werror=int-conversion]
                 char *result_str = strdup(PyString_AsString(PyUnicode_AsUTF8String(result)));
                                           ^
In file included from /usr/include/python3.5m/Python.h:30:0,
                 from src/plugins/python_plugins.c:35:
/usr/include/string.h:394:15: note: expected ‘const char *’ but argument is of type ‘int’
 extern size_t strlen (const char *__s)
               ^~~~~~
In file included from /usr/include/string.h:630:0,
                 from /usr/include/python3.5m/Python.h:30,
                 from src/plugins/python_plugins.c:35:
src/plugins/python_plugins.c:281:43: error: passing argument 2 of ‘memcpy’ makes pointer from integer without a cast [-Werror=int-conversion]
                 char *result_str = strdup(PyString_AsString(PyUnicode_AsUTF8String(result)));
                                           ^
In file included from /usr/include/features.h:368:0,
                 from /usr/include/limits.h:25,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/include-fixed/limits.h:168,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/include-fixed/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/include-fixed/limits.h:34,
                 from /usr/include/python3.5m/Python.h:11,
                 from src/plugins/python_plugins.c:35:
/usr/include/bits/string3.h:50:1: note: expected ‘const void * restrict’ but argument is of type ‘int’
 __NTH (memcpy (void *__restrict __dest, const void *__restrict __src,
 ^
In file included from /usr/include/string.h:630:0,
                 from /usr/include/python3.5m/Python.h:30,
                 from src/plugins/python_plugins.c:35:
src/plugins/python_plugins.c:281:43: error: passing argument 1 of ‘__strdup’ makes pointer from integer without a cast [-Werror=int-conversion]
                 char *result_str = strdup(PyString_AsString(PyUnicode_AsUTF8String(result)));
                                           ^
/usr/include/bits/string2.h:1278:14: note: expected ‘const char *’ but argument is of type ‘int’
 extern char *__strdup (const char *__string) __THROW __attribute_malloc__;
              ^~~~~~~~
src/plugins/python_plugins.c:286:43: error: passing argument 1 of ‘strlen’ makes pointer from integer without a cast [-Werror=int-conversion]
                 char *result_str = strdup(PyString_AsString(result));

....

Are there any configure options to set the default python path?

@boothj5
Copy link
Collaborator

boothj5 commented Jul 19, 2016

I'm currently working on Python3 support in a branch https://github.com/boothj5/profanity/tree/python3 it's pretty much finished and I'm just testing. The branch checks for the default system Python version and should compile against it (2 or 3).

If you want to build this branch it will help me with testing also.

Otherwise there are two options until the branch is merged:

  1. Don't pass the --enable-python-plugins to ./configure, should build without plugins support.
  2. If you have Python 2 installed but it's not the default, you can set an environment variable when building e.g. ./configure PYTHON_VERSION=2 --enable-python-plugins

@boothj5
Copy link
Collaborator

boothj5 commented Jul 24, 2016

Python 3 support has been merged to master.

Let me know if you have any issues.

@boothj5 boothj5 closed this as completed Jul 24, 2016
@rumpelsepp
Copy link
Author

Hey, I somehow missed your answer in the first place. Thank you for elaborating the build flags, it works and I can use the plugins. No issues so far. :)

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