Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 598708

Summary: dev-lang/swig-3.0.10: import wrapper for dev-util/lldb guesses wrong package name
Product: Gentoo Linux Reporter: Michał Górny <mgorny>
Component: Current packagesAssignee: Tim Harder <radhermit>
Status: RESOLVED FIXED    
Severity: normal CC: ave, dschridde+gentoobugs, holger, llvm, radhermit, rr.underwood94, scheme
Priority: Normal Keywords: REGRESSION
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/swig/swig/issues/769
Whiteboard:
Package list:
Runtime testing required: ---

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-11-01 21:41:43 UTC
swig generates some crappy code in /usr/lib64/python2.7/site-packages/lldb/__init__.py:

  from sys import version_info as _swig_python_version_info
  if _swig_python_version_info >= (2, 7, 0):
    def swig_import_helper():
      import importlib
      pkg = __name__.rpartition('.')[0]
      mname = '.'.join((pkg, '_lldb')).lstrip('.')
      try:
        return importlib.import_module(mname)
      #...

Now, since __name__ is just 'lldb', pkg is null and it tries to import top-level '_lldb' (instead of 'lldb._lldb'). I guess the hackery they're doing is supposed to be handle importing from named .py files but doesn't cover the special case for __init__.py.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-11-01 21:49:12 UTC
I will need a while to test the older version but it seems that it is the linked regression in 3.0.9. AFAICS upstream is not keen on fixing it before 3.1, so I'll probably end up forcing the older version in lldb ebuild.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-11-01 22:13:37 UTC
Yep, confirmed 3.0.8 works fine.
Comment 3 Yury Katuar 2017-11-03 19:52:30 UTC
I suggest to change the dependency string to

python? ( || ( <dev-lang/swig-3.0.9 >dev-lang/swig-3.0.10 ) )

for lldb 5.0.0 and above, swig is compatible again since 3.0.11, in accordance with https://reviews.llvm.org/D33409. lldb-4.0.1 would need this patch to be backported though.
Comment 4 Larry the Git Cow gentoo-dev 2018-03-28 10:11:08 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4cea56b7d3193645fe884ff7e7241ecc5867a1e0

commit 4cea56b7d3193645fe884ff7e7241ecc5867a1e0
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2018-03-28 10:09:23 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2018-03-28 10:10:58 +0000

    dev-util/lldb: Allow dev-python/swig >= 3.0.11 in 5+
    
    Closes: https://bugs.gentoo.org/598708

 dev-util/lldb/lldb-5.0.1.ebuild    | 4 +---
 dev-util/lldb/lldb-6.0.0.ebuild    | 4 +---
 dev-util/lldb/lldb-6.0.9999.ebuild | 4 +---
 dev-util/lldb/lldb-9999.ebuild     | 4 +---
 4 files changed, 4 insertions(+), 12 deletions(-)