Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1349954 - libselinux-2.5-8.fc25 breaks libselinux-python (ImportError: No module named '_selinux')
Summary: libselinux-2.5-8.fc25 breaks libselinux-python (ImportError: No module named ...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: libselinux
Version: rawhide
Hardware: All
OS: All
unspecified
urgent
Target Milestone: ---
Assignee: Petr Lautrbach
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: AcceptedBlocker
Depends On:
Blocks: F25AlphaBlocker
TreeView+ depends on / blocked
 
Reported: 2016-06-24 16:01 UTC by Adam Williamson
Modified: 2016-06-27 07:48 UTC (History)
7 users (show)

Fixed In Version: libselinux-2.5-8.fc25.x86_64
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-27 07:48:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Adam Williamson 2016-06-24 16:01:17 UTC
Today's Rawhide compose failed to yield any images. Looking at the logs, it's clear that libselinux broke things. Here's a live image compose log:

https://kojipkgs.fedoraproject.org//work/tasks/284/14630284/mock_output.log

note the traceback:

Traceback (most recent call last):
  File "/usr/lib64/python3.5/site-packages/selinux/__init__.py", line 18, in swig_import_helper
    return importlib.import_module(mname)
  File "/usr/lib64/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
ImportError: No module named '_selinux'

This is clearly related to the libselinux-policy change in 2.5-8.fc25 which landed on the same day:

- Move _selinux.so to /usr/lib64/python*/site-packages

and is an automatic F25 Alpha blocker: "Bugs which entirely prevent the composition of one or more of the release-blocking images required to be built for a currently-pending (pre-)release" - https://fedoraproject.org/wiki/QA:SOP_blocker_bug_process#Automatic_blockers

Comment 1 Petr Lautrbach 2016-06-27 07:48:28 UTC
This is a problem related to the new swig-3.10. It changed a way how it creates modules with bindings so that a new module doesn't use imp.find_module('_selinux', [dirname(__file__)]) but  importlib.import_module('_selinux')

It means that even when libselinux-2.5-6.fc25 (which originally worked just find in Rawhide) was rebuilt, it stopped worked. I found it out second day after I built 2.5-7.fc25 because I tested it on my f24 with the old swig and everything worked just fine. It was fixed on Friday by 2.5-8.fc25 update.



# rpm -q libselinux
libselinux-2.5-7.fc25.x86_64

# python3 -c 'import selinux'
Traceback (most recent call last):
  File "/usr/lib64/python3.5/site-packages/selinux/__init__.py", line 18, in swig_import_helper
    return importlib.import_module(mname)
  File "/usr/lib64/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
ImportError: No module named '_selinux'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python3.5/site-packages/selinux/__init__.py", line 21, in <module>
    _selinux = swig_import_helper()
  File "/usr/lib64/python3.5/site-packages/selinux/__init__.py", line 20, in swig_import_helper
    return importlib.import_module('_selinux')
  File "/usr/lib64/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_selinux'

# dnf update
...

# rpm -q libselinux
libselinux-2.5-8.fc25.x86_64

# python3 -c 'import selinux'

#


Note You need to log in before you can comment on or make changes to this bug.