Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 577638 - net-irc/weechat disrespect PYTHON_TARGETS. Always compiling against python-2.7
Summary: net-irc/weechat disrespect PYTHON_TARGETS. Always compiling against python-2.7
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Tim Harder
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-17 16:26 UTC by Oleh
Modified: 2016-03-31 04:13 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
diff (weechat-diff.txt,583 bytes, text/plain)
2016-03-30 06:07 UTC, Oleh
Details
ebuild (weechat-1.4.ebuild,3.74 KB, text/plain)
2016-03-30 06:07 UTC, Oleh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oleh 2016-03-17 16:26:07 UTC
With python USE flag enabled weechat always compiling against python-2.7, regardless PYTHON_TARGETS or PYTHON_SINGLE_TARGET set. 

emerge weechat -pv

Calculating dependencies... done!
[ebuild   R    ] net-irc/weechat-1.4::gentoo  USE="alias charset exec fifo irc logger nls perl python relay scripts spell ssl trigger xfer -doc -guile -lua -ruby -tcl {-test}" LINGUAS="-cs -de -es -fr -hu -it -ja -pl -pt_BR -ru -tr" PYTHON_SINGLE_TARGET="python3_4 -python2_7 -python3_3 -python3_5" PYTHON_TARGETS="python2_7 python3_4 -python3_3 -python3_5" 0 KiB

notice a python_targets used. Compile and install it. When running weechat notice:

Error: unable to load plugin "/usr/lib64/weechat/plugins/python.so": /usr/lib64/weechat/plugins/python.so: undefined symbol: PyUnicode_AsUTF8String
If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)

PyUnicode_AsUTF8String symbol only present in python3.4:


oleg2 ~ # scanelf -r -s PyUnicode_AsUTF8String /lib/* /usr/* /opt/* 
ET_DYN   -   PyUnicode_AsUTF8String /usr/lib64/libboost_python-3.4.so.1.58.0 
ET_DYN   -   PyUnicode_AsUTF8String /usr/lib64/libpython3.4m.so.1.0
oleg2 ~ #

somehow, weechat is only built against python-2.7

oleg2 ~ # scanelf -nf $(qlist weechat | sort)
 TYPE   NEEDED FILE 
ET_EXEC libgcrypt.so.20,libgnutls.so.28,libdl.so.2,libncursesw.so.6,libpthread.so.0,libm.so.6,libcurl.so.4,libc.so.6 /usr/bin/weechat-curses 
ET_DYN libc.so.6 /usr/lib64/weechat/plugins/alias.so 
ET_DYN libaspell.so.15,libc.so.6 /usr/lib64/weechat/plugins/aspell.so 
ET_DYN libc.so.6 /usr/lib64/weechat/plugins/charset.so 
ET_DYN libc.so.6 /usr/lib64/weechat/plugins/exec.so 
ET_DYN libc.so.6 /usr/lib64/weechat/plugins/fifo.so 
ET_DYN libgnutls.so.28,libgcrypt.so.20,libc.so.6 /usr/lib64/weechat/plugins/irc.so 
ET_DYN libc.so.6 /usr/lib64/weechat/plugins/logger.so 
ET_DYN libperl.so.5.22,libc.so.6 /usr/lib64/weechat/plugins/perl.so 
ET_DYN libpython2.7.so.1.0,libc.so.6 /usr/lib64/weechat/plugins/python.so 
ET_DYN libz.so.1,libgcrypt.so.20,libgnutls.so.28,libc.so.6 /usr/lib64/weechat/plugins/relay.so 
ET_DYN libz.so.1,libgcrypt.so.20,libc.so.6 /usr/lib64/weechat/plugins/script.so 
ET_DYN libc.so.6 /usr/lib64/weechat/plugins/trigger.so 
ET_DYN libgcrypt.so.20,libc.so.6 /usr/lib64/weechat/plugins/xfer.so 
oleg2 ~ #

After forcefully setting:
oleg2 ~ # USE="-python_targets_python2_7 python_targets_python3_4 python_single_target_python3_4" emerge weechat and installing, weechat is still built against python-2.7

oleg2 ~ # scanelf -nf $(qlist weechat | sort)
 TYPE   NEEDED FILE 
ET_EXEC libgcrypt.so.20,libgnutls.so.28,libdl.so.2,libncursesw.so.6,libpthread.so.0,libm.so.6,libcurl.so.4,libc.so.6 /usr/bin/weechat-curses 
ET_DYN libc.so.6 /usr/lib64/weechat/plugins/alias.so 
ET_DYN libaspell.so.15,libc.so.6 /usr/lib64/weechat/plugins/aspell.so 
ET_DYN libc.so.6 /usr/lib64/weechat/plugins/charset.so 
ET_DYN libc.so.6 /usr/lib64/weechat/plugins/exec.so 
ET_DYN libc.so.6 /usr/lib64/weechat/plugins/fifo.so 
ET_DYN libgnutls.so.28,libgcrypt.so.20,libc.so.6 /usr/lib64/weechat/plugins/irc.so 
ET_DYN libc.so.6 /usr/lib64/weechat/plugins/logger.so 
ET_DYN libperl.so.5.22,libc.so.6 /usr/lib64/weechat/plugins/perl.so 
ET_DYN libpython2.7.so.1.0,libc.so.6 /usr/lib64/weechat/plugins/python.so 
ET_DYN libz.so.1,libgcrypt.so.20,libgnutls.so.28,libc.so.6 /usr/lib64/weechat/plugins/relay.so 
ET_DYN libz.so.1,libgcrypt.so.20,libc.so.6 /usr/lib64/weechat/plugins/script.so 
ET_DYN libc.so.6 /usr/lib64/weechat/plugins/trigger.so 
ET_DYN libgcrypt.so.20,libc.so.6 /usr/lib64/weechat/plugins/xfer.so 
oleg2 ~ #


Reproducible: Always

Steps to Reproduce:
1. USE=python emerge weechat
2. try running weechat                 
3.
Comment 1 Oleh 2016-03-30 06:05:53 UTC
problem is that weechat hardcodes python executables and lins and library path:

if(ENABLE_PYTHON3)
   find_program(PYTHON_EXECUTABLE
     NAMES python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python
     PATHS /usr/bin /usr/local/bin /usr/pkg/bin
     )
 else()
   find_program(PYTHON_EXECUTABLE
     NAMES python2.7 python2.6 python2.5 python
     PATHS /usr/bin /usr/local/bin /usr/pkg/bin
     )
 endif()
   if(ENABLE_PYTHON3)
    find_library(PYTHON_LIBRARY
       NAMES python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python
      HINTS ${PYTHON_POSSIBLE_LIB_PATH}
       )
   else()
     find_library(PYTHON_LIBRARY
       NAMES python2.7 python2.6 python2.5 python
       HINTS ${PYTHON_POSSIBLE_LIB_PATH}
       )
   endif()
Comment 2 Oleh 2016-03-30 06:06:44 UTC
attached the diff in ebuilds and ebuild itself, which fixes this. only with 1.4 verison
Comment 3 Oleh 2016-03-30 06:07:05 UTC
Created attachment 429274 [details]
diff
Comment 4 Oleh 2016-03-30 06:07:26 UTC
Created attachment 429276 [details]
ebuild
Comment 5 Tim Harder gentoo-dev 2016-03-31 04:13:11 UTC
Fixed in 1.4-r1 and 9999.