archlinuxhardened / selinux

PKGBUILDs to build SELinux enabled packages for Arch Linux
146 stars 25 forks source link

build_and_install.sh fails; python cannot import _selinux #23

Closed ColonelThirtyTwo closed 5 years ago

ColonelThirtyTwo commented 5 years ago

Running this script on a fresh Arch install inside of a VM. Looks like setroubleshoot fails to configure with the following error:

checking whether /usr/bin/python version is >= 3... yes
checking for /usr/bin/python version... 3.7
checking for /usr/bin/python platform... linux
checking for /usr/bin/python script directory... ${prefix}/lib/python3.7/site-packages
checking for /usr/bin/python extension module directory... ${exec_prefix}/lib/python3.7/site-packages
checking for the selinux python3 module... no
configure: error: cannot import Python3 module selinux
                   Please check your Python3 installation. The error was:
                   Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.7/site-packages/selinux/__init__.py", line 13, in <module>
    from . import _selinux
ImportError: cannot import name '_selinux' from 'selinux' (/usr/lib/python3.7/site-packages/selinux/__init__.py)
==> ERROR: A failure occurred in build().
    Aborting...

I get the same error if I run import selinux in the shell. pacman -Q shows an selinux-python entry, so maybe it's not installing properly?

Checked out commit b704c89bb1b

fishilico commented 5 years ago

Hi, thank you for the bug report. It is an incompatibility with SWIG 4.0 that has been fixed by upstream in https://github.com/SELinuxProject/selinux/commit/2efa06857575e4118e91ca250b6b92da68b130d5. I have backported the commit in libselinux 2.9-2 (the python module is packaged by libselinux in https://github.com/SELinuxProject/selinux/releases, selinux-python provides other Python libraries).

Did this fix your issue?

ColonelThirtyTwo commented 5 years ago

Seems to get farther. Now I'm having an issue where Linux-PAM-1.3.1.tar.xz fails gpg verification.

ColonelThirtyTwo commented 5 years ago

Oh. Looks like if I run makepkg manually it succeeds with a the key has expired warning, but from my script it fails. Is that something you can fix?

ColonelThirtyTwo commented 5 years ago

Actually it looks like my other weirdness was coming from running the build in arch-chroot, which causes some of the sudo tests to fail (trying to install it as part of the normal arch install proccess).